I am trying to label each side of the corners of a cube by using Text3D and
OrientedShape3D.
I would like the text to always face me although the cube itself seem to rotate.(The
viewplatform is rotated around the cube using OrbitBehavior.)
This is the code I use for the labels:
Font3D f3d = new Font3D(new Font("Default", Font.PLAIN, 1), null);
Text3D label = new Text3D(f3d, "coordinates of point", point,
Text3D.ALIGN_CENTER,Text3D.PATH_RIGHT);
OrientedShape3D labelShape= new OrientedShape3D(label, new Appearance(),
OrientedShape3D.ROTATE_ABOUT_POINT, point);
This works well when the origin of the cube is close to x = 0.0, y = 0.0,z = 0.0
(point A), but when the origin of the cube is far away from point A (x = 1000.0, y =
2000.0,z = 3000.0), the label at the corners of the cube doesn't face towards me
anymore.
The transformgroup of the cube (and the labels) is rotated (but I guess that has
nothing to do with my problem).
Transform3D trans = new Transform3D();
Transform3D rotX = new Transform3D();
rotX.rotX(-Math.PI/2);
trans.set(vector);
trans.mul(rotX);
I also have another problem: I would like the labels of all the eight corners of the
cube to be the same size, but the labels closest to me are much bigger that the labels
that are at the cornes in the back of the cube. I am almost unable to read the labels
at the back side of the cube when the cube is very big.
I tried using setConstantScaleEnable(true)
and setScale(0.5) and this makes the labels smaller, but they are not the same size...
Any suggestions ?
Elisabeth Thorsen
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".