Startseite : Beiträge : programmierung : First-person engine in 265 lines

Mittwoch, 4. Juni 2014

Das Zauberwort heisst Raycasting und wurde bei Spielen wie Daggerfall und Duke Nukem 3D eingesetzt.

Here's the trick: a raycasting engine doesn't draw the whole scene at once. Instead, it divides the scene into independent columns and renders them one-by-one. Each column represents a single ray cast out from the player at a particular angle. If the ray hits a wall, it measures the distance to that wall and draws a rectangle in its column. The height of the rectangle is determined by the distance the ray traveled - more distant walls are drawn shorter.

http://www.playfuljs.com/a-first-person-engine-in-265-lines/ - Via reddit .com
Kategorie: programmierung

    anzeigen