Hello guys I want to position a model relative to the screen size ( or window size for that matter ). I have two models that sit on my HUD. The HUD slides in and out of view by increasing the viewport size in a callback class. I am testing out the hud right now and I want the width of the HUD to be a variable size. Right now it is 25% of the screen. I want the models I have to be in the horizontal center of the HUD panel. I also want to be able to scale the HUD to 30% or 20 % or whatever and have the models always align properly.
What I am looking for is a way to set this up so that it will work on any screen size. Something like get the middle of the HUD if it is at 25%. So Screen->width - ((screen->width * 0.25)/2). Where the 0.25 is a dynamic variable. But this of course gives me a screen coordinate system. I looked at: http://forum.openscenegraph.org/viewtopic.php?t=9172 to get the screen coordinates to world coordinates and then at: http://forum.openscenegraph.org/viewtopic.php?p=25701#25701 to get world to local coordinates. It almost works, but the models are off of where I would expect them to be. like almost at the edge of the screen instead of in the middle of the HUD. Am i approaching this wrong? The last link I posted required a Node as the first paramater. I pass in the node of my model I want to position even though I have not added it to the scene yet. Other wise I don't know where to put the node. Also my HUD camera has an identity matrix for the view matrix and projection matrix as its a HUD, so I can't use those to move the HUD around. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61820#61820 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

