glTexGeni
What is the difference between
GLfloat sPlane[4] = {1.0, 0.0, 0.0, 0.0};
GLfloat tPlane[4] = {0.0, 0.0, 1.0, 0.0};
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
glTexGenfv(GL_S, GL_EYE_PLANE, sPlane);
glTexGenfv(GL_T, GL_EYE_PLANE, tPlane);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_2D);
and
GLfloat sPlane[4] = {1.0, 0.0, 0.0, 0.0};
GLfloat tPlane[4] = {0.0, 0.0, 1.0, 0.0};
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, sPlane);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tPlane);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_2D);
.
They both seem produce EXACTLY the same effect,
no matter how I translate or rotate my objects.
EYE_LINEAR makes texture coordinates based on where the point is on the screen... when you look at the object, the model looks 3d but the texturing is 2d. Hard to explain, it''s as if the texture is a background and all you can see of it is the shape. OBJECT_LINEAR maps the texture directly to the object, and stays in place when the object is rotated. This is an easy way to apply some texture to the object quickly, but looks fake if the users can move around the object much. I don''t know why you get the same results...
______________________________
Pretty guy for a white fly.
______________________________
Pretty guy for a white fly.
______________________________Pretty guy for a white fly.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement