Skip to main content
GameDev.net gamedev.net
🔒 Locked

glTexGeni

Started by circuit Apr 11, 2002 at 12:13 PM 0 replies 2.3k views
Original Post
circuit
circuit
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.
hooded_paladin
hooded_paladin
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.