-----Ursprüngliche Nachricht-----
Von: Jack Bowie [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 7. Oktober 2002 15:55
An: [EMAIL PROTECTED]
Betreff: [JAVA3D] Canvas3D property valuesI am trying to get various screen properties (window PhysicalWidth, etc.) from my Canvas3D and am having timing problems. The objective is to set ScreenScale (I'm using parallel projection) correctly for a full window presentation of my geometry.
I instantiate the Canvas3D, connect it to a SimpleUniverse, create a SceneGraph and make it live. I then query the canvas (via getPhysicalWidth(), etc) for the properties. Get all zeros. Assuming a timing issue, I have launched a thread and used InvokeLater(). Still zeros.
If I wait to read the properties until I explicitly mouse click in the (now visible) canvas, the values are fine.
Any recommendations on how to synchronize my application thread to get the values?
Thanks,
Jack
Title: Canvas3D property values
It's
not related to java3d but to the awt subsystem. You can't get any valid values
from your canvas3d (or btw any other awt component) before the native peer is
created. You should first create your frame, put inside your canvas3d with the
associated universe, eventualy create your scenegraph but don't attach it to the
universe, invoke show to display your window and AFTER that query the canvas to
get your properties, set ScreenScale and atach the scene graph to your
universe.
Hope
it works that way (it should, but I didn't tried it).
Florin
- Re: [JAVA3D] AW: [JAVA3D] Canvas3D property values Florin Herinean