Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Baschti-aus-s · May 28, 2020 at 12:03 PM · camerarenderingcamera-lookcamera.main

Main camera field of view (FOV) angles in inspector doesn't match to actual used FOV of the main camera

I ‘am struggling with the calculation oft the FOV angles, because my results doesn’t match to the FOV the main camera actually used.
.
Why I ‘am doing this: I want to create a top down RTS game. To size my map correctly, I want exactly calculate, what part of the map will be visible in the main camera depending on the camera height, its position and of course on its FOV.
The problem: With the given vertical angle, I ‘am able to determine the top and the bottom border of my field of view (see picture 1). What is currently not working, is to determine the left and the right border of my field of view (see picture 2). I want to clarify, if I do something wrong in my math or if this is probably a Unity issue.
.
Step by step:
My settings:
Aspect ratio main camera: 16:9, 1920x1080 pixel
FOV vertical: 50°
FOV horizontal: 79,32° (by 16:9 aspect ratio, this one is correct)
Camera position x; y; z: 0; 25; 0
Camera pitch: 45° around the x-axis
.
alt text Picture1
.
In picture one you see a side view of my scene (looking from the right side). The z-axis marked the ground of my map. P1 is the topmost point, which is visible in the game view. If you move it a little bit more to the right (+z) it will leaving the FOV to the top. The z-position of P1 (side b of the triangle) can be determined with simple trigonometry:
.
b = tan (70°) x a
.
a is the camera height which is set to 25, so b is 68,69. As you can see, when I set the z-position of P1 to 68,69 it perfectly matches to the top border of the FOV of the main camera. For the next step, we also need the length of the side c of picture 1, which can be determined with:
.
c = a / cos(70°)
.
Again with 25 of camera height, we will get 73,1. I have placed a 3D cube in scene with the scale 1f; 1f; 73,1f and it perfectly fits to the length of c. So everything seems to be correct. With this value, we go to picture number 2
.
alt text Picture2
.
In picture two, we see the same scene with the same camera position and the same position of P1 but now we are standing in front of the scene. I now tried to get the x-position of P1 (side b in picture 2), so that it will perfectly fit to the right border of the FOV of the main camera.
I used again some simple trigonometry to achieve this:
.
b = a x tan(39,66°)
.
Now a in picture 2 matches the length of the side c from picture one. So the length of a is 73,1. With this value, we will get a length for b of 60,6. And if I move P1 to x = 60,6 it is outside of the FOV of the main camera. And this is not an issue of the gizmo which is drawn for the FOV of main camera, you won’t see an object at this point in the game view either.
Now from my point of view, and if all my calculations are correct, the main camera did NOT use a horizontal angle of 79,32 as mentioned in the settings, but a smaller one. Can anyone confirm my consumption or did I missed something?

sideviewlabeled.png (36.5 kB)
frontviewlabeled.png (38.8 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

286 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rendering viewmodel over everything WITHOUT dual camera 1 Answer

Object is out of the sceene but fps is low 0 Answers

Black line in my game. 0 Answers

Problem with Samsung Galaxy Note 8 1 Answer

Camera short blackout after scene is loaded (Lightweight Pipeline issue) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges