Simplify box() face construction#1734
Conversation
hollasch
left a comment
There was a problem hiding this comment.
Just realized that there's no need for the vector negations. My mental model was to "anchor" the cross product for the normal vector to the given point (min or max). But cross products aren't "from" any point at all, so we can just choose the simplest cross product that yields the face normal. Put even more simply:
|
Note that I'm traveling and may not get back to this until March 12. |
Although the face normal is the same after flipping both vectors, it changes the vertex positions. For example, quad(Q, −u, −v) gives vertices (Q, Q−u, Q−v, Q−u−v), while quad(Q, u, v) gives (Q, Q+u, Q+v, Q+u+v). The quad is no longer in the same position unless the anchor is offset to Q−u−v (i.e., quad(Q−u−v, u, v)). So when constructing faces from the |
Resolves #1733