The code I wrote to do this, and my notes, stayed with my former employer, so I know of no published sources. It is not any kind of secret patented technology, it is just a linear algebra equation that you need to solve.

(I'm not trying to be a jerk by declaring it "easy", then withholding the information on how to do it. I just have too many other commitments right now to spend time solving this equation for you. It really is not too complicated, and if you know the OpenGL pipe and linear algebra, you can probably work it out on a white board in an hour or two.)

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466



Cysneros, Nelson A CIV SPAWARSYSCEN-PACIFIC, 56510 wrote:
Thanks Paul,

I understand how to go through the OpenGL pipe to convert from World to
Screen coordinates and back

eye_coordinate = world_coordinate * view_matrix; clipspace_coordinate = eye_coordinate * projection_matrix; screen_coordindates = clipspace_coordinate * viewport_matrix;
But I'm unclear how to do it to get distance subtended by a single
pixel.
Can you point me to an example or an article?
Best Regards

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Paul
Martz
Sent: Tuesday, December 01, 2009 6:26 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Distance Per Pixel Calculation


Hi Nelson -- Given a world/eye coordinate distance from the eye, a viewport, and a projection matrix, you can determine the world/eye coordinate distance subtended by a single pixel by back-transforming through the OpenGL transformation pipe. At a former employer, I used such a technique to control the LOD of our rendered terrain.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466



Cysneros, Nelson A CIV SPAWARSYSCEN-PACIFIC, 56510 wrote:
I'm trying to determine the given distance per pixel (or group of
pixels)  on my scene.
I'm using an Intersection to get the World XYZ coordinates at a given Screen XY point, then getting a second set of World XYZ coordinates after incrementing the Screen point. Then Calculating the distance between the two World XYZ coordinates. Is there a better way of doing this? Thanks



----------------------------------------------------------------------
--

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to