# Triange Side Lengts to anles

Show 40 post(s) from this thread on one page
Page 2 of 2 First 12
• 03-13-2005, 05:56 AM
ericlin
:) That is great and very helpful.

What I did to get the axis perpendicular to two vectors is through solving two equations.

a1*x+b1*y+c1*z=0;
a2*x+b2*y+c2*z=0;

I assume z=1 and get y = (c1*a2-c2*a1)/(a1*b2-a2*b1); x = (c1*b2-c2*b1)/(b1*a2-b2*a1); and then handle the condition that z=0; That is awkward.

Now I get it and the calculation will be straght forward. I am glad I learn much from this thread.

One thing puzzles me.

The surface normal is calculated from vectorA and vectorB. If we swap vectorA and vectorB, the plane is the same, but the calculated surface normal will be a "negative" of the formal one.

I use that axis to rotate an angle so that vectorA may conform with vectorB. But I dont know whether I should rotate it Clockwise or counter-clockwise. (or which surface normal I should pick, the first one or the second one ?)
• 03-14-2005, 02:52 AM
shipstern
Hi Ericlin,
A lot of 3D engines have the vertices of faces/polygons in a counter-clockwise order. So thats what I usually use. So the dot-product will return a positive. Having a positive figure is often convienient for lighting and calculating specular reflection ... makes the code cleaner, but I don't think there is any real concrete convention.

I am not really sure what you are rotating? But at a guess I would say counter-clockwise because an inverse of a Mesh Rotation Matrix is usualy used to place a First Person Camera into Mesh Space.

Shipstern
• 03-14-2005, 11:31 AM
ericlin
Thank you.

So, the standard way to "Get two directional vectors from the points on the plane.", is to pick B then C point in counter-clockwise order.

If we just pick B and C randomly, the order might be clockwise and the calculated surface normal might just point in opposite direction. And, the dot_product might be <0 rather than >0.

OK, instead of keeping asking questions here, I 'd better read some books now. Thank you, thank you , thank you.
Show 40 post(s) from this thread on one page
Page 2 of 2 First 12