[osg-users] Creating texture coordinates

8 views
Skip to first unread message

Anders Backman

unread,
Dec 10, 2012, 8:06:55 AM12/10/12
to OpenSceneGraph Users
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

Jason Daly

unread,
Dec 10, 2012, 3:22:55 PM12/10/12
to osg-...@lists.openscenegraph.org
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-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Reply all
Reply to author
Forward
0 new messages