Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Cityhunter

Front face & Back face

This topic is 5760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
float red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
float green[] = { 0.0f, 1.0f, 0.0f, 1.0f };
glMaterialfv(GL_BACK, GL_AMBIENT_AND_DIFFUSE, green);

Don''t know if that will work, only used glMaterial once before. Wouldn''t hurt to try.
If you can''t find any official functions for it, you could always render with back-face culling on, change colour, then render with front-face culling.

------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It''s all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."

Share this post


Link to post
Share on other sites
I tried the front and back with GL_material, but I''m not doing gl_lighting. i''m writing my own lighting function. SO the glmaterial is really not working. Is there another way? Thanks

Share this post


Link to post
Share on other sites
THe last time I read about front/back face lighting, all the info suggestd that only high end workstation cards support this in hardware. So if you do try it, it will likly bog you down very quickly. LockePick''s suggestion is more sound. Simply swap your culling order (glCullFace(GL_BACK) to glCullFace(GL_FRONT) and back again)..

<-- smile :-)

Share this post


Link to post
Share on other sites
cityhunter:well, if you do lighting yourself simply turn of backface culling so both sides of faces are drawn and check face normal vector yourself to know if it''s facing camera or not. Then you just use one color or another. Simple.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!