https://github.com/fytex/graphicengine
Created in C++ (OpenGL) with spacial movement and a Solar System as an example. Contains both the engine and generator.
https://github.com/fytex/graphicengine
Last synced: 8 months ago
JSON representation
Created in C++ (OpenGL) with spacial movement and a Solar System as an example. Contains both the engine and generator.
- Host: GitHub
- URL: https://github.com/fytex/graphicengine
- Owner: Fytex
- License: mit
- Created: 2022-06-10T11:41:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-12T21:01:30.000Z (over 3 years ago)
- Last Synced: 2025-01-11T07:47:51.840Z (9 months ago)
- Language: C
- Homepage:
- Size: 8.91 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GraphicEngine

Graphic Engine and Model Generator made in C++ with spacial movement.
The engine uses OpenGl to render 3D models, i.e, models of points that describe triangles.
The generator creates some basic primitives:
- Plane
- Box
- Cone
- Sphere
- Bezier
- Torus## Engine
As refered before, the engine uses OpenGL to render a scene, it also applies transformations, textures, normals and lights. These are passed in a XML file passed by argument to the engine, that follows a syntax that can be found in the *xml_syntax* file.
To run the executable you must provide the xml as an argument and have all the files (from generator) and textures (if using) in the respective folder.
Functionalities:
- UP Key - Longitudinal positive movement
- DOWN Key - Longitudinal negative movement
- RIGHT Key - Latitudinal positive movement
- LEFT Key - Latitudinal negative movement
- CTRL+UP Keys - Camera's approximation
- CTRL+DOWN Keys - Camera's disapproximation
- W Key - Foward movement
- S Key - Backward movement
- D Key - Movement to the right
- A Key - Movement to the left
- Mouse - Camera's view- Z Key - Change between different modes of drawing models (Fill, Lines,
Points)
- X Key - Show/Hide axis X, Y and Z and movement trajectories
- ESC Key - Free's user from application
## Generator
The generator creates 2 files, one containing the points of the triangles and the respective normals, and the other file has the points for the textures.
To create a different model with bezier it's recommended to read *README.md* in *bezier_info*'s folder. *Teapot*'s patch is already provided as an example.
### Plane
`./generator plane size divisions outFile`Ex: `./generator plane 1 3 plane.3d`
### Box
`./generator box size divisions outFile`
Ex: `./generator box 1 3 box.3d`
### Cone
`./generator cone radius height slices stacks outFile`
Ex: `./generator cone 1 2 10 10 cone.3d`
### Sphere
`./generator sphere radius slices stacks outFile`
Ex: `./generator sphere 1 10 10 sphere.3d`
### Bezier
`./generator bezier inFile level outFile`
Ex: `./generator bezier teapot.patch 64 bezier.3d`
### Torus
`./generator torus outterRadius innerRadius slices stacks outFile`
Ex: `./generator torus 2.4 2.2 20 20 torus.3d`