Skip to content

emmonbear/3DViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

| Contributors | Forks | Stargazers | Issues | MIT License | LinkedIn |


Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact

About The Project

Appearance

The goal of this project is to implement a program for viewing 3D models in wireframe form (3D Viewer) in the C++ programming language. The models themselves are loaded from .obj files, which makes it possible to view them on the screen with the ability to rotate, scale and move.

  • The program is developed in the C++ standard language using the gcc compiler. Additional libraries and Qt modules are used;
  • The program code is located in the src folder;
  • The program and test build is configured using CMake, which is launched using Makefile with a standard set of targets for a GNU program: all, install, uninstall, clean, dvi, dist, tests. Installation is carried out in the bin folder in the repository root;
  • The program is developed in accordance with the principles of object-oriented programming. The following development patterns are used: Facade, Singleton, Strategy, MVC;
  • The code is written in accordance with Google Style;
  • The modules related to model loading and affine transformations are covered by unit tests;
  • The program displays only one model on the screen at a time;
  • The program allows you to:
    • Load a wireframe model from an obj file (supports only a list of vertices and surfaces);
    • Move the model a given distance relative to the X, Y, Z axes;
    • Rotate the model a given angle relative to its X, Y, Z axes;
    • Scale the model by a given value;
    • Perform affine transformations using the processor/video memory;
    • Set up the projection type (parallel and central);
    • Set up the edge type (none, solid, dotted), color and thickness;
    • Set up the vertex type (none, circle, square), color and size;
    • Choose a background color;
    • Save the resulting ("rendered") images to a file in the bmp and jpeg formats;
    • Record small "screencasts" - current user affine transformations of the loaded object into gif-animation (640x480, 10fps, 5s);
  • The program has a graphical user interface based on the GUI libraries Qt with API for C++.
  • The graphical user interface contains:
    • A button for selecting a file with a model and a field for entering/outputting its name;
    • A button for switching the affine transformation method (processor/video card);
    • A button for switching the projection;
    • Buttons for selecting the type, color and thickness of edges;
    • Buttons for selecting the type, color and size of vertices;
    • A button for selecting a background;
    • Buttons for saving an image and a screencast;
    • A wireframe model visualization area;
    • Sliders and input fields for moving the model;
    • Sliders and input fields for rotating the model;
    • Slider and input field for scaling the model;
  • Information about the loaded model - file name, number of vertices and edges.
  • Settings are saved between program restarts;
  • Implementation class inside the s21 namespace;

UML class diagram

Appearance

(back to top)

Built With

(back to top)

Getting Started

To get a local copy and run it, follow these steps.

Required software

  • CMake

    sudo apt install cmake
    
  • Qt

    sudo apt install qt6-base-dev
    
  • OpenGL

    sudo apt-get install build-essential libgl1-mesa-dev
    

Installation

  1. Install the required software (if missing)
  2. Clone the repository
    git clone [email protected]:emmonbear/3DViewer.git
  3. Run the installation program
    make install
  4. Run the program manually (3DViewer/bin/viewer) or enter the command
    make run
    

(back to top)

Contributing:

contrib.rocks image

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Pervin Gabilov - Telegram / e-mail

Ilya Moskalev - Telegram / e-mail

(back to top)

About

Implementation of 3DViewer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •