GithubHelp home page GithubHelp logo

josephcheel / 42-minirt Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 60.18 MB

This project is an introduction to the beautiful world of Raytracing. Once completed you will be able to render simple Computer-Generated-Images

Makefile 5.18% C 94.82%
3d-graphics 42-minirt c makefile phong-lighting raytracing 42 42cursus 42minirt 42projects

42-minirt's Introduction

MiniRT |  42 Cursus Complete

A project on Ray-Tracing and rendering three-dimensional computer-generated images. Using MiniLibX, the 42 graphical library.

Caution

If you need more technical info, go check our Github-Wiki

What is the project about

MiniRT is a project that introduces the basics of Ray tracing, focusing on 3D computer-generated images from a configuration file. It includes ambient light, lights, camera, and three geometrical figures (Plane, Sphere, Cylinder). The bonus part introduces multiple lights, cones as a geometrical figure, and additional elements.

General Instrucctions

  • Makefile will compile your source files. It must include 'all' and 'bonus' rules for the Mandatory and Bonus parts, respectively. It should not relink.
  • You are required to use MiniLibX for this project.
  • The program should be compiled using the following commands:
> ./miniRT <filename>.rt
> ./miniRT_bonus <filename>.rt

Warning

Maps must have the .rt extension

Mandatory Instrucctions

Configuration file has three mandatory elements: Camera, Light and Ambient Light. And three optional geomtrical figures: Plane, Sphere, Cylinder. Each element has the following identifier:

Name Identifier Name Identifier
Ambient Light A Plane pl
Camera C Sphere sp
Light L Cylinder cy

Keyboard Commands

Displacement Camera

  • MAC Option ⌥ + Right Clickand swip with the mouse
  • LINUX Alt + Left Click and swip with the mouse

Zoom Camera

  • MAC Option ⌥ + Mouse Wheel
  • LINUX Alt + Mouse Wheel

Rotation Camera

  • Shift ⇧ + Left Click and swip with the mouse

Displacement Light

  • Ctrl ^

Reset settings

  • R Reset Camera Position
  • L Reset Light Position

File configuration

Mandatory Elements
  • Ambient Light: Ambient light line
    • Identifier: A
    • Ambient lighting ratio in range [0.0,1.0]: 0.2
    • Colors in RGB in range [0-255]: 255, 255, 255
  • Camera Camera line
    • Identifier: C
    • XYZ coordinates of the view point: 60,0,0
    • 3D normalized orientation vector. In range [-1,1] for each x,y,z axis: 1.0,0.0,0.0
    • FOV : Horizontal field of view in degrees in range [0,180]: 170
  • Light Light line
    • Identifier: L
    • XYZ coordinates of the light point: 90,50,70
    • The light brightness ratio in range [0.0,1.0]: 0.7
    • (unused in mandatory part)R,G,B colors in range [0-255]: 255, 255, 255
Optional Elements
  • Plane Plane line
    • Identifier: pl
    • XYZ coordinates of a point in the plane: 0.0,0.0,-500.0
    • 3D normalized vector. In range [-1,1] for each x,y,z axis: -1.0,1.0,1.0
    • Colors in RGB in range [0-255]: 0,0,225
  • Sphere Sphere line
    • Identifier: sp
    • XYZ coordinates of the sphere center: 90,0.0,0.0
    • Diameter: 60
    • Colors in RGB in range [0-255]: 0, 0, 255
  • Cylinder Cylinder line
    • Identifier: cy
    • XYZ coordinates of the center of the cylinder: 90.0,0.0,0.0
    • 3D normalized vector of axis of cylinder. In range [-1,1] for each x,y,z axis: 0.0,1,1.0
    • Diameter: 30
    • Height: 210.42
    • Colors in RGB in range [0,255]: 0, 0, 255

Bonus Instrucctions

Resources

42-minirt's People

Contributors

ernestoavedillo avatar josephcheel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

ernestoavedillo

42-minirt's Issues

Check For min and max values and display an error

Ambient Light:
ratio range [0.0,1.0];
RGB ratio[0-255]
Camera
Normalized Orientation: [-1,1]
FOV: [0,180]
Light
brightness ratio[0.0,1.0]
RGB ratio[0-255]
Sphere
RGB ratio[0-255]
Plane
normal vector range [-1,1]
RGB ratio[0-255]
Cylinder
3d normal vector range [-1,1]
RGB ratio[0-255]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.