This is a very simple 3 point perspective demonstration with a cube. 3 point perspective uses 3 points in a triangle and one point somewhere in the middle to create a 3D shape. this is simplified as much as possible however there is some semi-complicated math. I couldn't figure out the formula by myself AND make it work in scratch because I couldn't figure out how to do a systems of equations off of paper so I got a line-line intersection equation off of Wikipedia ---------------------------------------------------------------https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection --------------------------------------------------------------- I used the '''Given two points on each line segment''' section because this formula finds the point on the inside of the two line segments and not just anywhere on an infinite line. Here is the equation used to find intercepts. --------------------------------------------------------------- T = (((x1)(x3)) - ((y3)(y4)) * ((y1)(y3)) - ((x3)(x4))) / (((x1)(x2)) - ((y3)(y4)) * ((y1)(y2)) - ((x3)(x4))) x = x1 + T(x2 - x1) x = y1 + T(y2 - y1) This is just a demonstration and meant to be as easy as possible to understand, so there isn't much optimization. and no shortcuts are used to lower block count or decrease the amount of sprites
intercept of two lines given 4 points from Wikipedia everything else by me https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection