Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by .sanders · Jan 19, 2012 at 11:33 PM · sceneviewprojection-matrix

The size of the SceneView window

Hi,

I am trying to find a workaround for the incorrect Screen.width and Screen.height values in edit mode (not running the game). I found out that this messes up the projectionMatrix of a camera in the scene. This projection matrix is strangely enough not related to the GameView size (which I have thanks to Bunny83 in the answer to this question: http://answers.unity3d.com/questions/179775/game-window-size-from-editor-window-in-editor-mode.html) but it's related to the width and height of the SceneView. I tried messing around with it and noticed that the projection matrix was changing only when I resized the SceneView. Now I am trying to calculate the same values of the projectionMatrix at runtime, but then in edit mode. I already have the SceneView object with the position property which give me these values but when I use them to calculate it seems that there is a little gap between the number I suppose to have and the number I actually have. That gap is a difference in height of 22 pixels (so the value I calculate is correct when subtracting it from the SceneView.position.height if the SceneView is a child of the main window, or adding the 22 pixels if the scene view is floating anywhere on the screen). So my question is if there is some way to either get the right projectionMatrix in edit mode (which seems related to 'bug' in the Screen.width and Screen.height values) or to get the SceneView's width and height that are used to calculate the projectionMatrix of a camera in edit mode. I know it's just a matter of adding or subtracting the 22 pixels but I don't know if the SceneView is embedded in the main window or is floating around in some other Unity-user's environment. Or is there a way to find that out?

It's frustrating to be so close to a solution... :-)

thanks in advance for any help on this subject!

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
0
Best Answer

Answer by .sanders · Jan 20, 2012 at 02:38 PM

Ok, I'll be the first to answer then, found the problem, I mixed up the values somewhere.. don't know exactly where (values of the scene view and game view). I know have the right projectionMatrix in edit mode which I set to the camera's property and all calculations in edit mode are correct.

Sorry for my unseemingly complex and confusing question.

Comment
Add comment · 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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Game objects wont render in scene view (but renders in game view) 1 Answer

Instantiate object in middle of Editor Scene View 1 Answer

I can't see my scene 2 Answers

SpriteManager sprites only visible in scene view 2 Answers

Where is the lush grass gone (Unity 5) 1 Answer


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