Hi,

  You have to invoke

   ga.setCapability(GeometryArray.ALLOW_COORDINATE_READ);

before scene graph is live. In processStimulus()

the scene graph, the scene graph is already live and

setting this will throw an Exception.

- Kelvin

-------------
Java 3D Team
Sun Microsystems Inc.

>X-Originating-IP: [161.24.1.212]
>Mime-Version: 1.0
>Date: Tue, 11 Apr 2000 22:33:33 EST
>From: HAroldo Pereira <[EMAIL PROTECTED]>
>Subject: [JAVA3D] GetCoordenates
>Comments: To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>
>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".

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