{"id":2395,"date":"2012-07-05T15:10:16","date_gmt":"2012-07-05T15:10:16","guid":{"rendered":"http:\/\/www.west-racing.com\/mf\/?page_id=2395"},"modified":"2014-04-09T15:30:24","modified_gmt":"2014-04-09T15:30:24","slug":"dynamic-ripple","status":"publish","type":"page","link":"http:\/\/www.west-racing.com\/mf\/?page_id=2395","title":{"rendered":"Dynamic Ripple"},"content":{"rendered":"<p><a href=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/dynamrip1.jpg\"><img loading=\"lazy\" src=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/dynamrip1-300x151.jpg\" alt=\"\" title=\"dynamrip1\" width=\"300\" height=\"151\" class=\"alignright size-medium wp-image-2396 fancy\" srcset=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/dynamrip1-300x151.jpg 300w, http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/dynamrip1-1024x518.jpg 1024w, http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/dynamrip1-680x344.jpg 680w, http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/dynamrip1.jpg 1277w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nThe dynamic ripple modifiers uses a custom physics system to simulate ripples moving over a water surface. The modifier allows for rain type drops as well as basic interaction from a mouse drag. Some helper scripts are also provided to allow you to add floating objects to the scene that interact with the ripple modifier and to provide a starting point for your own scripts to interact with the system.<\/p>\n<p><a href=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/dynamrip.jpg\"><img loading=\"lazy\" src=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/dynamrip.jpg\" alt=\"\" title=\"Params\" width=\"252\" height=\"264\" class=\"alignright size-full wp-image-2399 fancy\" \/><\/a><\/p>\n<h3>Dynamic Ripple Param Description<\/h3>\n<h4><strong>Axis<\/strong><\/h4>\n<p>The Axis that is up in the local space of the mesh, if the mesh is a flat plane then the system will automatically pick this value for you, but if you use something other than a flat plane then you will need to set this.<\/p>\n<h4><strong>Columns<\/strong><\/h4>\n<p>How many columns to use in the physics representation of the water surface, the higher the value the better the simulation but there is no point in using a higher value than the number of vertices across the plane, ie if the plane mesh is 64 by 64 vertices then 64 is a good value to use. Use lower values for less cpu usage.<\/p>\n<h4><strong>Rows<\/strong><\/h4>\n<p>How many rows to use in the physics representation of the water surface, the higher the value the better the simulation but there is no point in using a higher value than the number of vertices down the plane, ie if the plane mesh is 64 by 92 vertices then 92 is a good value to use. Use lower values for less cpu usage.<\/p>\n<h4><strong>Damping<\/strong><\/h4>\n<p>How quickly ripples dissipate, a value of 1 will mean the ripples go on forever, a low value of say 0.5 will cause the ripples to almost instantly fade away.<\/p>\n<h4><strong>Input Damping<\/strong><\/h4>\n<p>How quickly ripples from mouse input  dissipate, a value of 1 will mean the inputs will remain deforming the surface, a lower value will cause the inputs to die away, use this value to change how much of a wake is left.<\/p>\n<h4><strong>Scale<\/strong><\/h4>\n<p>This allows you to increase the size of the ripples without changing the physics, or make very small ripples that last a long time.<\/p>\n<h4><strong>Speed<\/strong><\/h4>\n<p>Not used currently leave at 0.5<\/p>\n<h4><strong>Force<\/strong><\/h4>\n<p>How much force a drop will add to the system, increase this to get larger splashes.<\/p>\n<h4><strong>Input Force<\/strong><\/h4>\n<p>How much force the mouse input adds to the system, increase this to get deeper wakes.<\/p>\n<h4><strong>Obstructions<\/strong><\/h4>\n<p>Not used currently.<\/p>\n<h4><strong>Drops Per Sec<\/strong><\/h4>\n<p>In play mode this says how many rain drops will fall each second, use 0 to have none.<\/p>\n<h4><strong>Reset Physics<\/strong><\/h4>\n<p>The physics will automatically update if any changes to say row, columns or axis are detected, but you can force a rebuild by clicking this button.<\/p>\n<h3>Dynamic Ripple Class<\/h3>\n<p>[cc lang=&#8221;c#&#8221;]public class MegaDynamicRipple : MegaModifier<br \/>\n{<br \/>\n\tpublic MegaAxis\taxis;<br \/>\n\tpublic int\t\tcols;<br \/>\n\tpublic int\t\trows;<br \/>\n\tpublic float[]\tbuffer1;<br \/>\n\tpublic float[]\tbuffer2;<br \/>\n\tpublic int[]\tvertexIndices;<br \/>\n\tpublic float\tdamping;<br \/>\n\tpublic float\tWaveHeight;<br \/>\n\tpublic float\tForce;<br \/>\n\tpublic float\tDropsPerSec;<br \/>\n\tpublic float\tspeed;<br \/>\n\tpublic float[]\tinput;<br \/>\n\tpublic float\tinputdamp;<br \/>\n\tpublic float\tInputForce;<br \/>\n\tpublic bool\t\tObstructions;<br \/>\n}[\/cc]<\/p>\n<h3>Dynamic Ripple Tutorial<\/h3>\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=KSmfsJFtWdU&#038;hd=1&#038;autoplay=1\" class=\"fancybox-youtube\"><img loading=\"lazy\" src=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/ytdynamriptut.jpg\" alt=\"\" title=\"Dynamic Ripple Modifier Tutorial\" width=\"680\" height=\"405\" class=\"aligncenter size-full wp-image-2392 fancy\" srcset=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/ytdynamriptut.jpg 680w, http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/07\/ytdynamriptut-300x178.jpg 300w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<h3>Video of Features<\/h3>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=XG2zv0-tOM0&#038;hd=1&#038;fs=1&#038;autoplay=1\" class=\"fancybox-youtube\"><img loading=\"lazy\" src=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/04\/ytwater3.jpg\" alt=\"\" title=\"Click to Play\" width=\"680\" height=\"381\" class=\"aligncenter size-full wp-image-1849 fancy\" srcset=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/04\/ytwater3.jpg 680w, http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/04\/ytwater3-300x168.jpg 300w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/a><\/a><\/p>\n<h3>Floating Objects<\/h3>\n<p>First test of a floating rigid body system linked to the Dynamic Water modifier in MegaFiers for Unity. Works quite nicely but I think I can improve things, but the Dynamic water modifier has a method to get the water height for a given point and methods for adding forces to the water, so anyone can code their own interaction scripts for the system.<\/p>\n<h3>Click the image below to see the video.<\/h3>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=w-LmxLfhyyI&#038;hd=1&#038;fs=1&#038;autoplay=1\" class=\"fancybox-youtube\"><img loading=\"lazy\" src=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/04\/ytfloat.jpg\" alt=\"\" title=\"Click to Play\" width=\"680\" height=\"405\" class=\"aligncenter size-full wp-image-1852 fancy\" srcset=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/04\/ytfloat.jpg 680w, http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2012\/04\/ytfloat-300x178.jpg 300w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The dynamic ripple modifiers uses a custom physics system to simulate ripples moving over a water surface. The modifier allows for rain type drops as well as basic interaction from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":38,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages\/2395"}],"collection":[{"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2395"}],"version-history":[{"count":11,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages\/2395\/revisions"}],"predecessor-version":[{"id":5334,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages\/2395\/revisions\/5334"}],"up":[{"embeddable":true,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages\/38"}],"wp:attachment":[{"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}