Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 LuisCRSousa · Jan 15, 2016 at 06:31 PM · meshruntimedeformationmesh-deformationruntime-generation

2D/3D Mesh deformer in runtime with a given points

Hello,

I want to deform a mesh in runtime for a music visualizer.

As an example see the image below. I want to animate these waves at the sound of the music. Retrive sound information is easy, but i have a few problems with deform a mesh in runtime.

I tried this code for triangulate a mesh for a given points (http://wiki.unity3d.com/index.php?title=Triangulator). But it takes too long time (70ms for 1000 points).

A boned mecanim animations do not suits for me.

There are any other way to create this?

Thanks :)

alt text

untitled-53.png (34.4 kB)
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 Fattie · Jan 15, 2016 at 08:21 PM 0
Share

just for the record, it's possible you should just use one of the may "deform" packages on the asset store. Additionally, have you tried just using Vectrosity?

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Fattie · Jan 15, 2016 at 08:28 PM

Could your problem be this simple, looking here,

http://docs.unity3d.com/ScriptReference/Mesh.html

it is absolutely essential that you carefully follow the procedure in (2), not the procedure in (1) or (3).


here's a critical discussion on how the .vertices work in Unity, and why you'll need to keep your "own" vertices in practice.

http://answers.unity3d.com/answers/417487/view.html


Actually it just occurs to me the actual example given on the Unity "Mesh" page above, is literally "moving it like a sine wave" heh! What one might do is carefully know your "north side of the ribbon" and "south side of the ribbon" vertices. You'll be doing "one thing" with one set and "another thing" with the other set .. I'm sure you see what I mean.

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 LuisCRSousa · Jan 15, 2016 at 08:58 PM 1
Share

Thank you for the construtive answer.

"Just BTW regarding "triangulation". I can't see any reason, at all, you'd use that concept in what you're doing?" To "create" a mesh from nothing from a given ouside points, you have to calculate its triangles.. (simple 3D mesh problem).

I will accept this answer because you show-me the way. I was calculating the new mesh every single time, but as you said, i should transform the mesh (change the calculated verts). That's the way. So, thank you!

Now the rest, change between thin and thick or like a sine wave, that's basic given this principle of the algorithm.

avatar image Fattie LuisCRSousa · Jan 15, 2016 at 09:18 PM 0
Share

Right, thank God I believe the problem was that simple!

Yes indeed, if you Clear or the like it uses a huge amount of processing each time.

BY THE WAY,

"never forget that whenever you type .vertices, it makes A WHOLE COPY ... it's just Special, it's not like other properties."

It's just one of those weird quirks about Unity!

http://answers.unity3d.com/questions/352513/ways-of-modificating-mesh-triangles.html

here's one featuring some great drawings! :)

http://answers.unity3d.com/questions/315059/how-to-improve-performance-while-generating-extrud.html

here's a handy note on vertice handling in unity

http://answers.unity3d.com/questions/263302/vertices-array-in-mesh-vertices.html

(Just regarding triangulation. I understand what you mean: I can see you were trying to do this problem "really well". (By creating the shape with some algorithm, etc.) What it is, whenever someone around here wants to make a "strip" of color or the like "vibrate" or move, the common ("easy") approach everyone does is just move the verts up and down (indeed, exactly as in that sine example from the page), so I assumed you'd take that easy way out!)

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

35 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 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Create runtime 3D mesh and Fill area like Paper.io 2 1 Answer

2D vs 3D mesh deformation. 0 Answers

Mesh remains deformed in Editor 1 Answer

UnifyWiki BasicQuad 1 Answer

Optimize mesh for runtime performance 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