Lets say I want to load sword 3d model but it is really large and in unwanted rotation.
I assume I could edit it in 3d modeling software but what would be best way to adjust it with three.js?
I could adjust its scale and rotation properties but then later if I am going to adjust those again it becomes pain when I want to reset its orientation to “default” because I need to remember those “proper” default values.
Oh, I think I should start looking into 3d modeling software at some point in that case.
The problem is that I am not sure yet what scales I would like to have to the model so would be nice to do it programmatically at start for quick testing.
Do you have any code example how I could change the scale and rotation of the object but keeping the property values at 0,0,0’s if I want to modify them later?
After loading it, you can place the model within an Object3D
and transform the model to your desired size / rotation. Then use the parent Object3D
for any other transformations.
Object3D {
rotation: (0,0,0), // Use these to transform the correctly resized model
scale: (1,1,1),
children: [
model: {
rotation: (rotated to default orientation), // Set these only once, after loading the model
scale: (rescaled to default size)
}
]
}
Oh yeah, that could work as well.
Thanks for the help!