GridVids
Sign in with YouTube

Unity3D - Making Objects Float in an Ocean, and Making Ocean Waves

nesis Oct 5, 2014 15:45
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Don't Miss
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Mark watched
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Hide
Open in popup Open on YouTube
Share video

Share video

Copy the GridVids link or iframe code.

Video link
Iframe code
Iframe content

After watching someone on Twitter tinker with a ocean waves + buoyancy system, I felt like making one too. (The person on Twitter was https://twitter.com/marmalade_tim - he does some pretty slick modelling and map design for Team Fortress 2. Give him a follow!) WHAT THE SYSTEM CAN DO: - Objects, when submerged, get forces applied to push them back to the surface. The deeper they are, the more force is applied. Velocity and angular velocity (ie rotation speed) are dampened every frame an object is in the water, to simulate fluid resistance. - Waves push objects in the direction the wave is travelling, based on wave speed (ie wave frequency), and height of the wave at the given point (higher = more push, lower = less push). - Waves can have their frequency, amplitude, wavelength, and source point changed dynamically. - Many waves can be added together for more realistic + chaotic waves like seen in the ocean. - The boats typically flip back up the right way. There's no hack there, just a very massive rigidbody added below the boat's centre of mass (seems making the rigidbody ~80% of the boat's mass works well for stability without sinking the boat). This simulates what real boats use to remain stable on turbulent waters, as far as my layperson knowledge goes.
Education
#Unity3d #Unity #game #design #programming #coding #ocean water #ocean #waves