Ray casting fully explained. Pseudo 3D game

  Рет қаралды 28,111

WeirdDevers

WeirdDevers

3 жыл бұрын

➤ Description
In this video I am explaining ray-casting.
Ray-casting is the method which was used to render pseudo 3d games before. Wolfenstein 3D uses ray-casting.
➤ Music
• New Day - Patric Patrikios
• The Joint is Jumpin - Joel Cummins
➤ Project
• github.com/rickarter/Ray-casting
➤ About
Hello! And welcome! My name is Eric and I'm 15. Learning and explaining new things fascinates me.
➤ Credits
Without Grant Sanderson AKA 3Blue1Brown it wouldn't be possible to make this video. I used his open-source project called manim to do all the animations.
/ @3blue1brown

Пікірлер: 45
@ilikemorestuff
@ilikemorestuff 2 жыл бұрын
Congratulations! You give a concise explanation of the math, why and how it's used in this context, and also provide details on how to employ the given formulae for fine tuning the output. Well done!
@harding5674
@harding5674 3 жыл бұрын
i dont understand how this video is only at 917 views (as in, i dont understand why it doesnt have way more views) like this is an extremely good video
@weirddevers9165
@weirddevers9165 3 жыл бұрын
Thanks🙂
@gabrielsegura626
@gabrielsegura626 2 ай бұрын
I don't undestand this video
@Squeph
@Squeph 3 ай бұрын
For wall colour, you can change the colour the lines are drawn depending on the distance to the wall that you calculated, so it gets darker the further away the walls are
@ahmadshariq7116
@ahmadshariq7116 11 ай бұрын
This is the most comprehensive and simple explanation that I have seen to date. Great job.
@ismyname_jep1394
@ismyname_jep1394 2 жыл бұрын
Wow thank you for simplifying this! I couldn't find any other video that does not gloss over of why and how ray casting works.
@weirddevers9165
@weirddevers9165 2 жыл бұрын
oh gosh! It’s been more than a year since I uploaded it. I’m so glad it helped you
@giovannicesaramorim9adigan961
@giovannicesaramorim9adigan961 4 ай бұрын
How do you know when you have hit a wall? I'm thinking about using a matrix, but wouldn't that just be infinitely small points in the determinate coordinates? The numbers in the matrix aren't lines
@blow42176
@blow42176 3 жыл бұрын
Thanks for this great video !
@excortia453
@excortia453 Жыл бұрын
hello, i have a question. when u calculate xs, shouldn't xs = ys/-tan(angle)? also, shouldn't i check if player is facing upwards or downwards, becouse when it faces upwards yn = Player.y/cellsize * cellsie and when it faces downwords yn =Player.y/cellsize * cellsize + cellsize
@eddie.z
@eddie.z 3 жыл бұрын
Geat TUtorial. In-depth and Organized.
@weirddevers9165
@weirddevers9165 3 жыл бұрын
Thank you
@eddie.z
@eddie.z 3 жыл бұрын
@@weirddevers9165 No problem
@YiTsukENyt
@YiTsukENyt 3 жыл бұрын
Really good video
@Malenki_Stefan
@Malenki_Stefan 3 жыл бұрын
I love this video
@dhanushc5744
@dhanushc5744 23 күн бұрын
this was so confusing. feel like lot of information is omitted and not explained in details. im not sure how it is "fully explained". Not even sure if the issue he just assumes others know or he incorrectly explained.
@khangdao8119
@khangdao8119 Жыл бұрын
Why is yn = (py-(py/cellsize))*cellsize in 2:08 ? Is there any trigonometric formulas there?
@ringzero3260
@ringzero3260 Жыл бұрын
that part does not make sense. probably a mistake. (py-(py/cellsize))*cellsize will always equal 0
@hakansuner2578
@hakansuner2578 4 ай бұрын
It uses the formula (cellsize-(player.x/cellsize)*cellsize) for the same calculation when checking vertical intersections. It makes sense when the same formula is used for the y position. I think there was a little confusion
@unmandarinoalgiorno...9321
@unmandarinoalgiorno...9321 29 күн бұрын
@@ringzero3260 it's because in programming, the result of py/cellsize will be an integer. For example 5/3 will be 1. But i think the formula to count xn when checking vertical intersections is probably wrong. From what i understand, it shoud be xn = cellsize - player.x + (player.x / cellsize) * cellsize
@moohot3479
@moohot3479 3 жыл бұрын
I love your video; however, I still have a few questions. For the Horizontal intersect at 2:00; the Y nearest has the Player.y over cell size then multiplied by cell size witch would cancel each other out then by subtracting Y nearest, would output a zero no mater what the two variables equal. Did you mean to put (Player.y (Player.y/cellsize)) cellsize instead of Player.y (Player.y/cellsize) cellsize? I also noted at 2:32 you used cell to subtract, divide and multiply when the previous step only used step to divide and multiply; y-(y/s)s and s-(x/s)s (used letters for simplification) . It was a great video and helped me out tones, I'm just a little lost at a few parts.
@weirddevers9165
@weirddevers9165 3 жыл бұрын
player.y/cellsize should be evenly divided. For instance if player.y is equal to 131 and cellsize is 64 then player.y over cellsize equals 2. In this case the equation gives the following result yn = 131 - 2*64. If you still have questions I’m willing to answer
@moohot3479
@moohot3479 3 жыл бұрын
@@weirddevers9165 I didn't get the divide evenly part. Thanks for the help, you make things easy to understand. I'm looking foreword to your next video!
@johnvine5731
@johnvine5731 Жыл бұрын
Ah, divide evenly means cast the floating point result of the division to an integer value. (int)(player.y/cellsize) Took a while to realise that! player.y-(( (int)(player.y/cellsize)*cellsize)
@wdpko2926
@wdpko2926 Жыл бұрын
why do u divide cellsize and multiply it again at 2:00 am i just stupid?
@dannaki_d
@dannaki_d 9 ай бұрын
No, you think right way. This formula is 0 return.
@SbAlmagro
@SbAlmagro Жыл бұрын
2:40 How come tan a = y_s / x_s -> y_s = x_s / tan a? Could you explain?
@Cloud-kd7mx
@Cloud-kd7mx 5 ай бұрын
tan a = y_s / x_s 1 / tan a = x_s / y_s y_s / tan a = x_s y_s = x_s / tan a
@SbAlmagro
@SbAlmagro 5 ай бұрын
@@Cloud-kd7mx Thanks. Could you explain how come y_s / tan a = x_s -> y_s = x_s / tan a?
@Cloud-kd7mx
@Cloud-kd7mx 5 ай бұрын
@@SbAlmagro this equation is incorrect Because if y_s / tan a = x_s Then y_s = x_s * tan a
@SbAlmagro
@SbAlmagro 5 ай бұрын
@@Cloud-kd7mx true. But that is what you wrote.
@Cloud-kd7mx
@Cloud-kd7mx 5 ай бұрын
@@SbAlmagro oh, then it's my bad, lol, didn't read myself
@YiTsukENyt
@YiTsukENyt 3 жыл бұрын
Ity deserves 1 million views
@YiTsukENyt
@YiTsukENyt 3 жыл бұрын
at least
@breakdancerQ
@breakdancerQ Жыл бұрын
1 billion at least
@ringzero3260
@ringzero3260 Жыл бұрын
@@breakdancerQ it's full of mistakes.
@clock0789
@clock0789 9 ай бұрын
Thank you sir!
@thanhdangthingoc9301
@thanhdangthingoc9301 6 ай бұрын
For any one who wonder the math formula for horizontal was correct he just forget to round up like 2.8 to 2
@joaquimjesus6134
@joaquimjesus6134 Жыл бұрын
MapResolution = 32 'cellsize PlayerPosX = MapResolution + 20 PlayerPosY = MapResolution + 20 PlayerAngle = 0.1 'Radians NearstY =PlayerPosY- PlayerPosY / MapResolution * MapResolution why i get zero?
@dannaki_d
@dannaki_d 9 ай бұрын
Because the formula is incorrect in the video.
@alisson4387
@alisson4387 16 күн бұрын
I can't understand "-" in xn = cellsize - (player.x / cellsize) * cellsize, timing 2:39. I was expecting xn = cellsize + (player.x / cellsize) * cellsize. (player.x / cellsize) - tell us how much cells the player walked throng x axes. (player.x / cellsize) * cellsize - we convert cells walked for pixels walked. this value corresponds the left side in the cell where player is currently. cellsize + (player.x / cellsize) * cellsize - give us the right side of the cell where player is currently, in others words, the y value where first vertical intersection occur.
Super Fast Ray Casting in Tiled Worlds using DDA
30:03
javidx9
Рет қаралды 177 М.
Ray Tracing in 5 minutes
4:37
Graphics in 5 Minutes
Рет қаралды 10 М.
Эффект Карбонаро и нестандартная коробка
01:00
История одного вокалиста
Рет қаралды 9 МЛН
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 80 МЛН
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 79 МЛН
Wolfenstein 3D's map renderer
14:49
Matt Godbolt
Рет қаралды 272 М.
Make Your Own Raycaster Part 1
16:52
3DSage
Рет қаралды 409 М.
Programming Pseudo 3D Planes aka MODE7 (C++)
27:16
javidx9
Рет қаралды 103 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 696 М.
How to ACTUALLY get into Gamedev
14:01
DaFluffyPotato
Рет қаралды 703 М.
Doom engine - Limited but still 3D
6:57
borogk
Рет қаралды 535 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 4,3 МЛН
Let's Program Doom - Part 1
25:13
3DSage
Рет қаралды 413 М.
Это - iPhone 16 и вот что надо знать...
17:20
Overtake lab
Рет қаралды 119 М.
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 356 М.
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 2,3 МЛН
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 1,7 МЛН
Как бесплатно замутить iphone 15 pro max
0:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 3 МЛН
Смартфон УЛУЧШАЕТ ЗРЕНИЕ!?
0:41
ÉЖИ АКСЁНОВ
Рет қаралды 1,2 МЛН