Sign in to follow this  
ThunderMusic_80

Standart... right or left handed coords?

Recommended Posts

Hi, I just wanted to know what I should do about Right and Left hand coordinates in my project... I just started a project that will probably be a framework for many of my other projects but I just wanted to know what is the standart in the industry facing this matter... Should I use Right or Left handed coordinates? I've seen many places talking about counter-clockwise coords and many other places talking about lefthanded (so clockwise coords)... Is there a standart or is it up to my tastes? if there is, what is it? Thanks a lot ThunderMusic

Share this post


Link to post
Share on other sites
Standard is standard.

EDIT: I think it's completely irrelevant what you use, DirectX uses the one, OpenGL uses the other. Make a random decision. ;)

Share this post


Link to post
Share on other sites
Hi,

(Counter)Clockwise coords and left and right handed coordinate systems are 2 different things.

Counterclockwise and clockwise are used for culling. (Defining what side of the polygon is facing the camera)

Right and lefthanded coord systems deal with the Z axis. Lefthanded coordinate systems a positive Z value is far and a negative Z is near. Righthanded is the opposite.

As for standards, i'd go for righthanded, since opengl uses this as a standard.

Hope this helps you

Edit: as for clockwise and counterclockwise, i thought counterclockwise cull is standard, so if you draw the polygon clockwise it should show. However, this can be changed with 1 simple command glCull in opengl, so it doesn't really matter, as long as you are consistent

Share this post


Link to post
Share on other sites
I think it depends on what Graphics API you go with, the two most popular choices (OpenGL, and DirectX) both use different coord systems.

Most DX programmers prefer Left Hand, whereas OpenGL programmers tend to use Right Hand...If you're using neither of those APIs, then just go with what makes more sense to you. (Z increasing going away from you, or Z increasing going towards you)

ArchG

Share this post


Link to post
Share on other sites
I use DirectX so I'll probably stick to left handed because I thing it makes more sense to have positive Z in front of me instead of behind me...

Quote:
Original post by Limitz
(Counter)Clockwise coords and left and right handed coordinate systems are 2 different things.

Counterclockwise and clockwise are used for culling. (Defining what side of the polygon is facing the camera)

ok, but the culling is based on the coords system, right? if we have Left Handed coords, it will cull using Clockwise coordinates and if we have right handed coords it will cull using counter clockwise coordinates... Am I right or am I missing something?

thanks

ThunderMusic

Share this post


Link to post
Share on other sites
Quote:
Original post by ThunderMusic_80
I use DirectX so I'll probably stick to left handed because I thing it makes more sense to have positive Z in front of me instead of behind me...

Quote:
Original post by Limitz
(Counter)Clockwise coords and left and right handed coordinate systems are 2 different things.

Counterclockwise and clockwise are used for culling. (Defining what side of the polygon is facing the camera)

ok, but the culling is based on the coords system, right? if we have Left Handed coords, it will cull using Clockwise coordinates and if we have right handed coords it will cull using counter clockwise coordinates... Am I right or am I missing something?

thanks

ThunderMusic


Yes, seems you are right, didn't realize that (I only use OpenGL).

Share this post


Link to post
Share on other sites
Quote:

Right and lefthanded coord systems deal with the Z axis. Lefthanded coordinate systems a positive Z value is far and a negative Z is near. Righthanded is the opposite.


Note that this is not 100% correct.

The "handedness" of a coordinate system is determined by the cross product of two of the axes vectors, using either the right- or left-hand rule. If the cross product of the two axes (which will yeild the third axes) satisfies the right-hand rule, you have a right-handed coordinate system. Otherwise, it satisfies the left-hand rule and you have a left-handed coordinate system.

See also right-hand rule at MathWorld. Note that is thus perfectly viable to have a left-handed coordinate system where negative Z is "far" (but another axis will be flipped). However you are correct in that the defaults of the primary graphics APIs used left and right handed coordinate systems with the properties you described.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this