Re: [osg-users] Rendering From First Person
On Sun, 2011-10-09 at 04:53 +0200, Rishabh Taneja wrote: Hi Jeremy, I am a newbie in osg. I am working on a project to build a virtual environment.After trying a lot, I am not able to create first person experience in my environment. Can you help me out in this regard. Sure, do you have any sample code? What OS are you on? I may be able to provide a very simple example... ... Thank you! Cheers, Rishabh (ryshabtaneja@gmail) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43276#43276 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering From First Person
Hi Jeremy, I am a newbie in osg. I am working on a project to build a virtual environment.After trying a lot, I am not able to create first person experience in my environment. Can you help me out in this regard. ... Thank you! Cheers, Rishabh (ryshabtaneja@gmail) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43276#43276 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering From First Person
Paul Martz writes: On 9/28/2011 9:22 AM, Jean-Sébastien Guay wrote: Hi Jeremy, My question is how do I render these objects? Should I treat them specially (for example, adding them in a post render camera) or should I simply position them properly to be rendered in the main frame? I'm looking for some gotchas from other people who have done something similar. I'd render them as a separate camera, simply because they're very close to the eye and so might affect your depth range and precision pretty drastically. If you render them as a separate camera, you'll then have a main camera with a z range starting at over 1m (probably the ground will be the closest object most of the time) and a post-render camera with a very small near distance but a very close far distance too, so that's ideal. You can even keep automatic near-far calculation on for both, and it will likely work really well. I agree with J-S. If you use ABSOLUTE_RF and an identity view matrix, you should be able to draw these scene elements directly in eye space (you're looking down the -z axis with +y up). In OSG parlance, it's effectively a HUD. In OpenGL, the pattern looks like: push the modelview matrix, set it to identity, draw, then pop. Whenever rendering calls for this OpenGL pattern, in OSG you should immediately think Camera. Hi all, Just a question about this: shouldn't you clear the depth buffer also? If the near and far planes are different between cameras, aren't the contents of the depth buffer nonsense for the other camera? Or is it possible to make some assumption for this particular case? -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering From First Person
On Wed, 2011-09-28 at 11:37 -0600, Paul Martz wrote: On 9/28/2011 9:22 AM, Jean-Sébastien Guay wrote: Hi Jeremy, My question is how do I render these objects? Should I treat them specially (for example, adding them in a post render camera) or should I simply position them properly to be rendered in the main frame? I'm looking for some gotchas from other people who have done something similar. I'd render them as a separate camera, simply because they're very close to the eye and so might affect your depth range and precision pretty drastically. If you render them as a separate camera, you'll then have a main camera with a z range starting at over 1m (probably the ground will be the closest object most of the time) and a post-render camera with a very small near distance but a very close far distance too, so that's ideal. You can even keep automatic near-far calculation on for both, and it will likely work really well. I agree with J-S. If you use ABSOLUTE_RF and an identity view matrix, you should be able to draw these scene elements directly in eye space (you're looking down the -z axis with +y up). In OSG parlance, it's effectively a HUD. In OpenGL, the pattern looks like: push the modelview matrix, set it to identity, draw, then pop. Whenever rendering calls for this OpenGL pattern, in OSG you should immediately think Camera. -Paul Rendering directly into the framebuffer from a 2nd camera (like a HUD, as you said) turned out to really simplify things, but it does--of course--change how I need to handle lighting. Since the gun never technically moves (though it appears to because of the first camera) I'll have to come up with a way of updating this second camera with the proper lighting variables... ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering From First Person
Hi Jeremy, My question is how do I render these objects? Should I treat them specially (for example, adding them in a post render camera) or should I simply position them properly to be rendered in the main frame? I'm looking for some gotchas from other people who have done something similar. I'd render them as a separate camera, simply because they're very close to the eye and so might affect your depth range and precision pretty drastically. If you render them as a separate camera, you'll then have a main camera with a z range starting at over 1m (probably the ground will be the closest object most of the time) and a post-render camera with a very small near distance but a very close far distance too, so that's ideal. You can even keep automatic near-far calculation on for both, and it will likely work really well. Hope this helps, J-S -- __ Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering From First Person
On 9/28/2011 9:22 AM, Jean-Sébastien Guay wrote: Hi Jeremy, My question is how do I render these objects? Should I treat them specially (for example, adding them in a post render camera) or should I simply position them properly to be rendered in the main frame? I'm looking for some gotchas from other people who have done something similar. I'd render them as a separate camera, simply because they're very close to the eye and so might affect your depth range and precision pretty drastically. If you render them as a separate camera, you'll then have a main camera with a z range starting at over 1m (probably the ground will be the closest object most of the time) and a post-render camera with a very small near distance but a very close far distance too, so that's ideal. You can even keep automatic near-far calculation on for both, and it will likely work really well. I agree with J-S. If you use ABSOLUTE_RF and an identity view matrix, you should be able to draw these scene elements directly in eye space (you're looking down the -z axis with +y up). In OSG parlance, it's effectively a HUD. In OpenGL, the pattern looks like: push the modelview matrix, set it to identity, draw, then pop. Whenever rendering calls for this OpenGL pattern, in OSG you should immediately think Camera. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org