[osg-users] Creating texture coordinates
Hi all. Does anyone know about sample code for creating texture coordinates for a general triangle mesh? OpenGL can do this when using TexGen, but if I would like to generate this myself given coordinates, indices (and normals), is there a library that someone knows about that does this? Most 3D modelling tools have all of these tools, such as spherical/cylindrical/shrinkwrapped etc... It would be nice to be able to do this in code when creating the Geometry in OSG. Cheers, Anders -- __ Anders Backman, HPC2N 90187 UmeƄ University, Sweden and...@cs.umu.se http://www.hpc2n.umu.se Cell: +46-70-392 64 67 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Creating texture coordinates
On 12/10/2012 08:06 AM, Anders Backman wrote: Hi all. Does anyone know about sample code for creating texture coordinates for a general triangle mesh? OpenGL can do this when using TexGen, but if I would like to generate this myself given coordinates, indices (and normals), is there a library that someone knows about that does this? I don't know about a library, but the math involved isn't too difficult. The OpenGL spec gives all of the equations in the Texture Coordinate Generation section (Section 12.1.3 in the most recent spec for the OpenGL 4.3 compatibility profile). Indeed, TexGen is even deprecated in the core profile, as you're expected to do the work in your shaders instead nowadays. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org