Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

chris82

counterclockwise

This topic is 6639 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

how can i check if 3 vertex are counterclockwise sorted? because i''m working with normals and some polygon aren''t visible

Share this post


Link to post
Share on other sites
Advertisement
Hey,

I haven''t totally read over this or tried it, but this should be exactly what you''re looking for..

http://www.geocities.com/SiliconValley/2151/math2d.html

It''s toward the end of the document, so look there for it.. Let me know if it helps you out..

Optionally for anyone who reads this, a really good place to look for stuff is

http://www.calculus.net



bosco()




--
leader of the free world .. or something ..

Share this post


Link to post
Share on other sites
Do you still need this code? If so, I think I have the source in The Black Art of Mac Game Programming (and no, the code is not Mac-specific).

Morgan

Share this post


Link to post
Share on other sites
But if you think about it, any three vertices make a polygon which is a plane and therefore 2d.. Trust me.. It''s what that is describing.. I read it.. You just need to read and understand it.. Do you understand vectors??


bosco()




--
leader of the free world .. or something ..

Share this post


Link to post
Share on other sites
morgan>yes i need it.
bosco>i have understand a thing ,in 2d it''s ok you can find clockwise because the view is always in front of you but in 3d what mean clockwise ?i can watch from the z axis and the result will be one ,i can watch from y axis and the result will be one,ecc.
so the order it''s given by what?
i thought it was given by the front of the polygon but it is determined by normal which is calculated with vertex sorted clockwise,so i''m getting mad

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Paul: Its actually called counter clockwise,
thats why they''re abbreviated CW (clockwise) and CCW (counter clockwise)....

Share this post


Link to post
Share on other sites
Actually, anti- and counter- depend on where you are in the world (US vs. rest of the world). At any rate, whether a vertex is defined clockwise or counterclockwise is dependant on how it would be viewed. For example, take the following triangle:


1

2
3


If the triangle would be facing you, the order (if going clockwise, i.e., DirectX) would be 1,3,2.

If the triangle were the back side of an object (facing away from you), the order would be 1,2,3.

So it''s all in HOW YOU WOULD VIEW IT.

Vyvyan

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Ok, sorry, I didn''t know that...
I''m from Sweden and have always only heard ''counterclockwise''...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!