






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







*(const^ Vec
&V) {^ return^ m_x*V.x()
+^ m_y*V.y()
+^ m_z*V.z();
}
^(const^ Vec
&V) { Vec^ crossProduct;crossProduct.m_x
=^ m_y*V.m_z
-^ m_z*V.m_y; crossProduct.m_y
=^ m_z*V.m_x
-^ m_x*V.m_z; crossProduct.m_z
=^ m_x*V.m_y
-^ m_y*V.m_x; return^ crossProduct;}
inverse cosine
( acos() ) of the dot. ^ You can find the angle between two intersecting lines bysubtracting the intersection point from points on the lines,normalising the vectors, and taking the acos() of the dot. ^ To find the line perpendicularto the two lines, subtract thepoints, normalise the vectorswhich result, then cross them. ^ V=B-A goes from A to B!
Normal P
P1^ P Normal =(P2-P1) x (P3-P1)Docsity.com
lighting. ^ (2) It can also be used for
backface culling
, an optimisation
Diffuse^
Specular