Install the necessary packages for MLX
To create the executable:
make
To unpack the scene files:
make get_resources
To run the program:
./miniRT <scene> <resolution>
Features:
- Use WASD to move around
- Use the arrow keys to change the viewing direction
- Change the field of view using '[' and ']'
- Press 'C' to get the current camera postion and direction
- Press 'Z' or 'X' to change the exposure
- Press 'R' to reload the scene (camera stays in current position)
- Press 'P' to export the current view as a .bmp file
Create a scene description file (e.g., scene.rt
) to define the objects, lights, and camera in the scene. Refer to the provided examples for syntax and available options.
# Example Scene Description
A 0.2 255,255,255 # Ambient light
C -50,0,20 0,0,1 70 # Camera
L -50,50,50 0.6 255,255,255 # Light
sp 0,0,0 20 255,0,0 # Sphere
pl 0,0,0 0,1,0 255,255,255 # Plane
cy 0,0,20 0,0,1 10 5 255,255,0 # Cylinder
tri 1.0,1.0,1.0 2.0,2.0,2.0 3.0,3.0,3.0 255,120,25 #Triangle
# This project is also able to parse triangulated OBJ files.
# To use them simply specify the file containing a mesh:
objfile *.obj
# And then use the mesh at a specified loation, rotation and size:
usemesh mesh 0,3.85,0 0,0,-1 0,-1,0 2