🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Drawing polygons on a box - newbie question

Started by
2 comments, last by Pierrick 16 years, 11 months ago
Hi, I am a new newbie with openGL but already addict of this 3d engine. Now my question : I have created 3d shapes such as boxes and mapped textures on them. This works good. Now I'd like to draw polygons on each box side. How can I do ? It's failing when I use the glVertex3f with glColor3f apis : the drawn polygon is "merged" with the side texture. I'd like to have the polygon drawn ABOVE the box textured side. Any help is fully welcome, Pierrick, who has a lot to learn about opengl !!!
Advertisement
Hello,

Could you post the code where you draw your textured cube ? I don't have that much experience with OpenGL but maybe I can help a bit.
Seems to me, you want to render to the sides of the cube (or whatever it is). The easier way is to render to texture. It generally works in the following way:

1. You set up the renderer and draw what you want the sides of the cube to look. So if you want a red triangle on the side, you draw it now.

2. You convert the drawn image to a texture. This can be made in many ways, just make a quick search on the forums.

3. You set up the renderer for the second time and render the cube textured by the texture from (2).

Tommy
Clever! Thx for the trick ;)

This topic is closed to new replies.

Advertisement