Hi Zach, The default coordinates for a RenderSurface are normalized -1,1 to 1,1 with the bottom left as -1,-1, this is the same a clip space i.e. after your applied the model, view and projection matrices. The projectObjectIntoWindow will be adding a further multiplication by the viewport's window matrix to get it into window coords.
For you case wher you want the coords to go from 0,0 bottom left to 1,1 top right then you have two options - take the window coords and scale them down, or compute the clip space coords and scale/shift to from -1,-1/1,1 to 0,0/1,1. Robert. .On 12/8/06, Zach Deedler <[EMAIL PROTECTED]> wrote:
Hello, PROBLEM I want to convert a 3D object position into normalized render surface coordinates. BACKGROUND For example, I have a rear-view mirror overlay scene on top of my main view. I want to get the overlay coordinates of an object within the rear-view mirror (normalized). Thus, if it were in the center of the mirror, I want the function to return (0.5, 0.5). If it were at the bottom left (0,0). Top right = (1.0, 1.0) INVESTIGATION I can use projectObjectIntoWindow to get the pixel that the 3D object represents. But, I want to get this normalized to the render surface. QUESTION Any clues as to how to do this? Thanks. Zach _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
