How ijontan/minirt works
Main Components
• Scene/File Input: The project loads scene descriptions from “.rt” files (the rt_files directory) and textures from rt_files/textures.
• Parser Module: Under src_shared/parse, the various files indicate the conversion and validation of scene description files (checking floats, triplets, object lists, materials, etc.).
• Core Raytracing Engine:
– The src_shared/ray and src_shared/ray_tracing directories house initiation of rays and related intersection/calculation logic.
• Rendering Engine:
– The src_shared/render directory contains the drawing routines, pixel filling, and menu overlays to output the final image.
– The image creation and texture loading functionalities live under src_shared/image.
• Camera & Scene Management:
– The src_shared/camera module initializes and manages the camera’s properties and view, while the hooks in src_shared/hooks (keyboard, mouse, and loop actions) support interactive events to change view orientation, trigger animations, etc.
• Utility Modules:
Relationships and Data Flow
• The system starts with input from scene description files. These are parsed (src_shared/parse) to create internal representations of objects, materials, lights, and camera settings.
• The camera is then initialized (src_shared/camera), and the parsed scene information is used to configure the rendering pipeline.
• Event handling (src_shared/hooks) plays a role in providing interactive adjustments (e.g., camera movements, object updates) by interfacing with user inputs via keyboard and mouse hooks.
• The project ultimately leverages minilibx (from includes/minilibx_opengl) which provides the windowing and drawing capabilities.
Architectural Patterns and Design Principles
• A clear separation between core functionalities (parsing, raytracing, rendering) is visible, with common/shared code placed in src_shared.
• Two parallel “main” entry points exist (src_mandatory/main.c and src_bonus/main.c), suggesting a modular approach where additional features may be activated in the bonus version.
• There’s an MVC-like separation: the “Model” (scene description and objects), the “Controller” (hooks and input processing), and the “View” (rendering and image generation through minilibx).
Additional Details
• If necessary, denote submodules (like those in src_shared/hooks split into key actions, loop actions, and mouse actions) with nested blocks to capture their specific responsibilities.
• Use the Makefile as a cue that the overall build system coordinates these components – although you may not detail the build process, it can be noted as responsible for integrating the modules.