Skip to content

Xovesh/OpenGL-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OpenGL project

Created a 3D engine using OpenGL

Contents

  1. Compilation and execution
  2. Pictures
  3. Controls

Compilation

If you want to compile it by yourself

Requirements

sudo apt-get update
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt-get install libgtk-3-dev

GCC

gcc *.c -lGL -lGLU -lglut -lm `pkg-config --libs --cflags gtk+-3.0` -lpthread -rdynamic -o output

Otherwise

Execution

./output

Pictures

GUI

Screenshot

Adding a new object to the scene.

Screenshot

Changing the static scenary

Screenshot

Create a new Camera.

Screenshot

Changing the ilumination.

Screenshot

Help (Spanish) English translation in GitHub (https://github.com/Xovesh/OpenGL-project).

Without ilumination

Screenshot

General scene with some objects (Orange selected object) (Using wireframe and solid renderization).

Screenshot

General scene using only wireframe renderization.

Screenshot

General scene using only solid renderization.

Screenshot

General scene using solid and wireframe renderization.

Screenshot

Scene with 120k polygons.

Screenshot

Menu to load a object fast (RMB).

Screenshot

Scene with objects in different position, rotated and different scale.

With ilumination

Screenshot

Comparison between sun and point(bulb) lights.

Screenshot

Comparison between flat and smooth shading.

Screenshot

Using two lights (Different diffuse color).

Screenshot

Using two suns (Different diffuse color).

Screenshot

Desert scene using camera sportlight.

Screenshot

Scene with some objects using lights.

Screenshot

Desert scene using a sun and a spotlight.

Screenshot

Camera spotlight with reduce opening angle.

Controls (Spanish version within the project)

Extended version of the control list.

English

General Options

<ESC> Exit the application

<?> Shows the control list in the terminal

<RMB> Load a object

Manipulation mode

<O/o> Object Mode

<K/k> Camera Mode

<A/a> Ilumination Mode

Transformation mode

Over the selected object/camara/ilumination

<M/m> Translation Mode

<B/b> Rotation mode

<T/t> Scale mode

<V/v> Speed mode

Object manipulation

<F/f> Loads a object from a path (terminal)

<Ctrl + Z> Undo last transformation

<TAB> Selects the next object in the list

<supr> Deletes the selected object

<L/l> Activates the local mode (Using objects reference system).

<G/g> Activar the global mode (Using global reference system).

<LEFT> Translates: -X; Scale: -X; Rotate: -Y.

<RIGHT> Translates: +X; Scale: +X; Rotate: +Y.

<UP> Translates: +Y; Scale: +Y; Rotate: +X.

<DOWN> Translates: -Y; Scale: -Y; Rotate: -X.

<AvPag> Translates: +Z; Scale: +Z; Rotate: +Z.

<RePag> Translates: -Z; Scale: -Z; Rotate: -Z.

<+> Scales the object in all directions (positive scale "Bigger")

<-> Scales the object in all directions (negative scale "Smaller").

<Enter> Change the speed of the selected object to 0.

<R/r> Translates the object to the point X=0; Y=0; Z=0.

Camera manipulation

<F/f> Loads a new camera given the position vector, attention point and vertical vector.

<c> Selects a the next camera in the list.

<C> Creates a new camera that follows the selected object.

<P/p> Changes the perspective mode between orthogonal and perspective.

<L/l> Activates the local mode.

<G/g> Analysis mode over the selected object.

<LEFT> Translates: -X; Volume: -X; Rotate: -Y.

<RIGHT> Translates: +X; Volume: +X; Rotate: +Y.

<UP> Translates: +Y; Volume: +Y; Rotate: +X.

<DOWN> Translates: -Y; Volume: -Y; Rotate: -X.

<AvPag> Translates: +Z; Volume: +near, + far; Rotate: +Z.

<RePag> Translates: -Z; Volume: -near, + far; Rotate: -Z.

<+> Positive zoom.

<-> Negative zoom.

Ilumination manipulation

<0> Changes the ilumination type between sun and spotlight.

<1-8> Selects the corresponding light.

<F1-F8> ON/OFF selected light

<F9> ON/OFF Ilumination mode

<F12> Changes the shade mode between flat and smooth

<LEFT> Translates: -X; Rotate: -Y.

<RIGHT> Translates: +X; Rotate: +Y.

<UP> Translates: +Y; Rotate: +X.

<DOWN> Translates: -Y; Rotate: -X.

<AvPag> Translates: +Z; Rotate: +Z.

<RePag> Translates: -Z; Rotate: -Z.

<+> Increases opening angle (only spotlight).

<-> Decreases opening angle (only spotlight).

Others

<Q/q> Show/hide scene

<Z/z> Alternate between solid/wireframe/both render

<U/u> Loads the default object (check config.toml)

<S/s> Shoots a projectile. (only works in "./abioia.obj" object)

<"<"> Increases the width of the lines.

<">"> Reduces the width of lines.

<LMB> Moves the camera to left/right and top/bottom.

<MMB> Rotates the camera over the point X=0; Y=0; Z=0.

<Scroll> In camera mode: Move forward/backward. In object mode: Scale the object.

<Ctrl + Scroll> Increases/reduces the sensibility of the mouse.

<Ctrl + MMB> Rotates the camera in local mode.

About

Created a 3D engine using OpenGL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages