Finished raymarcher -- https://scratch.mit.edu/projects/397929034/ As some of you might know already, I'm currently working on a 3d raymarcher! This (from what I know about raymarchers now) is kind of what goes on in one. -Arrow keys if using manual controls There's some helpful comments inside but here's a quick rundown: Instead of moving 1 step forward each time (which is really inefficient) and determining if touching an object each time, raymarching finds the distance to all objects, and moves the maximum number of steps you know is safe because all the object distances are higher than that value (so you can't end up in an object). Then it determines if you are touching the object by whether the distance to the object is below a certain amount (I decided on 1 for this purpose). The circles are there as a visual aid, as it shows which object is nearest because the edge of the circle should be touching the nearest object. The bigger the circle, the further the ray moves. Plus it looks cool :P
@dadofmrlog for the tri-filler used for the squares @kouzone for inspiration and calculating the distance to these simple shapes (I had to convert it into 2d) Made for #ray #madness . Try using manual controls! Could this be used for a FASTER raycasting algorithm? It doesn't rely on sprite collisions to determine if touching objects and is a lot faster than moving 1 step so...? The collision on walls for manual controls also relies on checking how far walls are away so...? Tags: #raymarching #raycaster #raycasting #conceptual #concept #tutorial #tutorials