Joseph Young:
|Fellow DX users ... Does anyone know the full specification of the OpenDX
|perspective camera? One can set To, From, Up, View Angle (fov), Window
|Width and Height in pixels. However, does anyone know exactly where the
|view or projection plane positioned with respect to the scene objects (in
|terms of World Coordinates)? - this is the plane that the perspective image
|is projected onto. And what front and back clipping planes are used?
|
|Any help would be greatly appreciated.
Do you mean software rendering?
I have a page of notes I wrote up on this a while back while picking
through the code. Might not be exactly what you need, but this is what I
have down:
(Camera space picture)
\ /
\ A B C / X
-------\----------------/-------- --->
\ / |
\ / \|/
\ t / Z
\/
D
The apex/eye (D) is 0,0,0. The center of your image (B) is (0,0,-1). The
X coord range of the image (A->C) runs from (-res/2,0,-1) to (res/2,0,-1).
The coord system is right-handed so Y is coming out of the monitor toward
you. The Y image coord range runs -res*aspect/2 -> res*aspect/2.
Note that this camera space is after the camera transform has been applied
but before we've done the perspective divide. The camera transform
includes an XY-only scale to convert from FOV units (aka "width"; world XY
units) to image resolution XY units (res). FOV=2*tan(t/2), where angle t
is the view angle.
The projection transform is "if pt.z < nearPlane: pt /= -pt.z", so z=-1 (in
camera space) is the projection plane. In world space, I think it's one
unit away on the vector from "from" to "to" (D->B). See matrix() in
camera.c to check that.
As far as front/back clipping planes, I believe there's only a front plane.
It's dynamically computed to avoid loss of precision, though I haven't
traced this through.
One other thing. DX uses this matrix order: x*A*B*C=y (at least in the
parts I looked through).
Hope this helps,
Randy
--
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA N127-01; RTP, NC 27711