• 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 Borui · Apr 12, 2013 at 07:26 AM · mechanicsworm

Worm muscle contraction simulation(involved many individual muscle pieces)

I am trying to simulate a worm called c elegans, it has many muscle groups on the body. I want to be able to contract each muscle piece independently with script, what would be the best way to do this? Thank you

Comment
Add comment · Show 4
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 · Apr 12, 2013 at 07:27 AM 0
Share

To begin with, are you totally familiar with "boned/skinned models" and their place in video game engineering?

that would be a basic starting point. you are asking a very advanced question. If you have not reached that level, pls delete the question and enjoy the next yr or two of research! :)

avatar image Owen-Reynolds · Apr 12, 2013 at 04:34 PM 0
Share

Using springs from the physics system sounds obvious, but probably isn't good enough for this.

Springs can be set to "want" to be a certain distance apart (like a resting muscle length,) but generally each object (chunk of worm?) gets only 1 attachment. So no good way to simulate, say, a ring of 6 lengthwise muscles, all acting on segments. Plus the system tends to get jittery when lots of things are all affecting each other.

If you find code for a high-powered yet slow physics simulator, could run it in Unity (even C++ though a DLL, I think) and just use Unity for display.

avatar image Borui · Apr 12, 2013 at 05:30 PM 0
Share

I think using springs from the physics system is a good idea, I can certainly give that a try, but I was wondering if there are any built-in functions in unity that does non-bipedal mechanism. I understand there is one in unity that simulates human skeletons, could I possibly tweak the system to make what I wanna do? or do you guys know of any video tutorial that $$anonymous$$ches this mechanisms, thank you!

avatar image Fattie · Apr 12, 2013 at 09:37 PM 0
Share

Well there's your answer ...

http://answers.unity3d.com/questions/437115/in-a-bonedskinned-model-can-you-shrink-a-bone.html

of course, you CAN easily shorten a bone. So, that's perfect.

(There isn't really "bones" it's just the distance between two "joints" in a skinned model.)

So, you have to get to work learning to use Cheetah3D, $$anonymous$$aya or the like to make "boned" models, and then Unity. Good luck!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Owen-Reynolds · Apr 12, 2013 at 08:19 PM

Not really an answer, but too long to fit into comments:

"Skeleton" animation (technical term: bones) usually starts with a human-created set of movements on a stickman. Either by an artist, of motion capture. So any muscle action is never computed -- either faked (artist) or observed (mo-cap.)

The bipedal skeleton system is then about playback, or synching forward motion with foot motion (avoid moonwalking.) It generally assumes you have a pre-done set of motions.

Say you had a "boned" worm, (no animation needed.) It would be a little like a radio-controlled set of connected motorized rods, wrapped in wormed-shaped clay. If you did all the math yourself, you could use the bones to internally bend the worm in the correct way. So, instead of maybe having a set of spheres for the body, which would "bend," by moving spheres, you could have a continuous body which would flex.

Comment
Add comment · Show 14 · 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 Fattie · Apr 12, 2013 at 08:32 PM 0
Share

"Say you had a "boned" worm, It would be a little like a radio-controlled set of connected motorized rods"

That is a fantastic analogy, man.

avatar image Fattie · Apr 12, 2013 at 08:46 PM 0
Share

Exactly what Owen said.

I just realized, we were WOR$$anonymous$$ING ON a project like this !!

alt text

This "thing" .. it's like a tongue or flattened worm or flattened sausage .. moves beautifully in 3D. You see?

This is exactly how you do it. The first comment anyone gave you ages ago was "are you familiar with boned/skinned models"

one issue though, Owen .. I actually don't know, can you "contract" a bone in some way ??? and have the skin shrink as you do so?

Does anyone know this ?

wormlike.jpg (30.4 kB)
avatar image Owen-Reynolds · Apr 12, 2013 at 10:01 PM 1
Share

If you drag in any boned model, you can see that the bones are represented as transforms, and scaling them deforms the model in the way you would expect. So, yes, you can scale bones.

Animation software can save rotation, position, scale; but I think most animators are taught never to use scale (since you can't shrink a real bone.)

avatar image Fattie · Apr 13, 2013 at 06:36 AM 0
Share

indeed, you're utterly correct of course Owen. it's funny it just "didn't occur to me" - as you say one is so used to animations where bones are fixed!

there's a line of code for the OP even!

http://answers.unity3d.com/questions/437115/in-a-bonedskinned-model-can-you-shrink-a-bone.html

it would be great to get at the skinning and write "bulging" as a concept in to the skinning

avatar image whydoidoit · Apr 13, 2013 at 06:39 AM 0
Share

The best way to do this would be using a model with "morphs" on it from 3DS/etc or to do a similar kind of thing - modifying the vertices and retaining the volume of the muscle.

Show more comments

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

13 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

Related Questions

Multiple Cars not working 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

TornadoTwins Tutorial 1 Answer

How does Unity3d uses nvidia 0 Answers

Material doesn't have a color property '_Color' 4 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