ScratchData LogoScratchData
Back to chooper-beta's profile

3D Engine Mk II Test (Z Buffer)

CHchooper-beta•Created June 27, 2016
3D Engine Mk II Test (Z Buffer)
88
67
1556 views
View on Scratch

Instructions

Up arrow Forwards Down arrow Backwards Left arrow Turn left (anti-clockwise) Right arrow Turn right (clockwise) SEE FULL VERSION: https://scratch.mit.edu/projects/115065611/

Description

This is the base for a completely re-written 3D engine :D My latest tests show that this new engine is 85% faster! How it works: Each shape is stored as a series of walls. Each wall has a start point, end point and an angle. First, we calculate the angle from the camera to the start and end points of the wall. Then, we calculate the distance from the camera to the start and end points of the wall. We can then use this information to calculate the distances between the camera and all the points along the wall (using the sine rule). The distances are stored in a list (the z buffer) and only the shortest distances ever gets stored for each angle. Thanks to @WO997 for a lot of helpful advice!

Project Details

Project ID114982210
CreatedJune 27, 2016
Last ModifiedJune 28, 2016
SharedJune 27, 2016
Visibilityvisible
CommentsAllowed