Results 1 to 4 of 4

Thread: lighting question

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2002
    Posts
    10

    lighting question

    I have a terrain model which contains a couple of buildings. I want to add a light source where all visible sides of the building, no matter what angle I'm looking at it from, are lit equally. How do I do that?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: lighting question

    Are your normals correct?

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2002
    Posts
    10

    Re: lighting question

    They seem to be. I have a list of triangles that I just loop through, calculate the normal for each & then draw it.
    My initial camera position is at 0, 15, 10 with an up vector of 0, 0, 1.
    A light position of 25, 20, 75, 0 is what I'm using right now. As I rotate around, the building sides look fine when they're directly hit by the light. When they move out of the light they look black.

  4. #4
    Member Contributor
    Join Date
    Nov 2001
    Location
    Ireland
    Posts
    93

    Re: lighting question

    Could have four lights that shine on each side of the building.

    Or one light at the cameras poisiton and move it all with your camera.

Similar Threads

  1. lighting question
    By alanr in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-18-2011, 01:36 AM
  2. Question about lighting
    By anuchka in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-29-2004, 09:39 PM
  3. lighting question
    By HamsterofDeath in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 01-31-2003, 06:19 AM
  4. Lighting Question
    By jpummill in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-03-2002, 08:11 AM
  5. Lighting Question
    By Siwko in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 07-24-2000, 10:41 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