Opengl Rotate and Translate

Started by
11 comments, last by Darthashwin 17 years, 1 month ago
i dont think the angle is in radians...it is in degrees
cause i made the incremented to 45 and it moved 45 degrees on screen

yes exactly i want it to be a first person shooter kinda thingy but from the top
except tat it is already in motion..i dont have to keep moving forward..
is it possible??

no it is not moving backward..
it is moving awkward...
at first u can rotate any direction u want..
and then u can go forward..and it moves ..but when u turn again..it sorta turns in a trajectory..

u can check out the code

it is at

http://engr.smu.edu/~avelapan/unzip.zip

just click on runme.bat and use w,a,d to navigate..
and q to quit
Advertisement
Quote:Original post by Darthashwin
yes exactly i want it to be a first person shooter kinda thingy



First, your grammar and punctuation sucks. So it's hard to understand you. Fix it.

Secondly, for a FPS style control:
You have stumbled into the same problem of so many before you; Realize this truth: Opengl Will Not handle motion calculations for you; it can only affect the graphics that are rendered, not the ultimate position of your game character.

In order to get the motion controls you ask, you will need to recalculate the positions and rotations yourself as the user input changes. Once you have those, opengl can be used to render the graphics model.

You will need to Learn if you dont already know:
coordinate systems
trigonometry (specifically rotations from sin/cos)
linear algebra -vectors -matrices(optional here but needed for graduating to full 3d)


Using that math you need to develop a separate 'physics' model of your game character from the opengl graphical model.
I recommend going to the Math+Physics forum and asking them "how to make a character walk around like in doom"
Well,I have just posted it in the other section. Hope to get some answers there too.

I badly want this problem solved

This topic is closed to new replies.

Advertisement