> Date: Wed, 30 Oct 2002 17:34:28 +0000 > From: "A. Murat Tanyer" <[EMAIL PROTECTED]> > > Can anybody describe me how the ortho method in Transform3D class works. > [...] > > But how can I calculate the values in the paranthesis? Are those values > related with the BACK_CLIP_DISTANCE and FRONT_CLIP_DISTANCE?
The Transform3D.ortho() method is intended for use with the camera model compatibility-mode View methods setLeftProjection() and setRightProjection(). The parameters are expressed in eye coordinates, like OpenGL, except the coordinate system is right-handed. So yes, the `front' and `back' parameters specify the front and back clip planes, but always relative to the eyepoint. You set compatibility mode on a View by calling its setCompatibilityModeEnable() method. In this mode you explicitly set the position and orientation of the eyepoint relative to the ViewPlatform by calling View.setVpcToEc() method. If you use an identity transform than ViewPlatform coordinates are identical to eye coordinates. Normally the eyepoint is set automatically with the default WindowEyepointPolicy of RELATIVE_TO_FIELD_OF_VIEW or manually through the RELATIVE_TO_SCREEN, RELATIVE_TO_WINDOW, or RELATIVE_TO_COEXISTENCE policies. > I am trying to get the parallel projection view of my scene but > view.setProjectionPolicy(View.PARALLEL_PROJECTION); > method causes a problem. My scene comes to the location of eye so I > cannot see my scene except the whole canvas is coverer by a single object. You don't need to use compatibility mode to solve this problem. As Roger Berggren indicated in a previous post, you can use set the screen scale to alter the projected image scale when using a parallel projection. Call the View.setScreenScalePolicy() method with SCALE_EXPLICIT and then set the screen scale using View.setScreenScale(). The default policy of SCALE_SCREEN_SIZE sets the screen scale to half the physical width of the screen (usually something like 0.17), which seems to be too large for you, so try setting it to 0.1 or less. NOTE: the screen scale will only reliably effect an apparent zoom if you use a parallel projection; with perspective, objects in the virtual world will scale further or closer away from the eyepoint in response to the screen scale, which can completely undo the zoom effect. Alternatively, you can just adjust the transform above the object to scale the object smaller. Performance-wise, this is much less efficient than setting the screen scale, but if you don't need dynamic scaling then it should work just as well. You could also scale the ViewPlatform larger by adjusting the scale factor of the transform above it. However, if you have any translation in the ViewPlatform transform then the ViewPlatform will move relative to the virtual world. -- 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".
