Skip to content

Sting Ray is a ray casting engine written in vanilla ES6 JavaScript using the HTML5 canvas. Ray casting was first popularized by Wolfenstein 3D developed by Id Software.

Notifications You must be signed in to change notification settings

matcodesalot/sting-ray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sting-Ray

Sting Ray screen shot

Sting Ray is an implementation of a raycaster written in JavaScript. Raycasting is a technique used to simulate 3D graphics by projecting rays based on a 2D plane. This method was first popularized by Wolfenstein 3D developed by Id Software in 1992.

How the Raycaster Works

The raycaster works by emitting rays from the players position towards walls in the scene. The DDA algorithm is used to optimize the ray projection process by using trigonometric functions. This enhances the performance and accuracy of the engine.

Getting Started

Please note since this project is importing/exporting multiple files, you will run into a CORS block if you try to run the index.html file locally. You will need to run this from a server to get everything running. If you are using vscode, a simple way to avoid this issue is to use the Live Server extension.

Controls

  • W or Arrow Up: move player forward

  • S or Arrow Down: move player backward

  • A or Arrow Left: rotate player left

  • D or Arrow Right: rotate player right

  • To run, hold down Left Shift while moving forward or backward

Credits

Acknowledgements

About

Sting Ray is a ray casting engine written in vanilla ES6 JavaScript using the HTML5 canvas. Ray casting was first popularized by Wolfenstein 3D developed by Id Software.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published