BSNS102 Study Guide - Final Guide: Incenter, Circumscribed Circle, Cross Product

118 views4 pages

Document Summary

// locate dominant axis of normal, and select plane of projection float u1, u2, u3, u4; float v1, v2, v3, v4; if ((fabs(n. x) >= fabs(n. y)) && (fabs(n. x) >= fabs(n. z))) { // compute denominator, check for invalid float denom = v1 * u2 v2 * u1; if (denom == 0. 0f) { // bogus triangle - probably triangle has zero area return false; // compute barycentric coordinates float oneoverdenom = 1. 0f / denom; b[0] = (v4*u2 v2*u4) * oneoverdenom; b[1] = (v1*u3 v3*u1) * oneoverdenom; 265 b[2] = 1. 0f b[0] b[1]; Another technique for computing barycentric coordinates in 3d is based on the method for com- puting the area of a 3d triangle using the cross product, which we discussed in section 12. 6. 2. Recall that given two edge vectors e1 and e2 of a triangle, we can compute the area of the triangle as.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers