Hello forum,

Is the view-direction found inside the model-view matrix. I read somewhere that the third column of the model-view matrix contains the view direction.

How and Why ?

Some references/hint is requested ?

Thanks

Hello forum,

Is the view-direction found inside the model-view matrix. I read somewhere that the third column of the model-view matrix contains the view direction.

How and Why ?

Some references/hint is requested ?

Thanks

It depends on what coordinate system you want the view direction in (model space, world space, eye space, …). In eye space the view direction is normally (0,0,-1), i.e. along the negative z axis. From there you can transform it to other spaces. For example if you apply the inverse view matrix to that vector you obtain the view direction in world space (view matrix transforms from world to eye space, so the inverse does the opposite direction), if you apply the inverse modelview matrix you obtain the view direction in model space (since modelview matrix transforms model space coordinates to eye space coordinates).