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
0
Question by jakekola2 · Nov 18, 2015 at 10:43 AM · collisionphysicsparticle systemwater

Water physics in solid object

Lets say there is "water" in a still cup (water is also still) and the cup starts to move (there is a force applied to the water in the opposite direction of the cup movement) and then the cup hits a wall (water splashes up and possibly out of the cup). Would this be possible to simulate?

I have tried looking this situation up on google and on this site but did not get a clear answer.

I do understand that simulating water physics is very complex and would require collisions between each particle to exist. Not sure if this type of situation would require physics for the water or if it could be resolved in a round about way

New to the website and unity. Appreciate any sort of help given!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Soraphis · Nov 18, 2015 at 01:09 PM

there is a force applied to the water in the opposite direction of the cup movement)

not true actually, the water is inert. And there is a force applied to the water in movement direction (from the back wall of the cup). But to your problem:

You want to simulate the water as particles. Think about filling a cup not with water but with many, tiny spheres (you can think about it as water molecules). With these spheres you can simulate inertia and forces to the water. And with an shader you make it look like water.

https://en.wikipedia.org/wiki/Smoothed-particle_hydrodynamics http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.121.844&rep=rep1&type=pdf

https://software.intel.com/en-us/articles/fluid-simulation-for-video-games-part-1/

But this isn't that easy, and can really be an hit to performance. You should consider faking it, instead simulating it:

The water in the cup being just a plane with many vertices. Everytime a force is applied to the cup you manipulate the water-plane-vertices. Reducing the height of some at the front (nearest to movement direction) and increasing the height at the end. the height of all vertices added together needs to stay constant.

This isn't easy either, because it needs some afford to make it look nice and realistic.

Comment
Add comment · 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
0

Answer by KdRWaylander · Nov 18, 2015 at 12:13 PM

Hi,

To my knowledge, there is no physics of particules (water, sand, ...) in Unity (yet?) ! However, you can still achieve some cool stuff using Particle Systems (the same way you do smoke, fire, ...): every time your cup hit the wall you throw a water effect.

More informations:

  • https://www.youtube.com/watch?v=G-K2rtiv80M (you'll find dozens of tutos on Youtube)

  • http://docs.unity3d.com/Manual/ParticleSystems.html

Cheers

Comment
Add comment · 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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to make physics collision dotted simulation like bubble shooter ? 2 Answers

How to do particle collision 2 Answers

Make a particle system with particles that stick to everything once they collide 0 Answers

C# Custom Collision Script (solved) 1 Answer

OnCollisionStay only detects collisions after a secondary collision 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