Re: UnionSet and Animation

Hi Jay,

The only things I can think of are make sure that time_type
in text_tuple are the same as the time domain RealType used
to construct the image_sequence_* Fields, and make sure
time_set in text_field is the same as the domain Set used
to construct the image_sequence_* Fields.

Good luck,
Bill

On Sun, 23 Feb 2003, Jay Patel wrote:

> Hi,
> I have 3 Gridded3DSets animated and now wanted to display text at particular
> points in the animation. The way I have set up the text is:
> TextType text = new TextType("text");
> TupleType text_tuple = new TupleType(new MathType[] {x, y, z, text});
> FunctionType text_function = new FunctionType(time_type,text_tuple);
> FieldImpl text_field = new FieldImpl(text_function, time_set);
>
> The way I put the values is:
> TupleIface tt=null;
> float[][] samples1 = new float[3][6];
> for(int i=0;i<max_points;i++)
> {
> samples1[0][0] = sensor1[i][0];
> samples1[1][0] = sensor1[i][1];
> samples1[2][0] = sensor1[i][2];
> Data[] td1 = {new Real(x,samples1[0][0]),
> new Real(y,samples1[1][0]),
> new Real(z,samples1[2][0]),
> new Text(text, "Sensor " + 1)};
> tt = new Tuple(text_tuple, td1);
> text_field.setSample(i, tt);
> .....
> ...
> ....
> gsp_right[i] = new Gridded3DSet(xyz_right, samples1,6);
> image_sequence_right.setSample(i,gsp_right[i]);
> }
> ..
> ..
> ...
> FieldImpl[] figure
> {image_sequence_right,image_sequence_left,image_sequence_shoulder,text_field
> };
>  Tuple big_tuple = new Tuple(figure);
> DisplayImpl display = new DisplayImplJ3D("image display");
>  ScalarMap xmap=new ScalarMap(x, Display.XAxis);
>  ScalarMap ymap=new ScalarMap(y, Display.YAxis);
>  ScalarMap zmap=new ScalarMap(z, Display.ZAxis);
>  ScalarMap textmap = new ScalarMap(text,Display.Text);
>  ScalarMap map1animation =  new ScalarMap(RealType.Time, Display.Animation);
>  display.addMap(xmap);
>  display.addMap(ymap);
>  display.addMap(zmap);
>  display.addMap(textmap);
>  display.addMap(new ConstantMap(1, Display.Red));
>  display.addMap(new ConstantMap(1, Display.Green));
>  display.addMap(new ConstantMap(0, Display.Blue));
>  display.addMap(map1animation);
>  final DataReference tetref = new DataReferenceImpl("tet");
>  tetref.setData(big_tuple);
>  display.addReference(tetref,null);
>
>
> The animation with the Gridded3DSets works fine but I cannot see the labels.
> If I dont animate the Text labels then I can see them ... but i need to
> animate them to so that they are seen along with the Gridded3DSets. Can any
> one help?
> Thanks,
> Jay
>
>