ScratchData LogoScratchData
Back to ProdigyZeta7's profile

Raycaster Experiment

PRProdigyZeta7•Created February 9, 2014
Raycaster Experiment
43
23
914 views
View on Scratch

Instructions

Arrow keys to move and look Space key to show shadowmap

Description

I have no idea how to make a real raycaster, so I'm trying out something never before done and wow it works. No collisions yet. How it works: The main engine works just like any other raycaster, with a ray being "shot out" from the viewer for each column of pixels on screen. But instead of the usual "go here go there" kind of iterating, this calculates the intersection of that ray with a line between two points. That intersection must be tested to be 1) within range, 2) within view, and 3) within the boundaries of the line it intersected with. For each ray it checks every wall for an intersection, making sure each intersection is closer than the last. The upside is the FPS is constant; the downside is it gets more processing intensive the more lines are checked.

Project Details

Project ID17702758
CreatedFebruary 9, 2014
Last ModifiedFebruary 21, 2014
SharedFebruary 21, 2014
Visibilityvisible
CommentsAllowed