Difference between revisions of "3D Fundamentals Tutorial 6"
From Chilipedia
(→Video) |
(→Video) |
||
Line 14: | Line 14: | ||
:* (viewing vector: vector from focal point to any point on the triangle in world space) | :* (viewing vector: vector from focal point to any point on the triangle in world space) | ||
:* If their dot product is negative (opposide directions), the triangle's face is towards the focal point | :* If their dot product is negative (opposide directions), the triangle's face is towards the focal point | ||
+ | * How to find the face normal: the cross product [https://youtu.be/h_Aqol0oTs4?t=9m51s 9:51] | ||
+ | :* Comparison of concepts of dor product and cross product | ||
+ | :* v1 x v2 yields a perpendicular vector (following left hand rule in our system) with length l = area of the parallelogram spanned by v1 and v2 | ||
== Downloads == | == Downloads == |
Revision as of 23:36, 11 May 2020
Get rid of those dirty back-facers, we don't serve their kind here. Also, learn the new sex move that is taking New England by storm: the Bridgeport Shocker.
Video
The tutorial video is on YouTube here.
- Recap of our problem: triangles are always drawn in the same order 0:20
- Solution: Back face culling 2:02
- Poor solution: painter's algoritm (sort the triangles back to front, draw front ones last)
- Better solution: never draw back facing triangles. For convex single objects front facing triangles will never overlap
- Using a triangle's surface normal to determine its orientation 5:15
- Just the z-component of the face normal is not good enough
- Correct approach: take the viewing vector (v1) and the face normal direction (v2)
- (viewing vector: vector from focal point to any point on the triangle in world space)
- If their dot product is negative (opposide directions), the triangle's face is towards the focal point
- How to find the face normal: the cross product 9:51
- Comparison of concepts of dor product and cross product
- v1 x v2 yields a perpendicular vector (following left hand rule in our system) with length l = area of the parallelogram spanned by v1 and v2
Downloads
The GitHub repository for the tutorial code is here.