Hooray! Rotation finally works! The problem was in the rotation functions and how they dealt with having multiple variables. For example, say there is a rotation function changing Y and Z coordinates to rotate points around the X axis. While Y was calculated with the old Y and old Z coordinates (correct), Z was calculated with the new Y and old Z coordinates (incorrect), leading to distortion when rotating. (No instructions)
Credits: @MathMathMath for his rotation scripts @Ayarkay for the quadrilateral filler (repurposed as a triangle fill) @chiru3 for everything else Notes: After the failure of the first filled 3D engine, I have decided to make another one, this time with different workings. This is part 6, which is the full engine except there is no shading. How it works: 1) It finds the distances to each triangle in the scene and sorts them by distance (Painter's algorithm) 2) For each triangle: 2a) It initializes the triangle in 3D space. 2b) The triangle is moved such that the player is at the center. 2c) The triangle is rotated such that the player's view is directly into the Z axis. 2d) The triangle is clipped so only visible parts are drawn. 2e) The resulting shape is projected onto the XY plane. 2f) The triangle is drawn to the screen. Notes: The previous one was around 1000 blocks (and didn't work), but this one is around 700 blocks so far (and works).