Arc Rotate Camera set rotation and overwrite target etc

Hello i need to set a specific Vector3 rotation to an Arc Rotate Camera.
By doing so the target, alpha and beta would be overwritten to the according rotation.
Otherwise if that doesn’t work i could also translate the vector values to alpha and beta however is there no third property for the z rotation?

Simply overwriting the rotation doesn’t seem to work:

Hi and welcome to the Community.
The arc rotate camera is an orbital camera, moving around a target. In this case, z (or better said depth translated to distance) is the camera radius which is equal to the distance from the target.

Sry, but it’s unclear to me what you want to achieve. May be you could enhance a little?
Do you want new coordinates for the target or for the camera position. The target uses standard vector3 coordinates. The position of the camera is set through the alpha, beta and radius from the target.

Edit: Just quickly edited the link with a couple of comments. Go to the bottom part of the script.
Hope this helps. Else, let us know. Meanwhile, have a great day :sunglasses:

1 Like

Hi and thanks for responding.
the camera radius is the positional z right?
However i need it for the rotation, like this:

here in the scene i created an example cam on the bottom to visualize a viewpoint which i would like to recreate with an ArcRotateCam:

Hi,
Sry I could not answer earlier. I had to go to the shops and plan for the weekend.
I think I better understand what you want. What is still unclear to me is if you want to make an animation or just fixed spots. Anyways, if you want to keep with the same distance from the target, your z vector3 coordinates for the camera position will remain unchanged, since the last of the vector3 coordinates for the arcRotateCamera position is the radius.

With that said, with this orbital camera you are rotating 360° on two axes only, the alpha and the beta. So what you will need to do when translating your vector3 world coordinates is to account z only for whether it is positive or negative. I would assume that the zero is your target which will make things a lot easier, since the camera position is from the target. So if the target is at zero and your z coordinates is positive, then the camera will look at the object from the front. If the value is -z, then the camera should look at the target from the back (which is equal to Math.PI on the alpha).

Are those points you draw the ones you want to use as a reference? I mean you already have the values shown here, so you should be able to reproduce, yes? However, and despite the fact that my math skills are also not the best :wink: I believe I could quickly demonstrate this in a PG.

Else, if the vector3 world coordinates you want to pass to the camera are those of the position of the camera relative to the target (and again, assuming that the target is at zero), then you are going to need to perform some maths to translate x and y to the alpha and beta, and the z or -z, without the value, also added or substracted to the alpha and beta). Not what I do best but if you can’t handle it, I know of a couple of people who likely already have the formula and I can call them in for you.
You might need a bit of patience because of the Season holidays.

I’m not sure I will have much time to return on it today, but I will have a look later to check if you reply.
Meanwhile, have a great day :sunglasses:

Hi,

no problem, but thanks for the detailed response.
I just have one question left:

Is there any specific reason why the orbit/arc rotate camera is only able to rotate on two axes (alpha and beta) ? Couldn’t there be a delta for the y rotation?

Because if the universal camera has a y rotation it becomes Impossible for the arc Rotate cam to achieve the same view:

image

(both cameras have the same position and target however the universal camera has a rotation on the y which doesn’t exist on the arc rotate cam)

I don’t know. I guess it’s by design. However, there’s still the possibiltity to create a custom camera.
Personally, I think it would be cool if the ‘arcRotate’ could bank or ‘wiggle’ but it would just be a ‘nice to have’ I assume. You can still target with other types of camera or as I said, make your own.

2 Likes