Angus Dorbie (dorbie++at++sgi.com)
Thu, 20 Aug 1998 10:30:24 -0700
The point doesn't correspont to xy, just a vector, unless you
readback the zbuffer information.
So compute the vextor in eye space, this is simple using the frustum
parameters, it's just a lerp of screen x & y to frustum coordinates
and then z (or y depending on your coordinate system) is the frustum
near clip.
You then transform this vector through the viewing matrix (note in
Performer this is the viewing matrix you give the channel, in OpenGL
the modelview matrix is multiplied by the transpose).
Also transform the eye/vector origin 0,0,0 also to position the vector.
If you have the z depth you could use this to figure a point along
this vector. Remember that it's z not vector length so you multiply
x & y of the vector by zbuffer/vector z and then set vector z to
zbuffer. Note that this has to be done before you transform the vector,
while the vector is still in eye space. Although this gives a point in
eyespace, you should transform this as a vector and transform the origin
as a point.
You then add the transformed origin point to the transformed vector.
Cheers,Angus.
-- "Only the mediocre are always at their best." -- Jean GiraudouxFor advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/
This archive was generated by hypermail 2.0b2 on Thu Aug 20 1998 - 10:30:28 PDT