Center an object at the origin
Calculates the offset needed to center an object and returns it. Does not modify the object itself.
The object to center
Offset vector to apply for centering
const offset = calculateCenteringOffset(model);model.position.add(offset); Copy
const offset = calculateCenteringOffset(model);model.position.add(offset);
Center an object at the origin
Calculates the offset needed to center an object and returns it. Does not modify the object itself.