If you are getting the coordinate array back fine (i.e. no capability errors)
then you have to remember that a moving object is really a non-moving object
with a transform above it in the scene graph. All Geometry coordinates are
held in the objects local coordinate system.
So, to get the world coordinates of that object (cube), you must transform the
coordinates by the total transforms above it in the scene graph.
SCENE
|
TRANSFORM <--- must apply this transform to this geometry |
| to get REAL (WORLD) |
SHAPE3D coordinates |
| |
GEOMETRY <--------------------------------
Also, remember that it must be the result of ALL the transforms above your
moving object, not just the first one above it in the scene graph. If there
are others above, they must be used too.
Hope that helps.
HAroldo Pereira wrote:
> Hi
>
> I have a problem when I want get the coordenates of the any object (Cube).
>
> This cube was create with QuadArray and have rotation and translation
> moving in the virtual world.
>
> I want get the coordenates of every six vertices of the cube. I am using
> the behavior WakeupOnTransformChange. My method processStimulus have :
>
> public void processStimulus(Enumeration criteria) {
> // get the geometry the cube
> Geometry geo = shape.getGeometry();
>
> // Cast , because i cannot get the coordenate of the
> // Geometry object
> GeometryArray ga = (GeometryArray) geo;
> ga.setCapability(GeometryArray.ALLOW_COORDINATE_READ);
>
> // get the coordenates
> ga.getCoordinate(0, db);
>
> // print the coordenates on screen
> System.out.println(String.valueOf(db[0]) + "," +
> String.valueOf(db[1])
> + "," + String.valueOf(db[2]));
>
> wakeupOn(wChange);
> }
>
> It is not works.
> Is it the best form to get the coordenates of the moving objects ?
>
> Anybody have any examples about its. If yes, send for me.
>
> I wait your e-mails
>
> Thanks.
>
> []s
>
> HAroldo
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> ===========================================================================
> 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".
--
__________________________________________________________
Shawn Kendall Full Sail Real World Education
Course Director 3300 University BLVD
Real Time 3D for Gaming Winter Park FL 32792
[EMAIL PROTECTED] http://www.fullsail.com
__________________________________________________________
===========================================================================
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".