Move camera gluLookAt

With this instruction gluLookAt:

gluLookAt( p1, p2, p3, l1, l2, l3, u1, u2, u3 );

How can I move the camera one unit to the left, keeping the direction of looking at the same point?

Apparently i cant just do p1-1, because its moving 1 in the global space, but i need to move the camera in the camera space, just with the information of the instruction above.

A found in a search that i could found the right vector and do this:

right = u * dir (normalized)

p = p - right
l = l - right

But i cant understand why or even if this works...

Upvotes: 1

Views: 1073

Answers (3)

Merlin
Merlin

Reputation: 173

Whether your question is the same as that rotate around y-axis clockwise for one unit left?

Upvotes: 0

Csoki
Csoki

Reputation: 139

If you are modifying the position of the camera you should do the same changes with the target's coords.

Upvotes: 0

LOLKFC
LOLKFC

Reputation: 1125

You have to decrement p1 and l1.

p specifies the position of the eye point and l the position of the reference point.

Upvotes: 1

Related Questions