How to create box3 using Vector3 in three.js?

Viewed 179

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?

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.

Related