Coder Social home page Coder Social logo

tjensen42 / 42-minirt Goto Github PK

View Code? Open in Web Editor NEW
30.0 1.0 1.0 307.88 MB

This 42 project is an introduction to the beautiful world of Raytracing.

Makefile 0.95% C 89.03% C++ 6.84% GLSL 0.14% Batchfile 0.20% Shell 0.18% Python 1.34% Objective-C 1.32%
42cursus minirt raytracer raytracing

42-minirt's Introduction

42-miniRT

42-logo

This 42 project is an introduction to the beautiful world of Raytracing. It is one of the group projects in the 42 core curriculum.
Done by: hepple42 & tjensen42

Working on this project, we have noticed more and more interesting optical effects in everyday life and were constantly thinking about possible implementation in our RayTracer. Once the basic principle was implemented, it was fun to add more and more objects and functionalities. We were especially excited about implementing relatively fundamental physical laws in code.

An excellent source on raytracing which helped us a lot is Ray Tracing in One Weekend series of books by Peter Shirley. It is a really detailed step-by-step guide for implementing a path-tracer in C++.


How to use it

The only supported and tested operating systems are macOS and Ubuntu 20.04.

For Ubuntu it is necessary to install the GLFW library first:

sudo apt-get update && \
sudo apt-get install libglfw3 && \
sudo apt-get install libglfw3-dev

Compile and run miniRT in 3 simple steps:

  1. git clone --depth 1 https://github.com/tjensen42/42-miniRT miniRT
  2. cd miniRT && make
  3. ./miniRT scenes/template.rt

Scenes

Example: Template

Identifier Description Identifier Description
R Resolution ls Light sphere
S Sampling specifications ld Light disc
B Background lr Light rectangle
A Ambient light tx Texture
C Camera pl Plane
sp Sphere
cy Cylinder
tb Tube
di Disc
rt Rectangle
cu Cuboid

Samples

Screen Shot 2022-05-27 at 12 25 43 PM

777

135

6000

template

Screen Shot 2022-05-31 at 10 50 14 AM

Screen Shot 2022-06-07 at 2 56 40 PM

600

random-42-color

rgb-color



*This 42 project is written in C and in accordance to the 42 school norm.

Sample restrictions:

  • All variables have to be declared and aligned at the top of each function
  • Each function can not have more then 25 lines
  • Projects should be created with allowed std functions otherwise it is cheating

42-minirt's People

Contributors

tjensen42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hepple42

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.