USE TURBOWARP FOR BEST PERFORMANCE: https://turbowarp.org/1338314329 This is a real-time 3D rendering experiment built in Scratch that simulates a shaded sphere using ray–surface intersection and basic lighting, all drawn through pen stamping. The project creates a simple 3D scene with a fixed camera, a movable sphere, and a dynamic light source that orbits over time. When the green flag is pressed, the renderer initializes resolution settings, clears the canvas, and prepares the sprite scaling for different rendering densities. A second initialization loop sets up the scene: the camera is placed in 3D space, a sphere is positioned at the origin with a defined radius, and a light source begins orbiting the scene. The player can interactively move the sphere using the arrow keys for X and Y movement and W/S keys for forward and backward motion along the Z axis. This makes the sphere feel like it is being manipulated inside a 3D environment. The core of the project is a custom ray tracing renderer. Each frame, the screen is sampled in a grid, and rays are cast from the camera through each pixel position. The code solves the mathematical ray–sphere intersection equation to determine whether each ray hits the sphere. If no intersection occurs, the pixel is drawn as empty space. If a hit is found, the exact collision point is calculated, and a surface normal is generated. Lighting is then applied using a Lambert shading model: a directional light vector is computed and normalized, and its alignment with the surface normal determines brightness. This creates smooth gradient shading across the sphere that responds dynamically as the object moves and the light rotates. Finally, the sprite stamps each computed pixel using pen operations, building up a low-resolution but recognizable 3D image in real time. Overall, this project demonstrates how core 3D graphics concepts—ray tracing, vector normalization, and lighting—can be implemented entirely within Scratch to produce an interactive 3D rendering system.