Cjmarkham
Cjmarkham

Reputation: 9681

ThreeJS and Blender3D Units

I am exporting blender3d meshes into JSON for use in threeJS. The problem comes down to units.

I have a grid made in threeJS (segments are 50x50). I need to make a model which follows the same segment width so I can perform some calculations later. So if I have a landscape, an increment in height would need to follow the same increment as the grid (50).

But changing the size of the mesh in blender does nothing, it will be the same size on the canvas and to increase it I have to scale it up in threeJS mesh.scale.set().

Is there any way to ensure the correct scale and units that threeJS uses in blender?

If you need me to clarify or add more info just ask, I am rubbish at explaining things.

Upvotes: 3

Views: 608

Answers (1)

sambler
sambler

Reputation: 7079

There is more than one way to scale an object.

Within blender scaling the mesh in edit mode (after selecting all vertices) will alter the size of the mesh just as if you modelled any other change.

While scaling an object while in object mode leaves the mesh data unaltered but gives an object it's own scale factor that blender uses to adjust the mesh when drawing. The objects scale factor may not be taken into account by threejs and could be the issue you are having. The object scale can be applied to the mesh by pressing CtrlA with the object selected in object mode and choosing scale. Or you can clear the scale with AltS and then re-scale it in edit mode.

Upvotes: 3

Related Questions