good evening everyone, I have a little problem with the poisitioning of the camera and the loaded scene, I would like to know how to fix the camera and rotate the object on itself here is the code that I use thank you.
to be more precise I want to click or drag with the mouse and turn the shirt to one side or the other
neither up nor down and the camera doesn’t move.
knowing that I’m loading a scene that contains abstractmesch and not mesch.
I saw that it worked for you and I thank you for your answer, but in my case it doesn’t work , maybe because of the babylon that I’m loading, I don’t know
If that is the case, you need to not attach camera controls, and interpolate the mouse input into inertia values on the mesh through a system of your own device.
This will remove the upper and lower limits you set previously, so I wouldn’t do that.
Can you try reproducing that on the playground? copy your code and make it work (or not work ) the same as in your code, so we can understand what’s the problem. I have a feeling we are not seeing the entire code that can affect the scene’s camera
but it rotate on itself (and the camera is not fixed).
when I did
this.scene.meshes.forEach(element => {
element.rotation.y = Math.PI
element.position.x = -180.0;
element.position.z = -70;
element.material = textures
});
} catch (err) {
console.log(‘error!’, err)
}
to put it back in place the object does not turn on itself anymore
this is why im trying to fix the camera and turn the meshs on them self
You should rotate the shirt around an axis that passes through it, as it is not modeled so that the (0,0,0) coordinate of its local space is at the center of the shirt (it would be easier if it is).
Thank you, it works, but I had to comment.
scene.activecamera = camera
because it gave me this error
Type ‘Camera’ is missing the following properties from type ‘ArcRotateCamera’: alpha, beta, radius, _target, and 111 more.ts(2740)
i would like to know how to zoom also on the object without lossing the rotation around the axe beside the error of
scene.activecamera = camera
Type ‘Camera’ is missing the following properties from type ‘ArcRotateCamera’: alpha, beta, radius, _target, and 111 more.ts(2740)
thank you ,and I’m sorry for the inconvenience.