Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WBSim - Water and Buoyancy Simulator

Project Overview

A real-time 3D water simulation with physics-based buoyancy, Gerstner waves, and screen-space reflections.

  • Open the live demo hosted on GitHub Pages: WBSim

  • You can find the report in the /docs folder.


Scene objects

Two objects can float on the water. Switch between them using the Complex Model toggle in the top-right panel.

Mode Object Description
Off (default) Cube Simple box with full buoyancy simulation
On Sailboat Full model with dynamic sail, boom, and pennant

Controls

Keyboard

Key Action
W Thrust forward
A Steer left (yaw)
D Steer right (yaw)
/ Orbit camera left / right around the object
/ Orbit camera up / down around the object

The S key is intentionally unbound — the water and buoyancy slow the object naturally.

Camera

  • Left-drag — orbit around the object
  • Scroll wheel — zoom in / out
  • Auto-chase — after 4 seconds of no camera input the camera smoothly eases behind the boat

Sailboat sail behaviour

The sail and pennant react to wind in real time:

  • At rest the sail aligns with the wind.
  • Steering left (A) or right (D) swings the boom toward perpendicular and billows the sail.
  • The pennant at the top of the mast always streams directly downwind.

Wave controls (top-right panel)

Control Range Effect
Waves 1 – 16 Number of Gerstner wave components superimposed
Wave Height 0.1 – 1.8 Master amplitude of the waves
Gerstner Effect 0 – 2 Steepness / lateral displacement of wave crests
Wind Angle 0° – 360° Primary wind direction; waves and sail track this value
Use Scattering on / off Toggles subsurface scattering on the water; uncheck for flat diffuse shading
Complex Model on / off Switches between the cube and the sailboat

About

final-project-wdsim created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages