https://github.com/couapy/raycasting
Raycasting implementations
https://github.com/couapy/raycasting
2d 3d java raycasting
Last synced: about 1 year ago
JSON representation
Raycasting implementations
- Host: GitHub
- URL: https://github.com/couapy/raycasting
- Owner: Couapy
- Created: 2021-02-19T11:01:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-19T11:29:37.000Z (over 5 years ago)
- Last Synced: 2023-03-08T22:26:41.094Z (over 3 years ago)
- Topics: 2d, 3d, java, raycasting
- Language: Java
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Raycasting
This is raycasting implementations.
## Preview



## Disclaimer
This project is only a draft and the code quality is bad.
## Implementations
There is two implementations :
* 2D with App.java
* 3D with App3D.java
If you launch the 3D app, 2D and 3D renderings will be launched with the same scene.
## How to use
There are some keybinding :
* `z` to move forward
* `s` to move backward
* `q` to move left
* `d` to move right
* `j` to look left
* `m` to look right
* `escape` to quit
## Map resources
The maps are defined by points, and segments (defined by two points);
To create a map, you must create points, then link the points to create walls.
> IMPORTANT: Add frame all around the map must be created.
There one line per point, segment or origin.
Point lines are defined by the following nomenclature :
```text
p:x;y
```
Segment line are defined by the following nomenclature :
```text
s:numberPoint1;numberPoint2
```
Origin is defined by the following nomenclature :
```text
o:x;y
```
For example :
```text
o:50;150
p:0;0
p:300;0
p:300;300
p:0;300
s:0;1
s:1;2
s:2;3
s:3;0
```
### Change loaded map
First you need to create a map as described above.
Then upload to the `maps` resource folder.
And finally, find and edit the line with `map = Map.fromFile("maps/map.txt");`.
## Special thanks
[Sight and light](https://ncase.me/sight-and-light/)