Jump to content
  • Advertisement
Sign in to follow this  
robertoliguori

A problem with the Utah Teapot

This topic is 3857 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 have to create the utah teapot by control points. I've done it!! But I can't wear it with a texture. This is the code to realiza the teapot for(k=0;k<maxpoints;k++) //we have 32 patches { glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, &data[k][0][0][0]); //data is the array of the control points glEnable(GL_MAP2_VERTEX_3); //this is a standard code I've find to design surfaces for (j = 0; j <= 8; j++) { glBegin(GL_LINE_STRIP); for (i = 0; i <= 30; i++) glEvalCoord2f((GLfloat)i/30.0, (GLfloat)j/8.0); glEnd(); glBegin(GL_LINE_STRIP); for (i = 0; i <= 30; i++) glEvalCoord2f((GLfloat)j/8.0, (GLfloat)i/30.0); glEnd(); } } I downloaded the red book for an example but I can't explain myself how do it the same. Now I try to explain... The book says that you have to use an evaluator also for texture but not with the control points used for the surface. The example on red book use an array like this: GLfloat texpts[2][2][2] = {{{0.0, 0.0}, {0.0, 1.0}}, {{1.0, 0.0}, {1.0, 1.0}}}; to pass to a function: glMap2f(GL_MAP2_TEXTURE_COORD_2,0, 1, 2, 2, 0, 1, 4, 2, &texpts[0][0][0]); then enable it: glEnable(GL_MAP2_TEXTURE_COORD_2); then write the surface (the utah teapot) I tried to use this array in very much kinds of ways from two days ago... but the texture not appear (only the teapot like wirefram) Maybe I'm wrong. Someone can help me? thanks...

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!