Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Some help with lists and textures

This topic is 5419 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I am new in opengl so i need some help. I try to create an object using a list. I use this function(face_num is defined above-points needed to create the object) GLint object() { int i; int j; GLint lid=glGenLists(1); glNewList(lis, GL_COMPILE); glBegin (GL_TRIANGLES); for(i=0;i[j]; glVertex3f (vertices[vi][0],vertices[vi][1],vertices[vi][2]); } } glEnd (); glEndList(); glCallList(lis); return lis; }; In my DrawGlscene i call the function like this glLoadIdentity(); glTranslatef(0.0f,0.0f,-2.0f); object(); Everything works fine and the object is drawn in the screen. Now i want to apply a texture to my object. Iknow how to load a texture and all this stuff but i have no idea how to get the coordinates of the object. I have read about automatically calculating the coordinates but i really do not understand that. I would really appreciate it if you could give me some code... I would also like to know what happens if your object needs two textures. Does it mean i have to split the object into the two parts and then apply the textures? Thanks

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!