Skip to content

SarahiJLeura/SpaceSimulator-OpenGL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Space-Simulator-OpenGL

Final project for Computer Graphics β€” the goal of this project is to understand and implement the general pipeline of computer graphics, which includes modeling, animation (manipulation), rendering, and rasterization of 2D and 3D objects using OpenGL and FreeGLUT.

This project was built using Visual Studio and FreeGLUT 3.0.0.v140

Features

  • All objects are rendered without textures, using only RGB colors
  • Animate at least one object along a Bezier curve (parabolic motion)
  • Display Frames Per Second (FPS) directly on the main window (not the console), calculated manually (without built-in timing functions)
  • This OpenGL simulation allows real-time interaction through keyboard input:
    • Toggle lighting on/off
    • Rotate objects around their local axes
    • Apply different shading models:
      • Flat shading
      • Gouraud shading
      • No shading
    • Move the camera using a custom LookAt implementation
  • Object transformations:
    • Translation
    • Rotation

Project Structure

Space-Simulator-OpenGL/
β”‚
β”œβ”€β”€ proyectoGraf_Final/ # All class files and simulation resources
β”‚ β”œβ”€β”€ BezierCurve.{h,cpp} # Bezier curve implementation (WIP)
β”‚ β”œβ”€β”€ Camera.{h,cpp} # Camera movement and LookAt logic
β”‚ β”œβ”€β”€ Face.{h,cpp} # Object faces (triangular faces)
β”‚ β”œβ”€β”€ LightManagement.{h,cpp} # Light control and toggling
β”‚ β”œβ”€β”€ Matrix4x4.{h,cpp} # Matrix operations (transformations, inverses, transposes)
β”‚ β”œβ”€β”€ Model.{h,cpp} # Loads and parses .obj files
β”‚ β”œβ”€β”€ Vertex.{h,cpp} # Vertex/vector operations (normalize, dot, cross)
β”‚ β”œβ”€β”€ MathUtils.{h,cpp} # Helper functions (centroid, normal calculations, etc.)
β”‚ β”œβ”€β”€ simulation.obj # Collection of 3D models used in the simulation
β”‚ └── main.cpp # Main application loop and rendering logic
β”‚
β”œβ”€β”€ proyectoGraf_Final.sln # Visual Studio solution file
└── README.md # Project documentation


πŸ›  Requirements

  • C++
  • OpenGL
  • FreeGLUT 3.0.0
  • Visual Studio (tested on 2019+) Make sure FreeGLUT is properly installed and linked in your Visual Studio environment.

Simulation Preview

[πŸ”— Link to Simulation Video](#)


Known Limitations

  • BezierCurve class: The class structure exists, but movement along the Bezier curve is currently hardcoded using provided translation points.
  • Perspective matrix: Needs to be adjusted dynamically based on window resizing β€” currently leads to distortion when resizing the window.

Future Improvements

  • Apply textures to 3D models
  • Fully implement the BezierCurve class to compute interpolated points dynamically
  • Make the perspective matrix adaptive to window dimensions to maintain aspect ratio

Author

Patricia Sarahi Jimenez-Leura
December 2, 2024

License

MIT License

This project is for academic and educational purposes.

If you plan to use it commercially or extend it significantly, please provide credit.

About

A Simple Space Simulator in C++ using OPENGL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages