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 .comWas ist PlayCanvas eigentlich?
Es ist eine JavaScript-Bibliothek, die speziell für den Aufbau von Videospielen entwickelt. Es implementiert alle wichtigen Komponenten wie:
- Graphics: model loading, per-pixel lighting, shadow mapping, post effects
- Physics: rigid body simulation, ray casting, joints, trigger volumes, vehicles
- Animation: keyframing, skeletal blending, skinning
- Audio engine: 2D and 3D audio sources
- Input devices: mouse, keyboard, touch and gamepad support
- Entity-component system: high level game object management
Weiter Links:
Samples, API Referenze, Developer Resources, Anleitungen