wip readme presentation
50
README.md
@@ -61,46 +61,32 @@ This technic has the hability to not show hidden area by design, which is a grea
|
||||
How it works :
|
||||
|
||||
1. first you determine the position and orientation of the viewer in the map, and the distance and width of the screen
|
||||
-> png map with eye and screen
|
||||
|
||||

|
||||
|
||||
2. then you will scan this fictif screen with rays, each ray will correspond to a column in the 3D view
|
||||
-> gif rays scanning, then columns simutanously appear on both side
|
||||
|
||||

|
||||
|
||||
3. when a ray reaches a wall, it draw it in the 3D view
|
||||
-> png one ray on close box
|
||||
|
||||

|
||||
|
||||
4. the height of the wall is inversely proportional to the length of the ray : the shorter the ray, the higher the wall
|
||||
-> png two rays, one for each box
|
||||
|
||||

|
||||
|
||||
5. so a full scan gives the illusion of perspective
|
||||
-> gif scan of the rays with fish eye
|
||||
|
||||

|
||||
|
||||
6. but this gives rounded walls, like a fish eye effect, because rays change length while scanning the wall, so we must apply a correction according to the angle
|
||||
-> gif scan with strait walls
|
||||
|
||||
---
|
||||
1. first you determine the position and orientation of the viewer in a plan,
|
||||

|
||||
|
||||

|
||||
7. another step by step example to show how drawing gains in precision with more rays :
|
||||
|
||||
2. then you cast a ray until it reaches a wall
|
||||
|
||||

|
||||
|
||||
3. you can now trace the vertical line on the 3D view
|
||||
|
||||

|
||||
|
||||
4. the height of the wall is inversely proportional to the length of the ray : the closer the wall, the heigher it is
|
||||
|
||||

|
||||
|
||||
5. finally, if the rays scan the whole picture, you see the perspective appears
|
||||
|
||||

|
||||
|
||||
6. but you can also see that walls are rounded, like a fish eye effect. It's because rays change length while scanning the wall, so we must apply a correction according to the angle
|
||||
|
||||

|
||||
|
||||
7. a more realistic step by step example looks like this :
|
||||
|
||||

|
||||

|
||||
|
||||
example of raycasting with errors in action while construction of the project :
|
||||
|
||||
|
||||
BIN
assets/raycast_1.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
assets/raycast_2.gif
Normal file
|
After Width: | Height: | Size: 234 KiB |
BIN
assets/raycast_3.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
assets/raycast_4.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
assets/raycast_5.gif
Normal file
|
After Width: | Height: | Size: 186 KiB |
BIN
assets/raycast_6.gif
Normal file
|
After Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 91 KiB |