#### Archived

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

# cross product of two vectors non commutative?

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

## Recommended Posts

normal = crossProduct(ab,bc); and normal = crossProduct(bc,ab); doesn''t make any noticeable difference in lighting my rotating pyramid. Is there a difference between the two and how do I know which one will give me a normal facing the right way?

##### Share on other sites
As you may know

A Cross B = -(B Cross A)

It doesn''t make a difference in ligthing because ligthing uses the Dot product (and apparently, it uses the absolute value of the dot product in your case). As long as you always use your vertices in the same order for the cross product (ab, bc) or (bc, ab), your normal should point consistently "outside" or "inside" the surface. Try it with a sample triangle, and if your normal doesn''t point in the right direction, switch the order of the vertices.

I hope my explanation isn''t too confusing,

Cédric

##### Share on other sites
Do the cross product of the two segments counter clockwise with respect to the normal shooting out the face. Also, build the segments counter clockwise too. When you are finished, the normal will be pointing in the direction where the face values are clockwise with respect to the face.

If that makes any sence. Otherwise read up on the subject and do some math.

1. 1
2. 2
Rutin
22
3. 3
JoeJ
18
4. 4
5. 5

• 15
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631724
• Total Posts
3001903
×