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
0
Question by Kuo1 · Aug 28, 2014 at 04:13 PM · body

Triangulated plane

Hello all,

I am making a game which you can use your mouse to click on human body and get some deformation on the body. Thus I need to get the trangulated meshes of the body and change the position of the triangles when I click on human body. Is there a way to get the axis of those triangulated planes?

Thanks, Kuo

Comment
Add comment · Show 2
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 robertbu · Aug 28, 2014 at 04:25 PM 0
Share

I recommend you study the reference page for the $$anonymous$$esh class:

http://docs.unity3d.com/ScriptReference/$$anonymous$$esh.html

In Unity, vertices are separate from triangles. For what you are doing, you want to modify the vertices. The modification is easy, but identifying the right vertices can be difficult. A raycast (which you would do to project the mouse click into the scene) will identify the triangle hit which allows you to identify the three vertices of the hit triangle, but you will likely want to identify more vertices.

get the axis of those triangulated planes

I have no idea what this means.

avatar image Kuo1 · Aug 30, 2014 at 12:21 AM 0
Share

Thank for your reply. "axis" is the vertices of the triangle. I used the second example and it works well for a cube, but when I attached to the human model, it doesn't seem to work at all. I guess I will have to use skin mesh. What is the difference between a skin mesh and a mesh?

Thanks.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by AlwaysSunny · Aug 29, 2014 at 06:35 AM

As suggested by @robertbu, the Mesh class has what you need.

I'm guessing "get the axis" means the normal of the triangle hit by a raycast, which is found using hit.normal

As for getting nearby verts, probably with some kind of falloff - it's possible to loop through all verts and weight their deformation by proximity to the hit.point, though depending on the number of verts, it's likely to be quite expensive.

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 robertbu · Aug 29, 2014 at 06:50 AM 0
Share

If "get the axis" means the normal, then use the normals array in the $$anonymous$$esh. The is one entry in the normals array for each vertex in the vertices array.

avatar image Kuo1 · Aug 30, 2014 at 06:40 PM 0
Share

Thanks for your answer. The 3d model I imported was using skinned mesh renderer,so when I used the example from the tutorial, it was changing anything. I am not worried about how it deforms now, because I cannot even change the shape at all. Should I use the function from skin mesh renderer?

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Character Body Part Dismemberment 1 Answer

Mask Transform options greyed out in Animation import settings -1 Answers

detach body parts 0 Answers

AR foundation release schedule for body and face detection on Android? 0 Answers

Freezing Rigidbody Rotation 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