| Algorithm 2 Parallel Resampling of Proposed Method |
| 1: struct vertex
2: float x,y,z; 3: float tx,tx,tz; /* original position */ 4: procedure SampleTetrahedron (Mat4 , vertex A, B, C, D, Tex3D outGrid, Tex3D inVolume) 5: aabb boundingBox = outGrid.computeAABB(A, B, C, D); 6: foreach (voxel in boundingBox) 7: float4 baryCoords = computeBaryCoords (voxel.center, A, B, C, D); /* in Equation (3) */ 8: if (centerLiesInsideTetrahedron(baryCoords)) 9: float4 inpos = * baryCoords; 10: float4 newValue = tex3D (inVolume, inpos.xyz); 11: setValue (voxel, newValue); 12: end if 13: end foreach 14: end procedure |