(Angles) Which Way Is Up?

Started by
4 comments, last by digital_phantom 18 years, 3 months ago
This is a very simple question I have been wondering and it may be very stupid as well. But here is the example: In a game you have the player which is facing north, which angle would this be? I've always thought this angle to be 0 degrees and got larger when rotated to the right. But when looking at a paint program, it had an angle rotator on it that north was 90 degrees and got larger when rotated to the left. What is the current way for this? And sorry for my stupidity.
Advertisement
It's done that way because of a circle. A circle increases in degree measure when you go counterclockwise.

So, in this respect, 0 degrees would mean you're facing absolute right.
Quote:
In a game you have the player which is facing north, which angle would this be?

It's up to you to define what that angle would be. It has to do solely with the original orientation of your models in their own space coordinates (that is the original positions of its vertices, before applying any translation/rotation etc.)

If you want north to be the positive Z+ axis in your 3d coordinates' system, then -if you want that angle to be zero as you said-, you must make sure, that in your original mesh file, the character is facing towards the positive Z axis too (north). Then you would have to set his "look at angle" to zero in order to make him face north.

However, if you load the mesh file and the character's mesh is originally facing south (i.e.) before any rotations then you have to set the "look at" angle to pi in order to make him face to the north. It all gets down to which direction your mesh was is facing if you don't apply any rotations to it, and you see, this is up to you to decide.

As for the angles and rotations, each plane divides the 3d space into two sub-spaces, the positive one and the negative one. They are called positive and negative respectively, because if you plug their points' coordinates in the plane's equation A*x+B*y+C*z+D==0, the right part of the equation will be positive or negative respectively. Rotations are always performed on a specific plane. The angle of rotation is positive, if you see the rotation to be performed counter-clockwise, when you are looking at the center of rotation *from the positive subspace* in which the plane of rotation divides the 3d space.
z axis is countclockwise and y and y clockwise in a left-handed system (looking down z+).

so if you turn your head from north -> east, angle should increase.

when you look down from a positive axis to the plane that is perpendicular to it all angles are clockwise in a left-handed system. in a right-handed it's countclockwise if you look down from a positive axis to the plane that is perpendicular to it, thus rotating in z-axis will have the same result in both systems. this may clear up some things:

http://www.evl.uic.edu/ralph/508S98/coordinates.html


maybe you can remember from the math lessons that a circle where cos = x and sin = y you go to the left and up first. you always looked down to that 2d-plane from a positive axis.

btw: you can define your own system as long as you take in consideration your basis (consistent with), you can even use -sin for y, but then you should change the rotation matrices as well. you're free in that.
Be creative, don't copy...Greets from Holland!
It depends on the convention or the system or the context. On a compass, North is 0 and the angle increases in the clockwise direction. Typically in math (at least in 2D), the X axis is 0 and the angle increases in the counter-clockwise direction.

You could line up the X axis with North so they are both 0, but that's not how people usually draw them. In a game, you should probably use (at least for display) the compass convention because that is what people are used to.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Hey everyone, all your help is most appreciated, thanks,
it makes a lot of things more clearer.

This topic is closed to new replies.

Advertisement