View Full Version : Front and Back sides with different colors
04-17-2000, 03:22 PM
Is there a way of setting different drawing colors for the front and back sides of entities such as polygons and NURBS surfaces?
04-19-2000, 05:17 AM
I know there is if you have lighting turned on. When you use glMaterial*(), the first parameter can be GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK. If you are not using GL lighting(just glColor*()), then I am not sure. You could also render your polygon mesh twice, the second time negating the normals(so that their fronts are facing the other direction), and just give the second mesh a different color than the first. Unfortunately I don't know anything about OGL and NURBS, so I can't help you there
04-20-2000, 03:23 AM
glEnable(GL_CULL_FACE) //Enable culling
glColor() //Set Front colour
DrawNURB() //Draw NURB
glFrontFace(GL_CW) //Set to draw back face
glColor() //Set Back colour
DrawNURB() //Draw NURB again
glFrontFace(GL_CCW) //Set to draw front face
Good luck with it
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.