Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Construct new tetrahedra
- for(int i = 0; i < 2; i++) {
- Node child = new Node();
- child.Vertices = new Vector3[4];
- for(int j = 0; j < 4; j++) {
- if(Lookups.TetrahedronVertexOrder[i, j] == -1) {
- child.Vertices[j] = midpoint;
- }
- else {
- child.Vertices[j] = node.Vertices[Lookups.TetrahedronVertexOrder[i, j]];
- }
- }
- child.Depth = node.Depth + 1;
- node.Children[i] = child;
- }
- public static readonly int[,] TetrahedronVertexOrder = {
- {1, 2, -1, 3}, // Tetrahedron A (bottom tetrahedron in figure 4 of http://kennyweiss.com/papers/Weiss10.eg_star.pdf)
- {0, 3, -1, 2}, // Tetrahedron B (top tetrahedron in figure 4)
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement