News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Camera function.

Started by Farabi, August 30, 2005, 08:32:30 AM

Previous topic - Next topic

Farabi

I dont know how to made a camera function it is too complex. Is anyone here have it one?
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

ninjarider

that i know of u can use the gllookat, or a bunch of gltranslate and glrotate functions to move like if it were a camera.

Farabi

Hai. Thanks for answering.  I use this for the camera, what is left are the heading movement calculation.


invoke glPushMatrix

invoke glTranslatef, CFLT(0.0), CFLT(0.0), CFLT(-0.0)
invoke glRotatef, RotXCam, CFLT(1.0), CFLT(0.0), CFLT(0.0)
invoke glRotatef, RotYCam, CFLT(0.0), CFLT(1.0), CFLT(0.0)
invoke glRotatef, RotZCam, CFLT(0.0), CFLT(0.0), CFLT(1.0)

invoke glTranslatef, pos3_x, pos3_y, pos3_z


invoke glTranslatef, CFLT(0.0), CFLT(0.0), CFLT(-5.0)
invoke glRotatef, RotX, CFLT(1.0), CFLT(0.0), CFLT(0.0)
invoke glRotatef, RotY, CFLT(0.0), CFLT(1.0), CFLT(0.0)
invoke glRotatef, RotZ, CFLT(0.0), CFLT(0.0), CFLT(1.0)
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

hitchhikr

The example Skybox_And_Camera shows how to use quaternions to make a camera and avoid euler angles.

This is a paper concerning quaternions & cameras:

www.cs.wisc.edu/graphics/Courses/cs-838-2002/Papers/quatut.pdf

You can find a lot more on the web.