#Look at two positions at once with pan orbit camera

11 messages · Page 1 of 1 (latest)

urban gust
#

So I'm using this library for pan orbit camera and I'm seeing that I can only rotate the pan orbit camera using target alpha and beta. So I want to look in the direction of entity B while still focusing and looking on entity A. Do I somehow have to calculate the alpha and beta? I can't use the camera's transform.look_at function as still breaks the pan orbit camera

GitHub

A simple pan and orbit camera for the Bevy game engine - GitHub - Plonq/bevy_panorbit_camera: A simple pan and orbit camera for the Bevy game engine

pale cairn
#

Weird that they call it alpha and beta and not yaw and pitch respectively.

Assuming you just want the yaw(alpha) to be facing entity B, you can use atan2 of offset of their positions (B.pos - A.pos)

#

If you are trying to do like a third-person over the shoulder cam with it you will need to do a little more work to get there

#

You may want to look up how to calculate euler angles from a direction vector to figure out your rotation

#

Actually I'm not 100% sure about their alpha/beta vs yaw and pitch. You might have to experiment a little to figure out which is the rotation around an object (yaw), and which is looking up/down at an object (pitch)

urban gust
urban gust
#

nvm works now

pine acorn
#

Hi, I'm the author, sounds like you got it working how you want, but I just want to say that having the camera looking at a different position that it's rotating around is not currently possible, as the plugin always points the camera to look at the focus. But I'm guessing that's not actually what you were trying to do.

#

"pitch" and "yaw" aren't quite the same I don't think. Like your head has pitch and yaw, because the pivot point is your head. But here the pivot point is some other object, and so the movement around it isn't the same as pitch/yaw.

pale cairn
#

I guess that's true, but pitch and yaw at least tell you what axis you are rotating around with some sort of standardized basis. Alpha and beta doesn't really give any info in the name. I guess you could also name them something like vertical and horizontal or w/e