When I setup my scene, add geometries etc, how do I set the camera so I can see my whole scene? I'm trying to implement an algorithm using boundingboxes, but I'm kinda stuck.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
You really only need to find the greatest absolute value between all your variables by using
Math.abs(number)
, once you have found the greatest of all you can set the depth(position.z) of the camera to that number. I have made a simple function which receives 2 numbers and returns the greatest.You can also use Arrays if there are too many numbers. Once you have found your number you do:
or
Well I hope it helps.