Skip to content

pili01/grafika

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2D Graphics Project - Island Scene with Sharks

A 2D graphics project created with OpenGL, featuring an interactive island scene with dynamic lighting, animated sharks, and various visual effects. This project was developed as part of a Computer Graphics course.

Features

2D Scene Elements

  • Island - Textured terrain with sand textures
  • Water - Animated water surface with adjustable transparency
  • Sun & Moon - Dynamic day/night cycle with realistic movement
  • Stars - 200 randomly positioned stars in the night sky
  • Clouds - Multiple animated clouds with varying speeds and directions
  • Sharks - Animated sharks swimming in the water with realistic movement
  • Fire & Smoke - Interactive fire effects with smoke animation
  • Sky - Background with textured environment

Interactive Features

  • Dynamic Day/Night Cycle - Time progression with sun and moon movement
  • Water Ripple Effect - Click on water to create expanding ripple circles
  • Shark Movement - Sharks swim to the clicked location on water
  • Fire Interaction - Click on fire to trigger smoke effects
  • Adjustable Time Speed - Control the speed of the day/night cycle using + and - keys
  • Water Transparency - Toggle water transparency for better visibility with B key

Technologies Used

  • OpenGL 3.3 - Core profile rendering
  • C++ - Programming language
  • GLFW 3.3.8 - Window and input handling
  • GLEW 2.2.0 - OpenGL extension loading
  • GLM 0.9.9.800 - Mathematics library for graphics
  • stb_image - Image loading for textures
  • Visual Studio 2019/2022 - Development environment

Building the Project

Prerequisites

  • Windows 10 or later
  • Visual Studio 2019 or later with C++ support
  • Graphics card with OpenGL 3.3 support

Build Steps

  1. Open the Solution

    • Open Sablon/Sablon.sln in Visual Studio
  2. Restore NuGet Packages

    • Right-click on the solution in Solution Explorer
    • Select "Restore NuGet Packages"
    • Wait for packages to download (GLFW, GLEW, GLM)
  3. Build the Project

    • Select configuration: Debug or Release
    • Select platform: x64
    • Build → Build Solution (or press Ctrl+Shift+B)
  4. Run the Application

    • Press F5 to run in debug mode
    • Or navigate to Sablon/x64/Debug/ and run Sablon.exe

Note

Ensure that all resource files in the res/ folder are present and that the executable runs from the Sablon/ directory (where shader files are located).

Controls

Rendering Options

  • B - Toggle water transparency

Time Control

  • + - Increase time speed
  • - - Decrease time speed

Mouse Interaction

  • Left Click on Fire - Trigger smoke effects
  • Left Click on Water - Create expanding ripple effect at click location and all sharks will swim to the clicked location

Other

  • ESC - Exit application

3D Version

Want to see this project in 3D? Check out the 3D version with enhanced features including first-person camera controls, 3D models, palm trees, airplane, and more dynamic effects:

👉 View 3D Graphics Project - Island Scene

Author

Duško Pilipović

Project created for Computer Graphics course, 7th Semester.

License

This project is created for educational purposes.

About

Repozitorijum za projekat iz racunarske grafike

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors