> Date:         Wed, 19 Feb 2003 15:15:42 -0600
> From: Zak Nixon <[EMAIL PROTECTED]>
>
> I am currently studying OpenGL, and trying to make an application that = will
> show the viewing volumes in a 3D application.=20
>
> How can I retrieve these values, for example in OpenGL
>
>     glFrustrum(top,bottom,left,right,near,far);
>     glPerspective(fovy,aspectRatio, near,far);
>     glOrtho(top,bottom,left,right,near, far);
>     and so on.

The parameters give you all the info that you need -- they describe the
position and orientation of the view frustum planes relative to the eyepoint.
So compute the plane equations and transform them from eye coordinates to
virtual world coordinates, and then display them from a different view point.

In Java 3D, you can use the getInverseVworldProjection() method of Canvas3D to
get the projection matrix from clip coordinates to the virtual world.  The
[+1..-1] bounds of clip coordinates are the corners of the view frustum in
projection space.  To get them in vworld, transform the 8 Vector4d objects
containing the clip corners ({1.0, 1.0, 1.0, 1.0}, {-1.0, -1.0, -1.0, 1.0},
etc.) by the inverse vworld projection matrix, and then divide the 3D Euclidean
x, y, and z coordinates by w (the 4th component).

-- 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".

Reply via email to