Advertisement
epitaque_

Untitled

Jul 3rd, 2017
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. // Construct new tetrahedra
  2. for(int i = 0; i < 2; i++) {
  3.     Node child = new Node();
  4.     child.Vertices = new Vector3[4];
  5.     for(int j = 0; j < 4; j++) {
  6.         if(Lookups.TetrahedronVertexOrder[i, j] == -1) {
  7.             child.Vertices[j] = midpoint;
  8.         }
  9.         else {
  10.             child.Vertices[j] = node.Vertices[Lookups.TetrahedronVertexOrder[i, j]];
  11.         }
  12.     }
  13.     child.Depth = node.Depth + 1;
  14.     node.Children[i] = child;
  15. }
  16.  
  17.  
  18. public static readonly int[,] TetrahedronVertexOrder = {
  19.     {1, 2, -1, 3}, // Tetrahedron A (bottom tetrahedron in figure 4 of http://kennyweiss.com/papers/Weiss10.eg_star.pdf)
  20.     {0, 3, -1, 2}, // Tetrahedron B (top tetrahedron in figure 4)
  21. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement