> From: Kevin [mailto:[EMAIL PROTECTED] > Sent: Friday, March 5, 2004 05:39 PM > To: [EMAIL PROTECTED] > Subject: [JAVA3D] window resize policy doesn't seem to work for me > > I'm trying to change the window resize policy on the View object for my > scenegraph. I've changed it explicitly to VIRTUAL_WORLD which should > show more or less of the universe when the window is resized. However, > it still scales all of the objects in the view instead of showing more > of the universe. Is there another property I need to set to allow the > resize to work correctly? I looked through the View javadocs and > nothing seemed apparent.
The Java 3D view model documentation is terrible. Some of the claims it makes are completely wrong, and there are lots of interactions between the various view policies that are simply not described. You're probably using a perspective projection and have the window eyepoint policy set to the default of RELATIVE_TO_FIELD_OF_VIEW. With that policy, the eyepoint is automatically moved back and forth along Z to maintain a specified field of view (default 45 degrees) relative to the width of the window. This complete negates the effect of the VIRTUAL_WORLD window resize policy. You have to change the window eyepoint policy to RELATIVE_TO_WINDOW to get the VIRTUAL_WORLD window resize policy to work with a perspective projection. This fixes the eyepoint to follow the center of the window in X and Y, just like RELATIVE_TO_FIELD_OF_VIEW, except that you can specify a fixed Z depth relative to the window. That way, the eyepoint stays at the same place when the window gets bigger or smaller, altering the available field of view and showing more or less of the universe. You set the eyepoint distance with Canvas3D.setLeftManualEyeInImagePlate (and setRightManualEyeInImagePlate as well if using a stereo canvas). The X and Y coordinates are ignored with the RELATIVE_TO_WINDOW eyepoint policy. To set the initial field of view explicitly, call Canvas3D.getPhysicalWidth to get the width of the canvas in meters, and then set the Z coordinate of the manual eye to the canvas width divided by twice the tangent of half the desired field of of view. -- Mark Hood =========================================================================== 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".
