Skip to main content
gamedev.net
🔒 Locked

easy camera question

Started by bcware Nov 12, 2000 at 11:30 PM 2 replies 500+ views
Original Post
bcware
bcware
heres my forward/backward camera movement code: void MoveViewer(GLdouble dStep) { GLdouble xDelta,zDelta; xDelta = dStep*cos(pObject->radsFromEast); zDelta = -dStep*sin(pObject->radsFromEast); pObject->xPos += (float)xDelta; pObject->zPos += (float)zDelta; } this code does exactly what it should do, move only forward and backward, however i want another function like this one only i want it to move left to right and i can't figure it out =\ basically how could i modify this code to "strafe" instead of go forward? Edited by - bcware on 11/12/00 11:31:42 PM
bcware
bcware
help?
acw83
acw83
Add 90 degrees to the angle, that will give the deltas to move right. To move left simply the negative values you would to go right.

-------------------------
How you like them apples?
bcware
bcware
damn that was alot easier then i though =P

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.