Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create box3 using Vector3 in three.js?

There is a basic way to create box3 in three.js. creating by min, max vector3.

I want to create a box3 composed of 8 vector3s.

I have tried '.setFromArray' method, but it was not effective for me. (It only compares the minimum and maximum x, y, z and produces box3)

Do you have an idea to create a box3 composed of 8 vector3s?

like image 951
Jong In Yun Avatar asked Dec 07 '25 08:12

Jong In Yun


1 Answers

Do you have an idea to create a box3 composed of 8 vector3s?

I suggest you use Box3.setFromPoints(). This will create an AABB enclosing all the 3D points in the given array.

like image 134
Mugen87 Avatar answered Dec 08 '25 22:12

Mugen87



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!