Archived

This topic is now archived and is closed to further replies.

Fratt

geometry in space

Recommended Posts

hi all, i develop in opengl and a function keep these parameters: gluLookAt( eyex, eyey, eyez, aimx, aimy, aimz, upx, upy, upz); the param (eyex...) could be condidered as vectors with y the height in space. then my problem is for the up vector. this function is as a camera. then, if my up vector which place the orientation of the camera is not set correctly, the view is incorrect. how to set this up vector correctly according to the 2 other vectors ? the camera is set at horizontal but is inclined due to the vector formed by aim-eye. can someone help me (and almost understant what i want ?) thanx a lot Fratt

Share this post


Link to post
Share on other sites
Remember that the second set of parameters is not a direction but a point.

i.e. ( 1, 0, 1, 0, 0, 1, 0, 1, 0 )

viewpoint in point ( 1, 0, 1 )
center looking at point ( 0, 0, 1 ), that is down vector ( -1, 0, 0 )
up direction is ( 0, 1, 0 )

The combination (cross product) of your ''up'' vector and ''forward'' vector (forward = center - viewpoint ) defines your ''right'' vector. The up vector must be provided to compute the missing vector, not the other way round.

Share this post


Link to post
Share on other sites