Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 /
avatar image
0
Question by blitzen · Nov 08, 2011 at 07:34 PM · camerarenderingpositioninitial

Camera Rendering Skewed Until Transform Adjusted

Greetings.

I have an orthographic camera looking straight down at a scene. The problem is that when you launch the app, the contents it is rendering show up "pulled downward" about 5%, as if the camera's position was about 15 or so units further up the positive Z-axis than it actually is. In addition, it seems to cut off any part of a particular object's mesh that's near the bottom 5% of the frustrum. (The object is in the same layer as other objects that are still rendered down in that area.)

However, if you go to the Inspector during run time and adjust anything in its transform (position, rotation or scale), even properties that don't have any affect on the camera's rendering or frustrum like scale or position.y, the contents snap up and show everything correctly as you'd expect given its orientation. Thus, one could conjecture that the camera is being intialized in some weird state, and that this state is corrected when an adjustment to the transform is made.

This is all I do (of relevance) from its simple script in Awake():

camera.aspect=1;
camera.orthographicSize=320;
transform.position.x=320;
transform.position.z=320;

I tried setting position.y to some value at the end of Start() just to see if it would do the same thing as adjusting it from the Inspector, but it did not.

Also, changing anything in the Camera component (size, view port rect, etc.) or any variables in the attached script during run time doesn't correct the rendering offset, only the transform. For kicks, the camera's settings are:

Clear Flags: Don't Clear (Also tried all the others)
Culling Mask: (3 given layers)
Projection: Orthographic
Size: 320
Clipping Planes: 1 (Near), 1000 (Far)
Depth: 0
Rendering Path: Use Player Settings
Target Texture: (None)

So any ideas as to why it's initiating in an off state, what gets refreshed when you adjust its transform in the Inspector, and how to get it to correct this from the get-go?

Comment
Add comment · Show 1
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 blitzen · Nov 09, 2011 at 01:00 PM 0
Share

I reset the entire transform from the Inspector before launch, and with the code above (with a line for ai$$anonymous$$g the rotation downward for kicks) and it worked. No idea what was up, or how doing that fixed it, since it shouldn't have mattered what random position it was in before the launch, as the code still moved it manually just the same. But it works fine now.

Computers for ya.

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

2 People are following this question.

avatar image avatar image

Related Questions

When switching camera position... 1 Answer

stencil mesh,stencil mesh-how to i get a stencil mesh to a camra rendering pipe to cull the mesh behand the mesh. dimish the draw call count 0 Answers

RTS Camera movement wrong after rotation 1 Answer

How can i freeze the camera in Google cardboard? 0 Answers

throwing a ball camera position changes 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