Skip to content

andymisu/3D-Interactive-Restaurant-Scene

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive 3D Restaurant Scene

A photorealistic 3D outdoor restaurant environment built with OpenGL and C++, featuring high-resolution shadow mapping, procedural wind animation, multi-source lighting, and comprehensive collision detection.

Overview

An immersive 3D garden restaurant scene with interactive navigation. The environment includes a restaurant house with 12 food presentation tables, each with individual spotlight illumination. Features animated trees with procedural wind shaders and a complete collision system.

Key Features

Advanced Rendering

  • High-resolution shadow mapping (16384×16384)
  • 12 individual spotlights with quadratic attenuation
  • Directional lighting with configurable rotation
  • Phong shading (ambient, diffuse, specular components)
  • Alpha testing for foliage transparency

Procedural Animation

  • Wind shader system using three combined sinusoidal waves
  • 31-frame door animation (50 FPS)
  • Synchronized shadow pass for animated elements

Interactive Elements

  • Food information posters (press R near tables)
  • Relaxation furniture interaction (press H to sit)
  • Animated door (press O to open/close)

Navigation & Physics

  • AABB collision detection for all objects
  • Free camera control with WASD + mouse
  • Pitch limiting to prevent gimbal lock
  • Infinite dynamic terrain with tile-based rendering

Technical Implementation

Graphics Pipeline

  • Model Matrix: object positioning/rotation/scaling
  • View Matrix: camera position/orientation
  • Projection Matrix: perspective (45° FOV, 0.1-100 clip planes)
  • Normal Matrix: inverse transpose for correct lighting

Shadow Mapping

  • Depth Pass: 16384×16384 framebuffer, orthographic projection
  • Rendering Pass: Shadow map comparison with 0.005 bias

Procedural Wind Algorithm

wave1 = sin(time×1.5 + pos.x×2.0 + pos.z×1.5) × 0.5
wave2 = sin(time×2.3 + pos.x×3.0) × 0.3
wave3 = cos(time×1.8 + pos.z×2.5) × 0.2
heightFactor = smoothstep(0.3, 1.0, vertexHeight)
windEffect = (wave1 + wave2 + wave3) × heightFactor × strength

Infinite Terrain System

  • Dynamic tile-based rendering (10×10 unit tiles)
  • Centered on camera position
  • Seamless texture alignment

Project Structure

restaurant-la-misu/
├── src/                # C++ source files
├── shaders/            # GLSL shaders
├── screenshots/        # Demonstration images
└── models/             # 3D models and materials (not included)

Setup

Prerequisites

  • Visual Studio 2019+
  • OpenGL 4.x compatible GPU
  • Windows 10/11

Installation

  1. Clone repository

    git clone https://github.com/andymisu/restaurant-la-misu.git
    cd restaurant-la-misu
  2. 3D Assets

    This repository does not include 3D models and materials (~1GB). Contact author for details.

  3. Build

    • Open .sln in Visual Studio
    • Build configuration: Release
    • Run (F5)

Controls

Camera

  • W/A/S/D: Movement
  • Mouse: Look around

Interactive

  • O: Open/close door
  • R: Display food poster (near table)
  • H: Sit in furniture (when nearby)
  • C: Print camera position

Visualization

  • 1: Solid mode
  • 2: Wireframe mode
  • 3: Points mode
  • ESC: Exit

Scene Description

  • Restaurant house with textured walls, animated door
  • 12 food presentation tables with individual spotlights
  • Paved pathway with 4K stone textures
  • 6 animated trees with procedural wind
  • Tropical plants (jasmine, coconut palms, bamboo)
  • Hedge fence perimeter
  • Skybox with Miramar cubemap
  • Infinite grass terrain

Author

Mihai Andrei Mărtinaș

Technologies

OpenGL, C++17, GLFW, GLAD, GLM, Assimp, stb_image

About

Built a photorealistic 3D environment with shadow mapping, procedural wind shaders for vegetation, multi source lighting system, collision detection, and dynamic terrain rendering.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors