Textures and colors and spinning a cube
Is it possible to glcolor and texture in same program? I tried to do a program with a cube with some faces having color and some having textures, but when i run the progam the texture faces becomes colors how can I have texture and colors?
Another note, I tried to program to have a cube rotate directly on one of its corners, like how a top spins on one point except much slower. So how much rotation on which axis should I assign to get the result i desire.
To have a cube with textures and colors, just clear the color before the textureing. That way the textured quad will retain the color of the texture and then change the color for the quad without the texture.
If you want the cube to rotate on a corner, use a static rotate(glRotatef(90, 0.0f, 1.0f, 0.0f)) to position the cube, then call a dynamic rotate (glRotatef(angle, 0.0f, 1.0f, 0.0f)) to rotate around the y-axis.
dimebag
If you want the cube to rotate on a corner, use a static rotate(glRotatef(90, 0.0f, 1.0f, 0.0f)) to position the cube, then call a dynamic rotate (glRotatef(angle, 0.0f, 1.0f, 0.0f)) to rotate around the y-axis.
dimebag
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement