09-14-2002, 03:58 AM
1. How to map 2 else textures on two sides of polygon?
2. Can I map the polygon with texture and with normal color at the same time? I don't want to use texEnv
thanks in advance
#1 You can't apply different textures on different sides. However, you can emulate this in two passes.
First pass: Enable backface culling (glEnable(GL_CULL_FACE)), set cull face to back (glCullFace(GL_BACK)), and bind the texture you want to appear on the front face. Draw your object.
Second pass: Change cull face to front, and bind the texture you want to appear on the back face. Draw your object again.
You may have to change winding order of your vertices. If you have your vertices in clockwise order, call glFrontFace(GL_CW) before the first pass.
#2 That's like saying you want to drive a car, but you don't want to touch the steering wheel. It will work as long as the car is lined up fine on the road, and the road is only going stright forward. When the road turns, you're out.
glTexEnv is what you use to set up the texture combiners, so that they can combine different color sources. Not using them will work as long as the default combiner setup is what you're after. When you want something else, you're out.
You're in luck this time, cause the road you're driving on is only going stright forward. The default combiner setup is actually modulation between primary color and the texture. Just bind the texture, specify your color, and they will be modulated.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.