- Home /
How to accurately report how much world space is seen by the bounds of the camera
I have an accurate Earth in my scene. What I'm trying to do is make a script that accurately reports how much of the earth that the camera is seeing. For instance, when fully zoomed out, the script would report 6378137m x 6378137m. When the camera is zoomed in to say, Iceland, it would say 101,826m x 101,826m, or however much of that area is within the viewport. Any ideas on how to do this? Thanks.
An accurate earth is going to be (roughly) spherical, right? So first thing to point out is that its not going to be possible to calculate the area of the part of its surface that your camera is seeing, using such a simple formula.
Assu$$anonymous$$g from what you've posted, that your camera has a square viewport, what you'll be seeing is a projection of that square onto the surface of the sphere. That projection is not itself a square.
Your answer
Follow this Question
Related Questions
Keep camera at certain distance from character when rotating 3 Answers
How to make camera face to 2D planet as player moves around it. 1 Answer
How to measure the distance between an Augmented Reality marker and camera? 0 Answers
How to compute real life distance between Android camera and an AR marker 0 Answers
Calculate vector3 from angle 2 Answers