JosiahMaybe
Platinum Coder
A common way to do higher dimensional cut to view is to use tetrahedra. Before we dive into that, how is view defined? There may be many ways to define it but for this I will define it as what from a viewpoint, like an eye, goes exactly through a 2d view plane, the screen, on the way to an object, the thing we view. Tetrahedra allow only checking the line edges for being in or out of view including in spherical or hyperbolic space, not just Euclidean. There is a problem though, the number for one box is dimension factorial, n!, one of the fastest increasing functions known to man.
So, what else is there? I know that since the tetrahedra cover the entire higher dimensional space that they cover all 2d faces or if they do not, it is wrong. From research, for any convex shape, we need to only check all the 2d bounding shapes for the complete shape. A 5d box has 4d bounding volumes which have 3d bounding volumes which have 2d bounding rectangles. Unless the shape has a curve, all higher dimensional convex shapes should have planar shapes like this bounding them. Sure, the function of number of faces is 2 to the power of dimension about for this, but it does increase slower than factorial.
Now we know that 2d shapes bound the shape, what do we do with them? Consider the entire 3 vector space for view for this. Odd but true, we can break them into triangles and check each line for one point in view, because of how the tetrahedra work this also should work. Then we have a point cloud with no connections. To solve that we can connect every point to every other point and check the midpoints; if the midpoint is viewable then the entire line is viewable. This leaves inner lines, but far fewer than a few trillion tetrahedra. The inner lines can be solved for removal, but I have not done so yet.
Why the 3-vector space? First know that based on tests, view can always be represented by 3 vectors. Next, if a spear were to go through the camera, how would we view it? My approach is to remove the part between viewpoint and plane and view that. There are some really nasty things that happen when the object has parts entirely parallel to the plane and "in view" at infinity. It is good to avoid those by making it 3 vectors, then from the shape, slicing the result to be in correct view is simpler and does not involve infinity ever. This is of course only one way to do this, and possibly not the best. Now imagine this; how would a similar process apply to spherical or hyperbolic spaces? X E.
So, what else is there? I know that since the tetrahedra cover the entire higher dimensional space that they cover all 2d faces or if they do not, it is wrong. From research, for any convex shape, we need to only check all the 2d bounding shapes for the complete shape. A 5d box has 4d bounding volumes which have 3d bounding volumes which have 2d bounding rectangles. Unless the shape has a curve, all higher dimensional convex shapes should have planar shapes like this bounding them. Sure, the function of number of faces is 2 to the power of dimension about for this, but it does increase slower than factorial.
Now we know that 2d shapes bound the shape, what do we do with them? Consider the entire 3 vector space for view for this. Odd but true, we can break them into triangles and check each line for one point in view, because of how the tetrahedra work this also should work. Then we have a point cloud with no connections. To solve that we can connect every point to every other point and check the midpoints; if the midpoint is viewable then the entire line is viewable. This leaves inner lines, but far fewer than a few trillion tetrahedra. The inner lines can be solved for removal, but I have not done so yet.
Why the 3-vector space? First know that based on tests, view can always be represented by 3 vectors. Next, if a spear were to go through the camera, how would we view it? My approach is to remove the part between viewpoint and plane and view that. There are some really nasty things that happen when the object has parts entirely parallel to the plane and "in view" at infinity. It is good to avoid those by making it 3 vectors, then from the shape, slicing the result to be in correct view is simpler and does not involve infinity ever. This is of course only one way to do this, and possibly not the best. Now imagine this; how would a similar process apply to spherical or hyperbolic spaces? X E.