How can I center the globe camera on a specific geo coordinates (phi and theta) ? #63
-
Hey, I'm trying to find the values of theta and phi to center the globe camera on a specific marker. Does someone know how can I achieve that ? |
Beta Was this translation helpful? Give feedback.
Answered by
shuding
May 26, 2023
Replies: 2 comments 1 reply
-
Check this out: https://cobe.vercel.app/docs/showcases/rotate-to-location |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MatteoGauthier
-
Code snippet to achieve this : const locationToAngles = (lat: number, long: number) => {
return [
Math.PI - ((long * Math.PI) / 180 - Math.PI / 2),
(lat * Math.PI) / 180,
];
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check this out: https://cobe.vercel.app/docs/showcases/rotate-to-location