View Full Version : the way to map a sphere?
is there any simple way to map a sphere with glut?
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, Tex1Info->bmiHeader.biWidth,Tex1Info->bmiHeader.biHeight,GL_BGR_EXT,GL_UNSIGNED_BYTE, Tex4Bits);
glTranslatef(0.0f, 11.2f, 0.0f);
is it be possibe way work?
but the sphere is dark... not been mapped.
03-18-2001, 12:03 PM
I don't think GLUT's spheres can be mapped.
03-18-2001, 01:50 PM
I think GLU spheres can though, and it's pretty much the same interface. I always thought the GLUT wrapper was a bit pointless here.
You can use GLU to draw the sphere instead. Actually, GLUT uses GLU, but you don't have that much control from GLUT.
Try gluQuadricTexture to enable texture mapping when drawing the quadric.
......but you don't have that much control from GLUT.
are you mean that if i draw a glu shpere and mapped it,... but this sphere can not be controled by the functions of glut such as: glutKeyboardFunc(key);
03-19-2001, 12:00 PM
I think that you are under a misconception. glutKeyboardFunc, glutMouseFunc, glutMotionFunc do not control objects like glutSolidSphere... they act as callback functions to let you know when those events occur. Even using glutSolidSphere, you will have to move the sphere yourself by using functions such as glTranslate/glRotate... the same goes for using the glu Quadrics.
but, what's Bob means that get not much control from glut?...
03-19-2001, 06:27 PM
I presume that he means you can't call various glu functions on that sphere created with glut to do things with it (like generating texture coordinates, for example). If you create the sphere from glu, you can use gluQuadricTexture, which you can't if you use the glut function to draw the sphere.
I think you had to enable, that OpenGL automatically calcs texture coordinates.
Look at the red-book. I think it's discribed
What I meant what that there is no way of controlling how the object is drawn using GLUT. If you use GLU instead of GLUT for drawing objects, you have much more control.
And for OpenGL's automatic texture coordinate generation, that is an option aswell. But GLU can generate more acurate texture coordinates that fits the object you are drawing better.
oh.... i see,
thanks you all... http://www.opengl.org/discussion_boards/ubb/smile.gif
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.