Set the size of the gltf obj

Hello, my first post here!!
Recently started working with three js and models from blender.
In blender i made some models, and gave them the size in cm .
I’m making some sort of 3d furniture modeling, and want to be able to work in dat.GUI with the size not the scale so that 0.9 corresponds to 90 cm . I can see the measurements i gave to my model through>
var bbox = new THREE.Box3().setFromObject(gltf.scene);
but i have no idea how to set it. Maybe there is a simple solution like obj.scale.x = 1 but with size.

rootNode.scale.setScalar(desired_scale/current_scale)

eg if width is 3 in three js and you want max width to be 1

rootNode.scale.setScalar(1/3)

console
scales
I am not sure it helped. The scale x, y, z that is displayed is the object’s , and as i see the scale is twice smaller then the actual measures(from compund box displayed in console). If i try with your solution , it just sets the gltf.scene.scale to x from setScalar(x). And as i console.log(gltf.scene.scale) after gltf.scene.scale.setScalar(X), x will be X , y will be X , and z will be X

if you don’t want it to be scaled equally then dont use setScalar .

just go with scale.x =

another thing …to make things easier …make sure all the models have rotation 0 and scale 1 when exported from blender

1 Like

This is what went wrong from the beginning, in blender when you create a new project , the default box is 2,2,2 and it coresponds to scale 1, 1, 1. When i was giving the dimensions in blender to object, i didnt pay attention that the scale didn’t correspond. Is there a way to set that 0.9 meters coresponds to scale 1 in blender?

Ctrl + A then do ‘apply scale’
if you scale things in edit mode it wont change the object scale