light moving..?

light moving..?

Post by Khamba Starin » Wed, 09 May 2001 02:22:50



Hi,

I made a very simple modelviewer which lights & rotates a model
around the Y axis.. But the light seems to move or fade with
every turn of the model. Maybe one of you knows what's going on..?

The code with makefile & model can be downloaded from:

http://www.edoropolis.org/purrcat/src/weirdlight.tar.gz

Regards,

-- Khamba Staring

 
 
 

light moving..?

Post by Francis Piéro » Wed, 09 May 2001 14:55:03


Eh eh, looks like something I had to fight against one week ago :-)

In my own code, the light was inheriting the model transformation because
the glTranslatef.. and glRotatef of my model where not between a
glPushMatrix and a glPopMatrix. Its position was not relative to (0,0,0) but
was an offset to the last position model and rotation.

You should probably check that in your code.



Quote:> Hi,

> I made a very simple modelviewer which lights & rotates a model
> around the Y axis.. But the light seems to move or fade with
> every turn of the model. Maybe one of you knows what's going on..?

> The code with makefile & model can be downloaded from:

> http://www.edoropolis.org/purrcat/src/weirdlight.tar.gz

> Regards,

> -- Khamba Staring


 
 
 

light moving..?

Post by George Ziniewic » Thu, 10 May 2001 09:00:59



> Hi,

> I made a very simple modelviewer which lights & rotates a model
> around the Y axis.. But the light seems to move or fade with
> every turn of the model. Maybe one of you knows what's going on..?

> The code with makefile & model can be downloaded from:

> http://www.edoropolis.org/purrcat/src/weirdlight.tar.gz

   I don't have your code (on a pc) but it is simply a matter of how you place
your light in the world.  If you position it before your camera transform, or
after a fresh LoadIdentity(), it will be fixed, like a miners helmet light.

   If OTOH you position it just like any object is positioned, then it will move
as you move the camera, it all depends on how you want it.  I believe both the
Superbible and red book describe setting up lights in different fashions.

zin

--

  For PC & Mac 3-D graphics shareware & more:  http://www.zintel.com

 
 
 

light moving..?

Post by ZZ » Fri, 11 May 2001 06:52:32


check the opengl faq
Quote:> > I made a very simple modelviewer which lights & rotates a model
> > around the Y axis.. But the light seems to move or fade with
> > every turn of the model. Maybe one of you knows what's going on..?

> > The code with makefile & model can be downloaded from:

> > http://www.edoropolis.org/purrcat/src/weirdlight.tar.gz

 
 
 

1. Why is my Lighting Moving???

I have an application that is written with C and GL.  This produces 3D
light source shaded Z buffered polygons. I have set up a variety of image
types and other displays so I have a number of mmode() and setmode() calls.

Anyway, the first time I render one type of image (surface geometry), my
lighting model doesn't work quite, the wrong surfaces seem to bit
bright/dark. If I go to another type of image (volumetric surfaces) it
looks great, and now if I go back to the first image it looks ok too. This
was a problem, but not horrible.

Now I made another modification and I can get one decently lit model and
then everything uses the "other" "horrible" lighting.

So ... any idea what I can be doing? Do I have an mmode() somewhere which
has moved my lighting model?

Any insight would be welcome.

John

2. World Exclusive from Seybold!

3. Weird OpenGL problem (Lights move with camera and shouldn't)

4. : 16-bit color layout (5-6-5???)

5. Light moving

6. Some thoughts about 'realtime-blur/blurfeed-back'

7. Lights moving with camera

8. Light blockers moving when the camera moves

9. Inventor error when moving light

10. Tough One......moving light

11. moving light with boned object