I have two objects of different colors on stage and I need to combine them into one if they overlap each other. In 3d modeling there are boolean operations.
- Union (connection of objects into one).
- Intersection (only common parts of the source objects are included in the boolean object).
- Exception (cut). And I need to write such a thing.
+ ------- + + ------- +
| | | |
| A | | |
| + - + ---- + = | + ---- +
+ ---- + .. + .... | + ---- + |
| ... B ... | | |
| ....... | | |
+ ------- + + ------- +
Although I woke up this morning and thought that for sure there is a library that can help implement such functionality. Came across csg.js.
I study WebGL and I don’t know how to implement this functionality. I can not find any information on this topic.