Help Liquid-to-Liquid Collision - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Help Liquid-to-Liquid Collision (/thread-2701.html) |
Liquid-to-Liquid Collision - gotou - 14-01-2021 I am developing a chemical experiment environment using VR. My plan is below. When user mixes liquid A and liquid B, after that, its mixed liquid is displayed as a percentage; 70% or more is "perfect", 40% or more is "successful", and under 39% is "Failed" respectively. Also, if liquid A is mixed with liquid C, an explosion is happened and "Failed" is displayed. However, I made, installed and runed the scripts, nothing happened on VR. I think the reason why I cannot get the collision between particles. However, I am not sure how to modify the script. If you know the solution. Could you assist me? Reference: Obi Fluid's sample "Maze", "Obi Manual" http://obi.virtualmethodstudio.com/tutorials_4/emittermaterials.html Assets I'm using: SteamVR Plugin, SAColliderBuilder, Obi Fluid Version of Unity: Unity 2019.4 I am looking forward to hearing your answer. Sincerely yours, Code: using System.Collections; RE: Liquid-to-Liquid Collision - josemendez - 14-01-2021 You misunderstood how fluid works: Fluid particles do not collide with each other. Only solid particles (granulars) do. Fluid particles interact with each other trough density constraints, and can exchange property values via diffusion. Take a look at the FluidMaze sample scene measures tints fluids and measures its "purity": when a particle collides with a solid block, the blocks' color is transferred to the solver.userData array. This data is diffused across neighboring particles during simulation. RE: Liquid-to-Liquid Collision - gotou - 15-01-2021 (14-01-2021, 04:41 PM)josemendez Wrote: You misunderstood how fluid works: Fluid particles do not collide with each other. Only solid particles (granulars) do.Thanks for the reply. Does this mean that something like the plan I am working on is impossible? Also, for example, is it feasible to put a solid in a liquid, and when it comes in contact with the liquid, the liquid will change color and the solid will gradually decrease in size? (I'm using a translation site. Sorry if this is hard to understand.) RE: Liquid-to-Liquid Collision - josemendez - 15-01-2021 (15-01-2021, 03:02 PM)gotou Wrote: Does this mean that something like the plan I am working on is impossible? if I understood it correctly, it is completely possible to do what you want. You just need to use diffusion instead of relying on collisions between particles (which won't happen for fluids). (15-01-2021, 03:02 PM)gotou Wrote: Also, for example, is it feasible to put a solid in a liquid, and when it comes in contact with the liquid, the liquid will change color and the solid will gradually decrease in size? This is exactly what the FluidMaze sample scene does (minus the solid gradually decreasing in size, which can be done just by scaling it). Check its components to see how it's done. |