I ran into a problem like this a while back. Not as simple as I'd have liked it to be, that's for sure.
You can't just make a quad "extending to infinity" because ultimately you have to feed actual coordinates to opengl. You can make a really big quad, assuming you can ensure that your viewing volume will never extend beyond the edges of it. I needed my ground plane to have random dots on it, and the camera moves around the ground plane, so it was impractical to generate a single ground plane prior to the application running. My solution was to create a custom node core OSGGroundPlaneCore. When it is rendered, this core fetches the camera beacon and the camera's viewing volume parameters (near plane, far plane, etc). I use all that to compute the viewable region of the plane, and generate graphics which cover only that region. I use pre-computed grids with plain colors and random dots, though the technique could be extended to to use textures or simple colors/patterns. That's considerably more complicated than the simplest solution, so I won't bore you with the details unless you really need them. Let me know - I'd be glad to share the code with the list. Another option, though its one I know little about, is to use a terrain generator.... it seems there has been some discussion of these on this list, and I've seen or heard of them before. These are for generating 3D surfaces, not planes. YMMV. Dan Pablo Carneiro Elias wrote: > Hi there.. is there any way to create a plane extending to infinity in > every direction? as the ocean surface or something like that... I've > tried w = 0 using osg::Vec4f , but it doesnt work... > > any hints? > > its is just a geo quad extending to infinity (creating horizon line). > In fact, extending to infinity means that translation has no efect, > only rotation... it means that if there is any whay of specifying that > my coordinates are already within camera coordinate system it will be > perfect.. is there any way to do this or I'll need to take the inverse > translation of the camera and set it as the node's translation? In > OpenSceneGraph there is a flag that sets a transform as being within > camera coordinate system. > > > thanks > > []'s! > > Pablo > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > ------------------------------------------------------------------------ > > _______________________________________________ > Opensg-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/opensg-users > -- Daniel J. Sperka, Ph. D. UC Davis Center for Neuroscience ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
