Created a 3D engine using OpenGL
- Compilation and execution
- Pictures
- Controls
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
Adding a new object to the scene.
Changing the static scenary
Create a new Camera.
Changing the ilumination.
Help (Spanish) English translation in GitHub (https://github.com/Xovesh/OpenGL-project).
General scene with some objects (Orange selected object) (Using wireframe and solid renderization).
General scene using only wireframe renderization.
General scene using only solid renderization.
General scene using solid and wireframe renderization.
Scene with 120k polygons.
Menu to load a object fast (RMB).
Scene with objects in different position, rotated and different scale.
Comparison between sun and point(bulb) lights.
Comparison between flat and smooth shading.
Using two lights (Different diffuse color).
Using two suns (Different diffuse color).
Desert scene using camera sportlight.
Scene with some objects using lights.
Desert scene using a sun and a spotlight.
Camera spotlight with reduce opening angle.
Extended version of the control list.
<ESC> Exit the application
<?> Shows the control list in the terminal
<RMB> Load a object
<O/o> Object Mode
<K/k> Camera Mode
<A/a> Ilumination Mode
Over the selected object/camara/ilumination
<M/m> Translation Mode
<B/b> Rotation mode
<T/t> Scale mode
<V/v> Speed mode
<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.
<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.
<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).
<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.