diff --git a/README.md b/README.md index 5439a70..474be0e 100644 --- a/README.md +++ b/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 + +![map with viewer position](assets/raycast_1.png) + 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 + +![animation of rays scanning the map and creating columns in 3D view](assets/raycast_2.gif) + 3. when a ray reaches a wall, it draw it in the 3D view - -> png one ray on close box + +![example of one ray drawing one column with portion of wall](assets/raycast_3.png) + 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 + +![example of two rays drawing two columns with portion of different height walls](assets/raycast_4.png) + 5. so a full scan gives the illusion of perspective - -> gif scan of the rays with fish eye + +![animation of rays scanning the whole map and creating a 3D with fish eye deformation](assets/raycast_5.gif) + 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, +![animation of rays scanning the whole map and creating a 3D with fish eye correction](assets/raycast_6.gif) -![](assets/raycast_step1.png) +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 - -![](assets/raycast_step2.png) - -3. you can now trace the vertical line on the 3D view - -![](assets/raycast_step3.png) - -4. the height of the wall is inversely proportional to the length of the ray : the closer the wall, the heigher it is - -![](assets/raycast_step4.png) - -5. finally, if the rays scan the whole picture, you see the perspective appears - -![](assets/raycast_steps_round.gif) - -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 - -![](assets/raycast_steps.gif) - -7. a more realistic step by step example looks like this : - -![](assets/raycast_explanation.gif) +![animation of raytracing with increasing number of rays](assets/raycast_7.gif) example of raycasting with errors in action while construction of the project : diff --git a/assets/raycast_1.png b/assets/raycast_1.png new file mode 100644 index 0000000..ecc2224 Binary files /dev/null and b/assets/raycast_1.png differ diff --git a/assets/raycast_2.gif b/assets/raycast_2.gif new file mode 100644 index 0000000..a7f7577 Binary files /dev/null and b/assets/raycast_2.gif differ diff --git a/assets/raycast_3.png b/assets/raycast_3.png new file mode 100644 index 0000000..c8b5d1c Binary files /dev/null and b/assets/raycast_3.png differ diff --git a/assets/raycast_4.png b/assets/raycast_4.png new file mode 100644 index 0000000..032282b Binary files /dev/null and b/assets/raycast_4.png differ diff --git a/assets/raycast_5.gif b/assets/raycast_5.gif new file mode 100644 index 0000000..5aab70c Binary files /dev/null and b/assets/raycast_5.gif differ diff --git a/assets/raycast_6.gif b/assets/raycast_6.gif new file mode 100644 index 0000000..fa9055d Binary files /dev/null and b/assets/raycast_6.gif differ diff --git a/assets/raycast_explanation.gif b/assets/raycast_7.gif similarity index 100% rename from assets/raycast_explanation.gif rename to assets/raycast_7.gif diff --git a/assets/raycast_step1.png b/assets/raycast_step1.png deleted file mode 100644 index 2280480..0000000 Binary files a/assets/raycast_step1.png and /dev/null differ diff --git a/assets/raycast_step2.png b/assets/raycast_step2.png deleted file mode 100644 index 82b139c..0000000 Binary files a/assets/raycast_step2.png and /dev/null differ diff --git a/assets/raycast_step3.png b/assets/raycast_step3.png deleted file mode 100644 index 515fa44..0000000 Binary files a/assets/raycast_step3.png and /dev/null differ diff --git a/assets/raycast_step4.png b/assets/raycast_step4.png deleted file mode 100644 index 5b0af00..0000000 Binary files a/assets/raycast_step4.png and /dev/null differ diff --git a/assets/raycast_steps.gif b/assets/raycast_steps.gif deleted file mode 100644 index db583c6..0000000 Binary files a/assets/raycast_steps.gif and /dev/null differ diff --git a/assets/raycast_steps_round.gif b/assets/raycast_steps_round.gif deleted file mode 100644 index 3a0032c..0000000 Binary files a/assets/raycast_steps_round.gif and /dev/null differ diff --git a/assets/raycasting_construction_gif.xcf b/assets/raycasting_7_construction_gif.xcf similarity index 100% rename from assets/raycasting_construction_gif.xcf rename to assets/raycasting_7_construction_gif.xcf diff --git a/assets/raycasting_explanation.xcf b/assets/raycasting_7_explanation.xcf similarity index 100% rename from assets/raycasting_explanation.xcf rename to assets/raycasting_7_explanation.xcf diff --git a/assets/raycasting_steps_2_gif.xcf b/assets/raycasting_steps_2_gif.xcf new file mode 100644 index 0000000..abd68a0 Binary files /dev/null and b/assets/raycasting_steps_2_gif.xcf differ diff --git a/assets/raycasting_steps_5_gif.xcf b/assets/raycasting_steps_5_gif.xcf new file mode 100644 index 0000000..40db8d5 Binary files /dev/null and b/assets/raycasting_steps_5_gif.xcf differ diff --git a/assets/raycasting_steps_6_gif.xcf b/assets/raycasting_steps_6_gif.xcf new file mode 100644 index 0000000..1af8379 Binary files /dev/null and b/assets/raycasting_steps_6_gif.xcf differ diff --git a/assets/raycasting_steps_construction.xcf b/assets/raycasting_steps_construction.xcf index 89eacff..39e78bf 100644 Binary files a/assets/raycasting_steps_construction.xcf and b/assets/raycasting_steps_construction.xcf differ diff --git a/assets/raycasting_steps_gif.xcf b/assets/raycasting_steps_gif.xcf deleted file mode 100644 index b43d9c8..0000000 Binary files a/assets/raycasting_steps_gif.xcf and /dev/null differ diff --git a/assets/raycasting_steps_gif_round.xcf b/assets/raycasting_steps_gif_round.xcf deleted file mode 100644 index 5cc5710..0000000 Binary files a/assets/raycasting_steps_gif_round.xcf and /dev/null differ