This project simulates an ocean surface using OpenGL with GLUT. It generates various types of waves based on predefined parameters and renders them in a 3D environment.The project uses sine waves to simulate the ocean surface
- Simulates different types of waves:
- Stormy waves
- Large, rolling waves
- Choppy, wind-generated waves
- Medium waves with varying direction
- Allows navigation within the 3D environment:
- Arrow keys for rotation
- WASD keys for movement
- Plus and minus keys for zooming
- Real-time rendering using OpenGL
main.cpp: Contains the main program code.wave.h: Header file defining classes for waves and ocean simulation.spectrum.txt: Text file containing parameters for generating wave spectra.
- C++ compiler
- OpenGL
- GLUT
To compile and run the ocean wave simulation, follow these steps:
-
Compile the
main.cppfile with the following command:g++ main.cpp -o ocean_simulation -lfftw3 -lglut -lGL -lGLU
This command compiles the source code and generates an executable named
ocean_simulation. -
Run the compiled executable:
./ocean_simulation
This command executes the compiled program, launching the ocean wave simulation.
-
Use the following controls to navigate within the simulation:
- Arrow keys: Rotate the view.
- WASD keys: Move the camera.
- Plus (+) and minus (-) keys: Zoom in and out.
- Add fft and gpu support
- use gestner and try different wave generating algorithms
Enjoy exploring the simulated ocean environment!