Results 1 to 6 of 6

Thread: Why??

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    Brazil
    Posts
    102

    Why??

    Why my lights are "LIGHTING" my whole environment ?? i mean, how can i make a spot light ?? i need code guys!

    im using this code before i call my function to draw my obj model...
    Code :
      glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, @Light_WHITE );
      glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, @Light_WHITE );
      glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, @Light_BLACK );
    i ll give a example!
    i have a space ship (my .obj model) light by green light (environment) and a red spot light come next to the space ship lighting the hull with constant velocity...

    can somebody help me???

    will be great!

    thank you!

  2. #2
    Member Contributor
    Join Date
    Jul 2001
    Location
    Sherbrooke
    Posts
    95

    Re: Why??

    Hi gelero I had a similar problem.

    When you set your light position the first 3 parameter set the x,y,z position of the light but there's a 4th parameter.
    If you set it to 0 it means the light is a directional light ( from a point very far so it lights all the scene )
    I solved my problem by setting it to 1
    it means it's a positional light ! it's what you want !
    try it and tell me if it was the same problem.

    --------------------------------------
    Evil-Dog
    *Sleep is a waste of time*
    Let's have a funny day

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    Brazil
    Posts
    102

    Re: Why??

    Bulls-Eye, Evil-Dog!!!

    thank you!

    but, i still have a doubt...
    directional light is the light for every direction ???

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Dec 2007
    Posts
    1,077

    Re: Why??

    Directional Light is like what we get from tghe sun. The light rays are coming from the same dircetion everywhere.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    Brazil
    Posts
    102

    Re: Why??

    ok... and how can i control de POWER of the light??
    the SHININESS...

  6. #6
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    Brazil
    Posts
    102

    Re: Why??

    UP!!!

    ok... and how can i control de POWER of the light??
    the SHININESS

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