I have an example here:
When click on the mesh, How to make the ArcRotateCamera to move to a positive centre to the mesh?
Is the centre point of the mesh calculated first and then the camera pointed at this centre point?
For example, when I click on the mesh on the front, it should appear as
For example, when I click on the mesh on the back, it should appear as
For example, when I click on the mesh on the right, it should appear as
You want to move the camera position to a particular spot based on where on the mesh you clicked? I think that’s what I understood the question to be, so I wrote my response based on that.
You’ll want to find the point on the mesh that you clicked, which you can do by using a picking Ray
Then, it’s a matter of deciding where you want to place the camera based on the results of the mesh collision point. Here’s an edited version of your playground that shows this at it’s most basic. It will snap to the front or the back of the mesh, depending on where you click.
Thank you very much for your answer, you have helped me to learn more.
However, there may have been a problem with my presentation and I have adjusted my question.
When click on a mesh, I want the camera to be pointed at the centre of the mesh.
I found an online example with similar functionality where the camera moves to a mesh on a shoe when the mesh is clicked.
Ok, two things here with this fx of the arcRotateCamera.
First thing was partly answered above is how you select a target for your camera. This is the point where your camera will always look at, no matter the level of zoom or the camera position.
Second is the camera position. What you want to do here is change the ‘camera.alpha’ position to show your object/target from a different angle.
So all you have to do know is to set a different ‘camera.alpha’ and eventually ‘camera beta’ for a 3/4 view.
Edit: If I can allow myself (no offense) from what I’ve seen of your project so far, it appears you want to make 3D commerce, yes? If so, the best advise I could give you today is to rethink and rework the geometry of your model. This one is just way too heavy. I can achieve the same result with 5 probably 10 times less load (faces, vertices). You need to rework your 3D model. I understand you want to show it in its outmost details (with ripples and stuff) but this should be done through the material (with a better normal, bump, AO, etc). You cannot have people wait forever to load a faen t-shirt. I don’t even want to mention mobile. The model needs to load in 5-10 sec. max or you just lost a deal.
Thank you very much for your reply, it was very helpful!