Skip to content
Advertisement

ThreeJs scale object relative to another object

I’m using threejs to render some models (gltf/glb). All of them are of different sizes, some are big and some are small. Now I want scale all of them to the same size.

if i use mesh.scale() that would scale the object relative to it’s own size. Is there any way to achieve this without manually calculating each model’s scale?

UPDATE:

Here’s my code

JavaScript

Advertisement

Answer

You should create a bounding box around each model.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement