Hi guys,
I am currently building an RTS camera and not being so great at math I am a little stuck.
The camera has a certain altitude which can be adjusted by the player, let's say it's 10.
The camera is rotated a certain amount on the X axis to make it look at the ground. Lets say 40 degrees.
Now, when I press "W" I make it move locally on the Z-axis. This makes it move forward, but because it is rotated on the X-axis and thus having the Z-axis facing the ground, it also moves down. I need to figure out how much to move the camera up along the Y-axis for any given amount on the Z-axis (let's say 1 for arguments sake).
Can anyone help me figure this out?
Thanks!
PS. I know I could just let the camera move down (MoveEntity) and right afterwards call PositionEntity and reposition it on the Y-axis but I prefer to do it properly. This seems like a dirty workaround.