Reputation: 1499
I'm new to ThreeJS. Currently, I wanna load a model from .obj
file and use AxesHelper
to measure its length. However, once I loaded the model I found the origin point of the model is different with the origin point of AxesHelper
, there is a distance between them. I know I could set their position manually, but I hope once I load a model, the origin of the model is the same with AxesHelper
. How could I set the origin point of them exactly same? Thanks in advance.
Upvotes: 3
Views: 5248
Reputation: 31086
The origin point depends on how the geometry is translated relative to its local (0,0,0) point. You usually get good results by centering the object's geometry based on its bounding box via BufferGeometry.center(). You can also directly use the respective translate()
method to translate the geometry with an arbitrary offset.
In general, it's preferable to make such model adjustments during the design phase in a tool like Blender and not after the import in a 3D engine.
Upvotes: 2