Skip to content

ArpanGyawali/Graphics_Everest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mount Everest Snow Visualization

Overview

This project renders a 3D Mount Everest model with a flowing snow particle system that simulates snowfall along the mountain's surface.

New Features

Snow Particle System

  • 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

Implementation Details

SnowParticle.h

  • SnowParticle struct: Stores individual particle data (position, velocity, lifetime, size, alpha)
  • SnowSystem class: 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

Pipeline Integration

  • 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

Controls

Camera Movement

  • 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

Lighting

  • R/F: Move light along X-axis
  • T/G: Move light along Y-axis
  • Y/H: Move light along Z-axis

Visualization

  • P: Toggle wireframe mode
  • N: Toggle snow particles ON/OFF
  • M: Toggle background texture mixing
  • 1/2/3: Switch background images
  • ESC: Exit application

Technical Architecture

Rendering Pipeline

  1. Geometry Processing: Load and transform Mount Everest mesh
  2. Lighting Calculation: Phong illumination model
  3. View Transformation: Camera matrix calculation
  4. Projection: Perspective projection to screen space
  5. Clipping: Near plane and screen edge clipping
  6. Rasterization: Triangle rasterization with texture mapping
  7. Particle Rendering: Transform and draw snow particles

Performance Optimizations

  • 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)

File Structure

Core Files

  • Pipeline.h: Main rendering pipeline with snow integration
  • SnowParticle.h: Snow particle system implementation
  • main.cpp: Application entry point and input handling
  • Light.h: Phong lighting calculations
  • DrawInterpolatedTriangle.h: Triangle rasterization
  • mesh.h: OBJ file loader
  • texLoad.h: Texture loading

Math Libraries

  • Vec3.h: 3D vector operations
  • Vec2.h: 2D vector operations
  • Mat4.h: 4x4 matrix transformations

Building and Running

Prerequisites

  • C++ compiler with C++11 support
  • OpenGL and GLUT libraries
  • stb_image library for texture loading

Compilation

g++ -o everest main.cpp -lGL -lGLU -lglut -lm

Running

./everest

Make sure the following files exist in the OBJFiles/ directory:

  • Everest7.obj - The 3D mesh model
  • Mount1.jpg - Texture for the mountain
  • back2.jpg, back3.jpg, back5.jpg - Background images (optional)

Customization

Adjusting Snow Behavior

In Pipeline.h constructor:

snowSystem(800)  // Change number of particles

In 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 speed

Adjusting Snow Appearance

In Pipeline::renderSnowParticles():

glPointSize(3.0f);  // Change particle size
glColor4f(1.0f, 1.0f, 1.0f, p.alpha * 0.8f);  // Adjust color/transparency

Known Limitations

  • Snow particles don't collide with the mesh surface
  • No wind direction control from user interface
  • Particle count affects performance on slower systems

Future Enhancements

  • 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)

Credits

  • 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

controls

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors