MiniRT

Cover Image for MiniRT
Amine Beihaqi
Amine Beihaqi

MiniRT

Introduction

Embarking on my coding school adventure, one project stood out as a thrilling exploration into the world of computer graphics and rendering—miniRT. As a novice coder, this project served as my initiation into the mesmerizing universe of Ray Tracing, challenging me to bring virtual scenes to life through code.

Unveiling the Beauty of Ray Tracing

Ray Tracing, a technique dating back to 1968, offers a unique approach to rendering three-dimensional images. Unlike the widely used Rasterization method, Ray Tracing excels in delivering a higher degree of visual realism. Although computationally expensive, the rewards are captivating, as demonstrated by the impressive images produced through this technique.

Introduction to miniRT

miniRT, my first Ray Tracer developed using miniLibX, catapulted me into the heart of Ray Tracing. This project aimed to demystify the process of rendering computer-generated images and instill confidence in handling mathematical formulas essential to this art.

Common Instructions

Before delving into the specifics of the project, adherence to common instructions became a cornerstone. From using the C language to managing memory and crafting an efficient Makefile, these instructions laid the groundwork for a project built on best practices.

The Mandatory Part - miniRT

miniRT tasked me with the challenge of generating images using the Raytracing protocol. The goal was clear: each image should represent a scene viewed from a particular angle and position. Geometric objects like planes, spheres, and cylinders would populate these scenes, illuminated by a carefully crafted lighting system.

The constraints were both challenging and instructive. Fluid window management, resizing without altering the scene, and handling different geometric objects with varying properties all demanded meticulous coding.

A sample scene description file in the .rt format looked something like this:

A 0.2 255,255,255
C -50.0,0,20 0,0,1 70
L -40.0,0.0,30.0 0.7 255,255,255
pl 0,0,0 0,1.0,0 255,0,225
sp 0,0,20 20 255,0,0
cy 50.0,0.0,20.6 0,0,1.0 14.2 21.42 10,0,255

Bonus Part - Elevating the Experience

As a coding enthusiast, the prospect of bonuses added an extra layer of excitement. While the mandatory part focused on the basics, the bonus part encouraged me to experiment with advanced features. Adding specular reflection, introducing color disruptions, incorporating colored and multi-spot lights—the possibilities were as expansive as the world of Ray Tracing itself.

Reflections and Shadows - Examples from miniRT

As the project progressed, the results became tangible. Scenes came to life with spheres, planes, and intricate lighting scenarios. Here are glimpses of some captivating examples:

all objects scene

billiard scene

bump map scene

lollipop scene

multi-light scene

scene

A Milestone Achieved

Completing the miniRT project marks a significant milestone in my coding journey. From grappling with the basics of Ray Tracing to experimenting with advanced features, each step was a testament to my growth as a developer. miniRT not only honed my coding skills but also ignited a passion for the captivating world of computer graphics.

As I showcase this project on my portfolio, miniRT stands as a testament to my dedication, perseverance, and newfound expertise in the intricate art of Ray Tracing. The journey with miniRT was challenging, enlightening, and undeniably rewarding—a voyage into the fascinating realm where code transforms into captivating visual experiences.