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 GGames · Oct 23, 2013 at 10:51 PM · meshrotatepointcenteranchor

Set anchor point for procedural mesh?

How can I set the anchor point of a procedural mesh to its centre?

I need to rotate it around its centre and I'm having trouble doing it any other way.

I haven't worked that much with procedural meshes in Unity before, so is there any easy way to do this?

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 Owen-Reynolds · Oct 23, 2013 at 11:49 PM

Just like a mesh made in an editor, the anchor point (pivot point) is automatically where-ever (0,0,0) is. If you built it with Y always 0 or more, the pivot is on the bottom. Build it with Y running from -5 to 5, same for X and Z, the pivot will be centered.

Since it's your mesh, you could recenter it by finding the low/high X values, average them, and subtract from X of each vert (to put the center at 0.) Or just guesstimate and toss in a loop to add (??, ??, ??) to each of your verts. This is the equivalent of, in the modelling program, grabbing all the verts (not the model,) and dragging it a bit.

Or just use the parent trick, same as any other mesh.

Comment
Add comment · Show 2 · 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 GGames · Oct 24, 2013 at 12:23 AM 0
Share

Hi, thanks for the response. Earlier I had tried subtracting the lowest values(All are above 0) and the average of the difference between the lowest and highest values. I managed to get the anchor point at around the bottom-left corner.

What is the parent trick by the way?

avatar image Owen-Reynolds · Oct 24, 2013 at 03:44 PM 0
Share

Suppose the lowest y is 10 and the highest is 25. That's a total length of 15, so you might want the points shifted to -7.5 and 7.5. This means you should subtract 17.5 from all numbers. How to find the equation for 17.5? It's the average of 10 and 25 (you wrote about the difference between them -- turns out that isn't helpful.)

Parent trick: If look up in here in UA about how to recenter an object, lots of examples of doing that using an empty parent.

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

15 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

Related Questions

transform.LookAt (target) mesh anchor point 1 Answer

Find center of multiple meshes 0 Answers

how to increase thickness of points? 1 Answer

Find centres of the sides of a Hexagonal Mesh in UnityScript? Possible? 1 Answer

Rendering Mesh Points on Mobile 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