View Full Version : weird transformation problem

11-23-2001, 04:37 PM
i have to do this:
- loadidentity
- lightpos = x
- camera transformations
- lightpos = (10, 10, 10)

now i have to know x
did it like this:

- loadidentity
- camera transformations
- get M and calculate M-1
- light_coord = (10, 10, 10) * M-1
- loadidentity
- draw point at light_coord

this should be the same as:
- loadidentity
- camera transformations
- draw point at light_coord

but this is not the case
if my camera transformation is just a gluLookAt:
works if i draw point at (light_coord.x, light_coord.y, -light_coord.z), notice the -

if my camera transformations also have a rotation the whole thing is flipping

i calcualte M * M-1 in my display routine and it gives Identity every time, so M-1 is calculated correctly.

what the **** am i missing here ???????????????

11-25-2001, 11:52 PM
Try transposing M-1

12-03-2001, 08:51 AM
With my camera routines,
I always translate and rotate with
the negative camera values.