Archived

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

finas

Camera view matrix

Recommended Posts

my cameras data sturcture is : pos : x, y, z lookvector : x, y, z i want to set view from this camera. I know that I must use a transilate and rotate matrix but which... please help

Share this post


Link to post
Share on other sites
If your using openGL try using the gluLookat. It allows you to position and move a camera by specifing a look vector for the direction the camera is to point in and a position for the camera in 3D space. Make sure you include the OpenGL utlility libary though (glu.h) and glu32.lib

Hope this helps

~Steve~

Share this post


Link to post
Share on other sites
are u using directx or openGL ?

its quite easy ..
if u are using dx, just read up some of the sdk samples
like the billboard or dolphin. . you can get
some camera code for there. .



{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites
I''m using openGL, but first I want to understand how it ( transform to camera coord. )works
I want to see a that matrix. View Matrix = rotation * transilate.
and I know, that transilate matrix is:

1 0 0 0
transilate = 0 1 0 0
0 0 1 0
-px -py -pz 1

[ px, py, pz ] - camera position coord. but....


RotateMatrix = ???

Share this post


Link to post
Share on other sites
I''m using openGL, but first I want to understand how it ( transform to camera coord. )works
I want to see a that matrix. View Matrix = rotation * transilate.
and I know, that transilate matrix is:

1 0 0 0
transilate = 0 1 0 0
0 0 1 0
-px -py -pz 1

[ px, py, pz ] - camera position coord. but....


RotateMatrix = ???

[finas]

Share this post


Link to post
Share on other sites