Say for example we have a bounding box B, which encloses a primitive (e.g. a triangle). Now let's say we call the AABBTree() constructor, and let the box attribute of this AABBTree we are just about to construct be called C.
We know a bounding box inherits from Object in our implementation, so we call this constructor and pass in a list of Objects which contains only the bounding box B.
Because this list of Objects contains only one item, we will put it by default into the left or right pointer without bothering to split space. But should we bother to insert B into C? And because it's only one item (and that item is a bounding box), won't this make C and B identical, overlapping bounding boxes? And if so, is this a problem? Obviously if we have two or more bounding boxes in the Objects we pass in, we can build a new box in the AABBTree() constructor to surround them all, but I'm unsure about the case of just 1.
Also, if we have 2 or more objects, we split them into left and right boxes... but then the "box" contained in the new AABBTree we just built should also encompass both of those new left and right boxes, right? So in effect we create 3 new bounding boxes?
Finally, what are all the primitives we have to deal with? I assume only triangles given only insert_triangle_into_box function is in our code. However, I also see cloudpoints mentioned, but no way to insert those into a box without creating a new function?
I guess this is 3 questions altogether. Thank you!
If there's only 1 object, we'll let the AABBTree's left subtree point to the object (and it's a leaf node), and leave the pointer to the right subtree to be empty. It won't be a problem since if B has only 1 object, the object in B will become a leaf node and no new AABBTree will be created for it. C and B will be identical only when the root only has one object (but then why do you need to construct an AABBTree? ).
Yes.
CloudPoint is inherited from Object, and Object has a bounding box. So you can call insert_box_into_box.
Say for example we have a bounding box B, which encloses a primitive (e.g. a triangle). Now let's say we call the AABBTree() constructor, and let the box attribute of this AABBTree we are just about to construct be called C.
We know a bounding box inherits from Object in our implementation, so we call this constructor and pass in a list of Objects which contains only the bounding box B.
Because this list of Objects contains only one item, we will put it by default into the left or right pointer without bothering to split space. But should we bother to insert B into C? And because it's only one item (and that item is a bounding box), won't this make C and B identical, overlapping bounding boxes? And if so, is this a problem? Obviously if we have two or more bounding boxes in the Objects we pass in, we can build a new box in the AABBTree() constructor to surround them all, but I'm unsure about the case of just 1.
Also, if we have 2 or more objects, we split them into left and right boxes... but then the "box" contained in the new AABBTree we just built should also encompass both of those new left and right boxes, right? So in effect we create 3 new bounding boxes?
Finally, what are all the primitives we have to deal with? I assume only triangles given only insert_triangle_into_box function is in our code. However, I also see cloudpoints mentioned, but no way to insert those into a box without creating a new function?
I guess this is 3 questions altogether. Thank you!