• 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 /
avatar image
0
Question by michael 4 · Jul 12, 2011 at 07:27 PM · camerafieldofviewfrustrum

Camera Frustrum Calculation

Does unity have any built in functions that help calculate the bounds of the camera? I want to place a transparent shader over top of it to show from a 3rd person perspective, everything that is in that cameras field of view.

In scene view, the fustrum is shown already. So unity somewhere is already calculating it.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by aldonaletto · Jul 12, 2011 at 07:40 PM

The frustum is a basic item in any game engine. Unity have a function to calculate the frustum planes for a given camera, CalculateFrustumPlanes and another, TestPlanesAABB which together can be used to check if some object is inside the frustum. But there is an easier feature already included, Renderer.isVisible, which tells if an object is in the frustum of any camera. If you have only one camera, this will be easier to use - but if you plan to use an auxiliary camera to render only what the main camera sees, it will not work because both frustum will be taken into account.

Comment
Add comment · Show 1 · Share
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
avatar image michael 4 · Jul 12, 2011 at 07:44 PM 0
Share

CalculateFrustumPlanes seems to be what Im looking for, I simple want to take the planes it returns and turn them into mesh planes with a transparent shader. Thanks

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to cut a camera view in half 1 Answer

More questions on generating camera frustrum 1 Answer

Change camera FOV to keep 3d scene same size on screen, independently from resolution 0 Answers

How can I know if a gameObject is 'seen' by a particular camera? 10 Answers

How to animate zooming in of the camera? 4 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges