Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Note 0:
- This is a note! It is very noteworthy.
- Note 1:
- I say “usually” the first in the list because it’s a little more complicated. Whenever the player performs a collision test in a chunk, that chunk is moved to the front of the list. Usually, a chunk that the player performs a collision in will be the chunk the player is in, but the player’s radial collisions (see the Stored Triangles chapter) may reach over the edge of a chunk to the chunk next over, and this will also result in that chunk being ordered to the front. As such, at the end of the frame, it’s possible for that chunk to be first in the list, and the chunk the player is actually in to be second or third.
- Note 2: The diagrams shown in this section are actually oriented incorrectly: in Final Fantasy VII, the coordinate system is set up such that the triangle is to the right of each of the edge lines (in the v0->v1, v1->v2, and v2->v0 direction, assuming the normal of the triangle points directly into the camera), unlike the video where the triangle is to the left of each edge. Whoops.
- Note 3:
- I didn’t mention in the video exactly how computing the Y-coordinate of intersection works because it’s not too important.
- Define vector a = vertex 1 - vertex 0, vector b = vertex 2 - vertex 0. Define vector c as (the cross product of vector a and vector b) divided by 256.
- If c’s Y-coordinate is 0 (az*bx = bz*ax), then use the mean of the Y-coordinates of the three vertices. Note that this only happens when the triangle is degenerate (see the Degenerate Triangles chapter).
- Otherwise, use ((v0x - player X) * cX + (v0z - player Z) * cZ + player Y * cY) / cY
- Note 4:
- Yes, that’s actually the term. You can stop laughing. https://en.wikipedia.org/wiki/Degeneracy_(mathematics)#Triangle
- Note 5:
- The transformation referred to here is just to lower the Y-coordinate based on how far away the vertex is. The “rounded world” effect doesn’t result in the X or Z coordinates of a vertex changing while in the VLC, meaning this change is irrelevant for the purposes of whether a set of vertices resolves to a point triangle or not.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement