Skip to main content
gamedev.net
🔒 Locked

UV Mapping Source Example?

Started by Braden 0 replies 1.7k views
Original Post
Braden
Braden
I can't seem to find any tutorials or example code on uv-mapping via google. There are plenty of tutorials for creating uv maps via lightwave, but none for importing the maps into opengl and applying them to an object or anything. If someone knows a link to opengl uv-mapping code or something it would be very helpful. Thanks! Braden
Regards,Braden
qesbit
qesbit
I think you got some issues confused here but I'll try to give you a hand.

When you import a model into opengl it should already have it's uv coords set for the model when you did it in Lightwave (or wherever). When you setup your vertex streams etc you setup the texture coords (uv's) for each vertex and the texture(s) you want active when you render.

There isn't any UV map for opengl, you just tell it when you want UVs and what they are for the vertex.

glBegin(GL_TRIANGLES)
glTexCoord2f(u,v)
glVertex3f(x,y,z)
glEnd(GL_TRIANGLES)

you need to setup the state for texturing, and to activate the texture you want applied to the stream.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.