ClothSimulation
ClothSimulation copied to clipboard
Simple cloth simulation with OpenGL.
Cloth Simulation


UI
-
Window
ESCExit
-
Draw Mode: Change the rendering mode of cloth
ZNode ModeXSpring ModeCCloth Mode
-
Camera
WSADMove camera up / down / left / rightQEMove camera closer / farther
-
Pause
TPauseRResume
-
Wind Force
MOUSE_BUTTON_LEFTClick to apply wind force↑↓←→Apply wind force
-
Pin Point
OFree left pinPFree right pin
Environment
-
Xcode 11.1
-
OpenGL 3.3
- GLAD
- glfw
- glew
- glTools
-
Other
- glm
Data Structures
-
Vectors.h
struct Vec2struct Vec3
-
Points.h
struct Vertex- A simple type of points with only position and normal data
- Used in rigid body (without texture or anything else)
class Node- Point with physical properties.
- Used in cloth.
- Execute collision detection actively.
-
Spring.h
class Spring
-
Cloth.h
class Cloth
-
Rigid.h -> Any rigid body without texture mapping
struct Groundclass Spherestruct Ball
-
Program.h -> Shader program built itself from .glsl files
class Program
-
Display.h -> Global camera, light & Renderers for cloth and rigid bodies
struct Camerastruct Lightstruct ClothRenderstruct SpringRenderstruct ClothSpringRenderstruct RigidRenderstruct GroundRenderstruct BallRender