Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Vector 2D normals

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Si_con   Members   

100
Like
0Likes
Like

Posted 24 July 2011 - 01:31 PM




Having a 2D Vector (x,y), it has two normals, (-y,x) and (y,-x). If you make a function that returns the normal of a 2d vector, which of both is usually more useful? i mean for return that and not the other.



#2 luca-deltodesco   Members   

637
Like
1Likes
Like

Posted 24 July 2011 - 01:43 PM

Generally, it will make no difference as long as you are consistent. The only times I can think in which it would make a difference is for instance computing the edge normals for a polygon; depending on the polygon winding (clockwise or anticlockwise) one normal or the other would point into the polygon or out of the polygon.

#3 apatriarca   Members   

2355
Like
1Likes
Like

Posted 24 July 2011 - 05:27 PM

As long as you are consistent you should be ok with either conventions. I think it's more common to use (-y,x) since it represents a “positive” rotation of 90° and { (x,y), (-y,x) } is a positively oriented basis (it has the same orientation of the current basis). It also corresponds to the multiplication by the imaginary unit when using complex numbers.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.