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

Reply via email to