alecjacobson/computer-graphics-bounding-volume-hierarchy

How to insert

Closed this issue · 2 comments

By reading the insert function and their .h files I am not pretty sure how it wants us to do it.

For example, in insert_box_into_box I understand ideally we should put some info about boundingbox A to boundingbox B so that if we later call boundingbox B we would somehow get data about boundingbox A. But by checking boundingbox.h I found bounding box only stores min_corner, max_corner nad center. How should we save more data in a boundingbox in order to insert another object in?

Look at Object.h. Bounding boxes are members of all objects - they do not carry information about what sub-objects they contain beyond the bounded size.

To insert some box A into another box B, you have to mutate B's box to accommodate the space of B union A.

Thanks for the explanation. To conclude, we want to modify the value of B's min and max corner so that the new B would contain A, this is also the case for insert triangle where you have three vertices to consider.