This project renders a 3D Mount Everest model with a flowing snow particle system that simulates snowfall along the mountain's surface.
- 800 animated particles that simulate falling snow
- Particles flow downward with realistic gravity and wind effects
- Smooth fade-in/fade-out effects for natural appearance
- Configurable emission center and radius
- Real-time updates based on delta time
SnowParticlestruct: Stores individual particle data (position, velocity, lifetime, size, alpha)SnowSystemclass: Manages the entire particle system- Initializes particles with random properties
- Updates particle positions and lifetimes each frame
- Adds wind effect for horizontal drift
- Automatically respawns particles when they expire
- Snow particles are transformed through the same view and projection matrices as the mesh
- Particles are rendered after the mesh to appear on top
- Uses OpenGL blending for semi-transparent particles
- Performs frustum culling to skip off-screen particles
- W/S: Move camera forward/backward
- A/D: Rotate camera left/right
- Arrow Keys: Pan camera up/down/left/right
- Z/X: Rotate around X-axis
- C/V: Rotate around Y-axis
- R/F: Move light along X-axis
- T/G: Move light along Y-axis
- Y/H: Move light along Z-axis
- P: Toggle wireframe mode
- N: Toggle snow particles ON/OFF
- M: Toggle background texture mixing
- 1/2/3: Switch background images
- ESC: Exit application
- Geometry Processing: Load and transform Mount Everest mesh
- Lighting Calculation: Phong illumination model
- View Transformation: Camera matrix calculation
- Projection: Perspective projection to screen space
- Clipping: Near plane and screen edge clipping
- Rasterization: Triangle rasterization with texture mapping
- Particle Rendering: Transform and draw snow particles
- Particles only rendered when visible (frustum culling)
- Efficient particle updates using delta time
- Z-sorting for correct depth ordering
- Reuses particle memory (no dynamic allocation per frame)
Pipeline.h: Main rendering pipeline with snow integrationSnowParticle.h: Snow particle system implementationmain.cpp: Application entry point and input handlingLight.h: Phong lighting calculationsDrawInterpolatedTriangle.h: Triangle rasterizationmesh.h: OBJ file loadertexLoad.h: Texture loading
Vec3.h: 3D vector operationsVec2.h: 2D vector operationsMat4.h: 4x4 matrix transformations
- C++ compiler with C++11 support
- OpenGL and GLUT libraries
- stb_image library for texture loading
g++ -o everest main.cpp -lGL -lGLU -lglut -lm./everestMake sure the following files exist in the OBJFiles/ directory:
Everest7.obj- The 3D mesh modelMount1.jpg- Texture for the mountainback2.jpg,back3.jpg,back5.jpg- Background images (optional)
In Pipeline.h constructor:
snowSystem(800) // Change number of particlesIn SnowParticle.h:
emissionRadius(50.0f) // Change spread of snow emission
maxLifetime = randomFloat(3.0f, 7.0f) // Adjust particle lifetime
velocity.y = randomFloat(-8.0f, -4.0f) // Change fall speedIn Pipeline::renderSnowParticles():
glPointSize(3.0f); // Change particle size
glColor4f(1.0f, 1.0f, 1.0f, p.alpha * 0.8f); // Adjust color/transparency- Snow particles don't collide with the mesh surface
- No wind direction control from user interface
- Particle count affects performance on slower systems
- Surface-aligned particle flow
- Particle collision with mesh geometry
- Trail effects for particles
- Dynamic wind control
- Accumulation of snow on surface
- Different particle shapes (sprites instead of points)
- 3D graphics pipeline based on software rasterization techniques
- Snow particle system inspired by classical particle effects
- Phong lighting model for realistic illumination
Controls
Used c++ and glut
