Posts

Showing posts from July, 2023

MATH

Image
 The dot and cross products can be used to detect collisions between rays and AABB's. This is the cross product version. Repeat the process with another axes pair say x, z. Use the y component formula to get y1, y2, y3, y4. If either views have No collision then No collision has occured. Using only two axes pairs will fail if x and y are zero. Testing all three axes pairs eliminates this bug.  This is the dot product version, very similar to the cross product version. Using the cross product and dot product in a grid allows iso-surface extraction. I will call these iso-surfaces "Plancktons".  Marching cubes iso-surfaces. Marching cubes is basically a lookup table that converts voxels into triangle surfaces. It has 256 possible surfaces. "Plancktons" are derived from a formula and can produce billions of possible surfaces. To test for a collision between a voxel (sx, sy, sz) and a AABB use this : if(!((sx-x1>>>6)|(sy-y1>>>6)|(sz-z1>>>6)