[osg-users] How to Draw Infinte 3D Grid in osg

Robert Osfield robert.osfield at gmail.com
Thu Dec 8 02:41:01 PST 2016


On 8 December 2016 at 09:10, Rambabu Repaka <ramboram488 at gmail.com> wrote:
> Hi,I Want Projected onto to terrain

Finally we start to get to nearer to what you are actually after.  It
really shouldn't take others in the community to drag out of what you
actually need.  You should put the effort into your original posts
that properly describe the problem you are trying to solve.

For projecting a grid onto terrain the best route is to use
multi-texturing and leverage the fact that OpenGL supports wrapping of
texture coordinates so that a single texture can reapeat forever.
Create a texture with the grid on and then apply this to your
geometries either directly or applying it over the whole scene and
using texture generation on the GPU to covert the local coordinates
into the correct coordinates in the texture.  Personally I'd opt for
the later approach.

You need to learn about projective texturing, there are plenty of
resources on the web, just go to google and start searching.

Also look through the OSG code bases for places where
osg::TexGen/TexGenNode are used as these will provide another resource
for learning about the topic.

Once you haven't done the background learning the route forward should
become much clearer.

Robert.



More information about the osg-users mailing list