WASD to move and arrow keys to look. EQ to fly. Supports triangles, ellipses, and .obj files! Move cursor to left of the screen to change sliders Press R to export the scene (only solid color triangles) Pointerlock variable is for Turbowarp experiment only, ALWAYS HAVE THIS AT ZERO ON SCRATCH!! Because there is no z-clipping, it only renders the 3D triangle if all 3 points are in front of the camera. This both looks cool and can be very annoying. That is why the ground is rendered as a grid of squares instead of 1 square (I needed the ground to show up). Render sky variable options: 0 = don't render sky or ground 1 = render noon sky and ground 2 = render sunset and ground
Transform point, add 3D triangle, set pen color to RGB, calculate distances, and set p to xyz blocks are by @CodingBio. 3D projection blocks are by @finnagin5. The triangle filler was created by @-Rex-Test- and @Geotale. I looked at @CodingBio's engine to find how to detect points behind camera. @ggenije for the binary insertion sort. FPS counter inspired by the one in https://scratch.mit.edu/projects/422631818 by @Howtomakeausername. The rotation functions used are by @Steelix1000. The textured triangle filler is by @KryptoAlt I followed @CodingBio's tutorial for sorting here Big thanks to . CodingBio's tutorials on 3D really helped me learn about 3D, as well as looking at the code in the last demo in part 5 of the series (This helped with putting some blocks in). Backface culling uses matrices as I found here: https://math.stackexchange.com/questions/1324179/how-to-tell-if-3-connected-points-are-connected-clockwise-or-counter-clockwise The culling is run after the triangle is projected to the screen.