Results 1 to 2 of 2

Thread: lighting back and front

  1. #1
    Junior Member Newbie
    Join Date
    May 2001
    Location
    aulnay, france
    Posts
    19

    lighting back and front

    hi,
    i want to light my objects back and front.
    her is my pseudo-code :

    glPolygonMode(GL_FRONT_AND_BACK , GL_FILL);
    glColorMaterial (GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
    glColor4fv(color1) ;
    glColorMaterial (GL_BACK, GL_AMBIENT_AND_DIFFUSE);
    glColor4fv(color2) ;

    i don't have the desired effect. can anybody tell me why?
    moreover, do i have to specify normals again but in an opposite direction ?

    thanks ! : )
    phanie

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: lighting back and front

    Did you do
    - glEnable(GL_COLOR_MATERIAL)?
    - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1)?

    BTW, if this is the only place where you specify the material, better use glMaterial call directly instead of enabling color material.


    [This message has been edited by Relic (edited 06-06-2001).]

Similar Threads

  1. Front-to-back Blending
    By imported_Alemarius Nexus in forum OpenGL: General
    Replies: 10
    Last Post: 07-20-2011, 08:16 AM
  2. Front to Back vs Back to Front Compositing
    By balogna in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 12-11-2005, 12:11 PM
  3. Front to Back
    By Fernando in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-18-2002, 02:44 PM
  4. what is faster? fill front and back or only front
    By Jan in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 02-21-2002, 06:11 AM
  5. Front to back drawing...
    By Anonymous Coward in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 01-05-2001, 03:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean