Hi Klaus-Dieter!

You cannot. In fact, the coordinates are not changed at all. Just the matrix
from the TransformGroup is passed down the geometry pipeline. There,
together with your view matrix, the actual transformation is done (today on
the graphics board).

So if you want to have the transformed coordinates, you'll have to transform
them yourself.

- J

-----Ursprüngliche Nachricht-----
Von: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]
Im Auftrag von Klaus-Dieter Weimer
Gesendet: Montag, 30. August 2004 16:27
An: [EMAIL PROTECTED]
Betreff: [JAVA3D] Java3D , coordinates of a rotated object!

Hello,

actually we have the problem that we want to know the coordinates of an
object which has already been rotated by MouseRotate. Is there a way to come
to the new coordinates????


We started with a LineArray which contains the vertices and edges of our
3D-object.
The LineArray is part of the Shape3D object.

    public ColorCubeOwn1(Appearance app)
    {
        LineArray cube = new LineArray(24,
                LineArray.COORDINATES | LineArray.COLOR_3);
        cube.setCoordinates(0, verts);      // verts contains the vertices
of the object!!
        cube.setColors(0, colors);
        shape = new Shape3D(cube, app);
    }


The Shape3D object is part of a TransformGroup

        TransformGroup tg = new TransformGroup();
        tg.addChild( shape );


The TransformGroup is part of a  rootBranchGroup

     // First create the BranchGroup object
        BranchGroup  rootBranchGroup = new  BranchGroup();

       // Then add it to the rootBranchGroup
        rootBranchGroup.addChild(tg);

The TransformGroup is added to the MouseRotator and the MouseRotator is
added to the rootBranchGroup!

        MouseRotate myMouseRotate = new MouseRotate();
        myMouseRotate.setTransformGroup(tg);
        myMouseRotate.setSchedulingBounds(new BoundingSphere());
        rootBranchGroup.addChild(myMouseRotate);


The 3D object can be rotated with the MouseRotator .
Our problem is now to get the changed coordinates of the already rotated 3D
object.

We tried to read it from the LineArray.getCoordinates() method.
But this was not successful. We received only the data of the start position
of the 3D object.
We used the LineArray directly as well as fetched it from the Shape3D object
( getGeometry() ) or from the TransformedGroup ( getChild() )!!

How is it possible to get the changed coordinates?????????


Any help would be greatly appreciated.

regards


Dieter Weimer





_______________________________________________________
WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern Informationen unter:
http://freemail.web.de/?mc=021199

===========================================================================
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".

===========================================================================
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".

Reply via email to