**Welcome to 3D Matrix** This innovative project showcases a fully functional mathematical Perspective 3D Engine developed from scratch in Scratch, avoiding conventional 2D shortcuts like raycasting or simple maze algorithms. Unlike traditional raycasting engines like Wolfenstein 3D, which limit player movement to static environments, this engine utilizes spatial coordinate geometry, trigonometric matrices, and real-time wireframe graphics rendered via the Pen extension. ### Key Features of the Engine: 1. **NOCLIP Flight Mode**: - One of the standout features is the NOCLIP flight mode, allowing users to pass through obstacles, facilitating seamless exploration in a 3D space where players can freely navigate across the X, Y, and Z axes. ### Engine Architecture The architecture of the 3D Matrix engine consists of three primary components designed to optimize performance: 1. **Data-Driven Programming**: - To minimize rendering lag, the world map is organized in global lists (`World_X`, `World_Y`, `World_Z`). This structure loads data only once, enabling efficient access and smooth gameplay by managing complex obstacle layouts without overloading the processor. 2. **3D Rotation and Perspective Projection**: - Central to the engine's operation is the `CalculatePosition` block. It manages all vertex calculations without screen refresh, incorporating: - **Y-Axis Rotation**: Adjusts the view left and right using trigonometric functions based on `Rot_Y`. - **X-Axis Rotation**: Allows natural up and down movement through a temporary variable (`Temp_Z`) that mitigates harsh visual shifts. - **Perspective Projection**: Converts 3D coordinates to 2D viewport coordinates, scaling objects based on their depth. 3. **Advanced Z-Clipping and Glitch Prevention**: - To tackle clipping issues, a temporary list (`Screen_Z_List`) tracks Z-depth values. Lines are rendered only if both vertices have a Z-depth greater than 10, enhancing rendering quality and immersion. ### Controls and Matrix Navigation The controls provide an intuitive flying experience, separating camera orientation from movement: - **Right/Left Arrow**: Turn the camera view. - **Up/Down Arrow**: Look up or down, capped at 85 degrees to avoid flips. - **W Key**: Fly forward, scaling objects up for depth perception. - **S Key**: Fly backward, scaling objects down. - **E Key**: Move upward using NOCLIP mode. - **Q Key**: Move downward. - **1, 2, 3 Keys**: Switch between rendering matrices for Cubes, Triangles, and Diamonds. Through these integrated features, the 3D Matrix project aims to deliver an immersive experience, highlighting the capabilities of 3D programming in Scratch without the usual limitations. ⚠️ PLAY WITH 60 FPS (NO LAG) ⚠️ Scratch's default player runs this heavy 3D engine slowly. For a perfectly smooth, high-performance experience, please copy and paste this link into your browser: https://turbowarp.org/1374862153