Skip to content

margual56/Raycasting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raycasting

A simple Raycasting project made in Java using the Processing core library.

raycasting

There are a couple bugs related to the world rotation of the 1st person camera... oh well. This was a sideproject and it is now abandoned.

Explanation

Here is a good Wikipedia article about the topic. To summarize, we have a series of rays projected from a point in all directions and onto walls, which then are processed as a function of the distance and angle to give the impression of depth. This project diverges and evolves from the Wikipedia article in that I don't use "cells", I use math to define the walls, so they can have any shape and resolution I want. For example, this code creates a wall of a random size, in a random location and at a random angle:

Wall wall = new Wall(random(width-1), random(height-1), random(width-1), random(height-1));

How to import into eclipse

Download processing from the Processing page and go into the folder where you extracted it. Then, "core > library > core.jar". You will need to add the core.jar into the external libraries of the project. After that, everything will work.

License

GNU GPLv3