MaNDROiD

11-28-2004, 01:31 AM

Hi, I'm really baffled by this shadow problem. Here's an outline of the steps I took to implement the planar projection shadows... sorry if it is not well articulated.

1. setup camera using gluLookAt().

2. pushStack

3. perform glRotatef of lights about arbitrary projection plane normal (light keeps spinning).

4. setup Light position using glLightf()

5. get matrix stack using glGetFloatv();

6. multiply light position by this matrix ( variables stored as globals... just used to keep track of where the light is).

6. popStack

7. pushStack.

8. perform transformations on floor object using glRotate..tranlate..scale.

9. get the matrix stack using glGetFloatv();

10. multiply my projection plane points by this matrix (variables stored as globals).

11. draw floor.

12. popStack.

13. pushStack

14. multiply modelview Stack with projection matrix calculated from projection plane points and light point.

15. perform object transformations.

14. draw object (becomes shadow).

15. popStack

16. perform object transformations.

17. draw object.

ok...now.. the problem i am having is that if I change the gluLookAt() y position the shadow goes off of the plane (sometimes spinning perpendicular to it). But, If I change the gluLookAt() x or z position it is fine. Any help would be great... sadly, I've been trying to figure this out for a while already.

1. setup camera using gluLookAt().

2. pushStack

3. perform glRotatef of lights about arbitrary projection plane normal (light keeps spinning).

4. setup Light position using glLightf()

5. get matrix stack using glGetFloatv();

6. multiply light position by this matrix ( variables stored as globals... just used to keep track of where the light is).

6. popStack

7. pushStack.

8. perform transformations on floor object using glRotate..tranlate..scale.

9. get the matrix stack using glGetFloatv();

10. multiply my projection plane points by this matrix (variables stored as globals).

11. draw floor.

12. popStack.

13. pushStack

14. multiply modelview Stack with projection matrix calculated from projection plane points and light point.

15. perform object transformations.

14. draw object (becomes shadow).

15. popStack

16. perform object transformations.

17. draw object.

ok...now.. the problem i am having is that if I change the gluLookAt() y position the shadow goes off of the plane (sometimes spinning perpendicular to it). But, If I change the gluLookAt() x or z position it is fine. Any help would be great... sadly, I've been trying to figure this out for a while already.