You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi again! I'm trying to implement custom controls for my camera and for that I need to know where the camera is pointing at on the ground. My understanding was that the focus or target_focus contain this information, but when reading those properties I'm getting a point high above the ground (large y coordinate), even if I manually set the target focus to be at y = 0.0. It also changes when zoom is changed. I think it basically contains the current camera height. Is this intentional? Could you please advise how to get the coordinates on the ground?
My naive way of doing that is as follows, but it doesn't account for any ground topology.
let ground_focus = camera.focus.translation.xz().extend(0.0).xzy();
The text was updated successfully, but these errors were encountered:
Hi! You're correct that the target_focus is automatically adjusted and reflect the camera's height. I'll need to think about this a bit more but a hacky way to get the actual focal point is to reverse engineer it by subtracting cam.height_max.lerp(cam.height_min, cam.target_zoom) from the Y coordinate of focus or target_focus. (That's the value added to the ground surface in order to follow the ground.)
I have pushed 0.4.2 which contains #8. focus now isn't moved up to the camera's height and you can use it directly instead of subtracting the height from it.
Hi again! I'm trying to implement custom controls for my camera and for that I need to know where the camera is pointing at on the ground. My understanding was that the
focus
ortarget_focus
contain this information, but when reading those properties I'm getting a point high above the ground (largey
coordinate), even if I manually set the target focus to be aty = 0.0
. It also changes whenzoom
is changed. I think it basically contains the current camera height. Is this intentional? Could you please advise how to get the coordinates on the ground?My naive way of doing that is as follows, but it doesn't account for any ground topology.
The text was updated successfully, but these errors were encountered: