raja-moukhass / RTV1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Dependencies Dependencies GitHub Issues Contributions welcome License

                   

RTV1

  • This mini-project is the first step to create a Raytracing program, for you to finally be able to render computer-generated images.

Functionalities:

  • The program traces rays from one camera to n objects, the objects have shading and cast shadows on each other based the position of a single source of light.
  • RTv1 takes as input a custom file format based on comma separated values (examples found in the scenes folder), from the file it can get these informations:
    • camera (location and direction);
    • light (location);
    • objects:
      • sphere (color, location and radius);
      • cylinder (color, location, axis and radius);
      • cone (color, location, axis and angle);
      • plane (color, normal and distance from 0,0,0);

Installation

To generate an executable for this project run make in the root of the project directory after you've downloaded or cloned it.

This project will only work on MacOS El Capitan/Sierra/HighSierra and even then, no promises!

how to run the project

Run the following commands:

  • To compile
    • make
  • To remove objects:
    • make clean
  • To remove objects and binary file (program):
    • make fclean
  • To re-compile:
    • make re

Challenges

this program was created without much help from standard libraries, these are all the standard function used:

  • open
  • read
  • write
  • malloc
  • free
  • math:
    • sin()
    • cos()
    • pow()
  • mlx graphic library:
    • to create a window
    • use keyboard input

Parsing file format

Under the construction

Camere

camera <look from> <look at>  

light

light <position> <color> 

Sphere

sphere <position> <translation> <rotation> <color> <raduis>

Plane

plane <position> <translation> <rotation> <color> <norme>

Cylindre

cylindre <position>  <translation> <rotation> <color> <raduis> <axis>

Cone

cone <position>  <translation> <rotation> <color> <raduis> <axis>

screenshots

  • screen1

  • screen2

  • screen3

  • screen4

  • screen5

Resources :

About


Languages

Language:C 95.5%Language:Makefile 4.5%