PDA

View Full Version : HELP! Moving around landscape



chuge
10-11-2000, 06:04 PM
Hello,

This is the MOST frustrating thing!!.. Please Help!

When i'm moving trhough my application (openGl landscape) i can go forwards and backwards no matter which direction i'm heading (both x and y axis). when i change directions i just recalulate my relative "forward" and "backward" positions by multiplying it by either sin (or cos) for the x and y components. My problem is when i try to going sideways. When i move along the y axis i move left and right correctly. However, when i move along the x axis when i move left my object moves right and vise versa. I know it's some sort of angle problem but i'm stuck b/c i calculated the forwards and backwards in the same manner and it works all the time regardless of the axis. So why is sideways different?


Thanks.
c

Dodger
10-12-2000, 07:24 AM
Hi,

I'm not totally understanding what you mean by 'moving along' the x and y axis. Does that mean, the view points along these axes?
Are these the world axes or do you mean rotated axes of your 'camera'?

Is it possible that the problem is that
cos(90)=0 and cos(270)=0 resp. sin(0)=0 and sin(180)=0? I mean, that you might have to determine if you're moving in positive or negative direction after calculating the movement vectors (depends on how you calculate these).

Post some code, please http://www.opengl.org/discussion_boards/ubb/wink.gif

chuge
10-12-2000, 03:25 PM
Hey it's fixed!.. Thanks for you help anyways, i know i gave a pretty vague problem description. But the simple solution was that i wasn't looking at my movement in terms of vectors and so i was getting all messed up. Drawing pictures can do wonders!

-c