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 piecewise · Apr 06, 2011 at 09:30 AM · meshproceduralboundsmeshrenderermeshfilter

Bounds of dynamic mesh not updating

I've got a GameComponent that's using a MeshFilter, with a dynamically created mesh, and a MeshRenderer.

As soon as the origin of the object goes off-screen, the mesh stops being rendered both in the game and scene editor views. I'm assuming this is because the bounding box of the object isn't being updated to match the mesh once it gets created.

I've called createdMesh.RecalculateBounds(), and I've also tried setting it manually, but neither work.

Do I have to set these bounds elsewhere, like on the filter itself, or the renderer, or am I going wrong somewhere else?

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
1

Answer by Jesse Anders · Apr 06, 2011 at 12:42 PM

Generally speaking, recalculating the mesh bounds should work. You might try adding some debug output; for example, you could draw the bounding box for the mesh, or simply print its min and max vectors to the console. That should at least tell you whether the AABB has been effectively reduced to a point (which is what the behavior you describe would suggest), or if the problem is elsewhere.

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 Codster · Jun 01, 2011 at 07:42 AM 0
Share

Turns out mesh.RecalculateBounds()does NOT affect renderer.bounds it just always stays at zero. So anyone have a clue what's going on lol.

Edit: Never$$anonymous$$d it does work. But only if called after the mesh is set in the mesh filter. So it's; GetComponent($$anonymous$$eshFilter).mesh = mesh; THEN; mesh.RecalculateBounds();

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

1 Person is following this question.

avatar image

Related Questions

Procedurally generated mesh not Rendering all triangles 1 Answer

Possible material or mesh leak 1 Answer

Way to erase meshfilter mesh and rewrite it? 1 Answer

MeshCollider is not getting updated when adding vertex to mesh 1 Answer

Submeshs doesn't combine with materials 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