Тёмный

Make Your Own Raycaster Part 1 

3DSage
Подписаться 113 тыс.
Просмотров 406 тыс.
50% 1

I'm happy to share my raycaster video with you! I hope you learn something, or find it interesting and stay tuned for more fun videos!
Install C and OpenGL • Install Dev C++ and Op...
Minecraft GBA • GBA Minecraft | Pushin...
Zelda GBA • Zelda 3D Demake | Game...
Part 2 with textures! • Make Your Own Raycaste...
Doom tutorial • Let's Program Doom - P...
Download this source code, but follow the video first!
github.com/3DSage/OpenGL-Rayc...
If you make this, let me know and I'll add your link here.
Roberto Abad Followed my tutorial! Check out his Raycaster!
/ 1254070338410995713
Witcher but it's a game from 1990
• Witcher but it's a gam...
Raycaster's shown in this video
Synthes 3D • Synthes 3D - Levels 5-...
Wolfenstein 3D • Video
8Bit Killer Gameplay • 8Bit Killer Gameplay
16 Bit Ray Caster • 16 Bit Computer Ray Ca...
Swinger Engine • Swinger Engine - Load/...
Dracula • Bram Stoker's Dracula ...

Опубликовано:

 

12 мар 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1,3 тыс.   
@LydiaApril
@LydiaApril 4 года назад
I don't know anything about video games but it is really neat to see how the programming is done. Love your water sponsor 🤣
@3DSage
@3DSage 4 года назад
Hi Lydia! Thank you! I was hoping to hear someone say that. I tried to make this video fun to watch for all viewers. Those are my friends and they had many creative ideas that I really liked filming and editing. Maybe they will be in the next sponsor video too. :)
@kris_0520
@kris_0520 4 года назад
3DSage I demand a line of purified water be made that has that label.
@3DSage
@3DSage 4 года назад
@@kris_0520 I would like to see that too! :)
@iamarchibald
@iamarchibald 4 года назад
@@3DSage water has recently released a new type of water called sparkling water so they might want you to promote that. Sparkling water is like normal water but it sparkles which is pretty insane
@superhs
@superhs 4 года назад
@@iamarchibald It also kinda tastes like TV static, which I didn't even know had a taste
@migolas8222
@migolas8222 4 года назад
I can't find the *WATER* link
@thacuber2a03
@thacuber2a03 4 года назад
Hahahahhahahahahha waaaaaaat theeeeeeeeeeeee fuuuuuuuuuuuuuuuccccccccc
@shiiiguthewise6778
@shiiiguthewise6778 4 года назад
water.com
@jacobtvadventures
@jacobtvadventures 4 года назад
Thanks, Whumchy!
@c4nn0n17
@c4nn0n17 4 года назад
@@shiiiguthewise6778 no referrers link for discount tho awww
@Ten2
@Ten2 4 года назад
C4NN0n use code H20 when buying for discount
@vollkorncrafter409
@vollkorncrafter409 4 года назад
The dislike is from Unity
@SDFTDusername
@SDFTDusername 4 года назад
i use unity but didnt disliked
@user-iu8ps1yo1w
@user-iu8ps1yo1w Год назад
Lol
@Coolae450
@Coolae450 Год назад
You don’t like unity so you made your own raycaster?
@Coolae450
@Coolae450 Год назад
Yknow there is like hundreds of game engines at are very different from unity
@geodebreaker
@geodebreaker Год назад
@@Coolae450r/wooooosh
@JuliusHahaha
@JuliusHahaha 4 года назад
Damn dude, this is some quality content
@3DSage
@3DSage 4 года назад
Thank you! I'm happy to hear that :)
@k00lmoh
@k00lmoh 5 дней назад
​@@3DSage been 4 years now and your water sponsorship still cracked me up, good stuff man 👍🏻
@JustCallMeKumori
@JustCallMeKumori 4 года назад
Raycasting seems really complicated. But this video really makes it seem way less scary!
@3DSage
@3DSage 4 года назад
That was my goal! I wanted to take it step by step so it's easier to understand the concept. :)
@nickpavloff8977
@nickpavloff8977 4 года назад
Its probly how our brains see the world lol
@mr.cantillasz1912
@mr.cantillasz1912 4 года назад
I'm a ICT student,this is medium hard,maybe....oof😐
@quickscopesheep5994
@quickscopesheep5994 3 года назад
its really simple its just to do it it requires a shit ton of complex maths
@iamlordstarbuilder5595
@iamlordstarbuilder5595 3 года назад
For someone like me, it easy! I’m doing it lower level than OGL, rather X11 (Linux-only)
@GabrielMartins-wp6ps
@GabrielMartins-wp6ps 4 года назад
Man, idk if you are going to read this, but really thanks, I was trying to create a raycaster for a very long time and i finally created a functional one with the help of your video
@3DSage
@3DSage 4 года назад
I'm very happy to hear that! I'm so glad I could help. And thank you for the nice comment.
@elvirus6994
@elvirus6994 3 года назад
We totally need the 2nd part of this tutorial, It's the best raycasting tutorial I could find, and it would be super cool to have all the features you mentioned, keep up with the great work!
@Nassos__
@Nassos__ 4 года назад
Really makes me want to pick up C and start coding. Please do make a part 2, your explanations are clear and to the point
4 года назад
00:00 Intro 00:17 Games that Use Raycasting 00:48 Prolog 00:57 Sponsor 01:27 Introduction 02:42 Beginning of the Coding - Gray Window 03:14 Coding - Player and Top View 04:01 Coding - Map and Top View 05:14 Coding - Changing player's control to FPS like 06:43 Coding - Casting Single Ray (for horizontal collision/horizontal check) 09:49 Coding - Vertical Line Check (VLC) 11:09 Coding - Combining HLC & VLC to Calculate Ray's Length 12:33 Coding - Casting More Rays 13:43 Coding - Visualizing the Rays in "3D" 15:09 Bonuses
@rxn7
@rxn7 3 года назад
who asked
3 года назад
@@rxn7 I personally came back to this video many times when I was writing my own shader based on this (just comparing notes tbh) in ShaderToy and it was kinda annoying always trying to find a specific part of the video and this makes it much more easier I think...
@gutsarc
@gutsarc 3 года назад
@@rxn7 I did
@blackflame_
@blackflame_ 2 года назад
@@rxn7 joe mama
@chrisk6656
@chrisk6656 Год назад
@@rxn7 i love you
@gambe96
@gambe96 4 года назад
His voice really matches the cat so well
@ljreinworth
@ljreinworth 4 года назад
13:46 "And by we, I mean... Umm... Leo." I feel attacked.
@TheTiznone
@TheTiznone 3 года назад
Damn it, Leo, you had one job
@leobozkir5425
@leobozkir5425 3 года назад
Me too.
@ljreinworth
@ljreinworth 3 года назад
@@leobozkir5425 Hello Leo, I'm Leo. Nice to meet you.
@geko2867
@geko2867 3 года назад
@@ljreinworth hello again :D
@ljreinworth
@ljreinworth 3 года назад
@@geko2867 hey there again, Rako! You're not intentionally looking for my comments are you? It's been a while, how are you?
@pauld1241
@pauld1241 4 года назад
Hi 3dsage! I'm a bit confused as to where to find the link to your sponsor.
@RubyPiec
@RubyPiec 4 года назад
@Austin Entenmann Thanks!
@remty516
@remty516 4 года назад
@Austin Entenmann Took me 2 minutes to load that site
@thatboredinternetwanderer140
@thatboredinternetwanderer140 4 года назад
@Austin Entenmann Cool, thanks! Ima buy Water tm right now
@ismyname_jep1394
@ismyname_jep1394 2 года назад
Not only is this very digestible educational information, it's also hilarious! Thanks for this content.
@3DSage
@3DSage 2 года назад
That's what I was hoping someone would so so thank you for the very nice comment! :)
@nullrazor267
@nullrazor267 4 года назад
I've been looking for an explanation on raycasters for years, this is great! Thank you very much, please do a part 2
@ryandracuscodesgames8418
@ryandracuscodesgames8418 Год назад
This was a very excellent video for an introduction to rudimentary 3D graphics for programmers! After 4 hours of refactoring the code in Java using the standard graphics library and digesting the math, I was finally able to do everything in the video! When I finish the other tutorials, practice it, and finish my own game, I'll be sure to tag you and give you all the praise in the world. I can't thank you enough. No video details this early technique in Java on RU-vid, so I'm glad that your code is so easy to transport over to Java!
@velkex6050
@velkex6050 4 года назад
Can’t wait for the part 2! Also, I can’t understand how such a RU-vid like you still do not have 500000 subscribers, you really deserve more!
@remty516
@remty516 4 года назад
Just finished making this in javascript and Html5, had to workaround some issues but it was two (long) days of fun. Thanks for making amazing videos that push people forward!
@dogbytez
@dogbytez 9 месяцев назад
I've been working on the same thing in javascript too! I know this comment is 3 years old, but would you be willing to share your source code?
@Xilefian
@Xilefian 4 года назад
Interestingly ray-casting is actually pretty darn inefficient, even on a 286 in 1992. John Carmack's foreword for Fabien Sanglard's book mentions this - how a Doom style raster engine would have been more efficient (hence Wolf3D on SNES uses a BSP tree raster engine, rather than ray-casting). For your GBA tutorial if you want to avoid devkitPro I'm actually currently writing a new CMake based toolchain that uses ARM's GNU embedded toolchain - complete with debugging in Visual Studio + mGBA and compatible with any CMake IDE. Might be a lot simpler than asking people to install devkitARM.
@3DSage
@3DSage 4 года назад
Hi there! That is interesting. Raycaster's are pretty fast when compared to other techniques. I have looked into BSP trees but they have some limitations too. Maybe I can make that video too. I'll have to check out that book. I'm glad you are making your own and I look forward to your videos!
@Ehal256
@Ehal256 4 года назад
​@@3DSage The problem is that while raycasting is simple, it requires many redundant raycasts for most visible walls, so it doesn't take into account spatial locality (i.e. if a screen pixel 1 is covered by wall A, other screen pixels near by are likely to also be covered by wall A). Doom finds the list of all potentially visible walls up-front (up to 256 walls, I think), and handles occlusion on a per-wall basis, rather than per-screen-column. This is how it was able to support much greater geometric complexity.
@captainphoton1693
@captainphoton1693 4 года назад
It's may be inefficient but it's so simple to make (but realy long) that you can run a 3D maze in a game like geometry dash using this technique
@johnleorid
@johnleorid 4 года назад
@@Ehal256 You are wrong. He is using a grid and does not check all available walls. What you mean is a polygon-based Raycaster, everything you said is only true for Polygon (Triangle) Raycasters. If you want to check all triangles in space with raycasting, you have to loop through them. In his specific case, there isn't a single triangle on the screen, it's basically a 2D game on a grid, he only checks the grid-tiles he needs to check, there is almost no redumdant check in his implementation - but he can't add height to his levels (or it would be very very difficult). (Doom had height in its levels (ramps, stairs, elevators))
@potatosapien8765
@potatosapien8765 3 года назад
@@3DSage I would love to see a video about bsp trees, it would really help me understand how they work a little bit better.
@cypherparadigm3428
@cypherparadigm3428 Год назад
ngl i appreciate you not slowing the video down to show the code step by step but rather explained what you were doing right along with it. Makes it so you can work at your own pace if you choose to follow along and i respect that.
@raminote5726
@raminote5726 4 года назад
part 2 ? when when ? make a full series !
@sassafrasofficial3695
@sassafrasofficial3695 4 года назад
Yes
@connorconnor2421
@connorconnor2421 4 года назад
part 2? when when? make a full series!*
@MrJosch97
@MrJosch97 3 года назад
Yes
@jonnybonbon91
@jonnybonbon91 3 года назад
I really want at least a part 2
@aeuludag
@aeuludag 3 года назад
He did a one now, you can check it!
@imaginaryfanboy
@imaginaryfanboy 4 года назад
I really appreciate your efforts into explaining coding in a way anyone can understand!
@OrangeDied
@OrangeDied 2 года назад
pro tip for anybody following this tutorial: don't just copy the code, attempt to understand why each math thing needs to be there and how it contributes. you actually learn what's happening and you feel a lot smarter by the end
@runninggames771
@runninggames771 2 года назад
I feel like this would be easier if his variable names were longer then 2 characters
@elllieeeeeeeeeeeeeeeeeeeeeeeee
Maybe it would be more helpful if his code actually compiled
@OrangeDied
@OrangeDied Год назад
@@elllieeeeeeeeeeeeeeeeeeeeeeeee compile deez nuts
@nood1le
@nood1le 6 месяцев назад
That's right. Which is what this video failed to do.
@arturpaivads
@arturpaivads 4 месяца назад
I have to assume that when trigonometry started to roll I just copied and pasted. But otherwise makes sense. Also, I'm building with SDL, not OpenGL, so copy and paste is not an option. And I'm using variables that make sense, not Rx, ry, MX...
@RenderScape
@RenderScape 8 месяцев назад
Just wanted to say thank you for making this. I've just used it for a project I'm working on and it helped immensely.
@Ticbow
@Ticbow 4 года назад
We definetly need a part 2 to this, it was very good!
@dittot
@dittot 4 года назад
really engaging tutorial though
@EvilTim1911
@EvilTim1911 Год назад
I love this series but it would be a little easier to follow the code if the variable names were just a little bit more descriptive. I know short variable names are more convenient but when we end up dealing with a bunch of variables named px, py, ry, rx, mp, my, mx, ra, pa etc. it's a bit tough leaving mental notes what each one was short for.
@jackmarquette1351
@jackmarquette1351 Год назад
yes I was having a hard time so I used chat gpt to help me and explain some of it, it worked surprisingly well
@mariocamspam72
@mariocamspam72 Год назад
@@jackmarquette1351 Ugh.
@alvinbontuyan8083
@alvinbontuyan8083 Год назад
@@mariocamspam72 it's the exact same as being helped by a youtube video lmao
@elllieeeeeeeeeeeeeeeeeeeeeeeee
@@mariocamspam72 hurr hurr ai bad
@maykolmesarodriguez1379
@maykolmesarodriguez1379 Год назад
Comment: this works to remember You what's do the program that you're programing and do not use mental notes 😅
@tyleri.4219
@tyleri.4219 4 года назад
Amazing tutorial! Simple and entertaining. I’d love to see a part 2!
@gangstasteve5753
@gangstasteve5753 4 года назад
thanks so much for making this video. i have been trying for an EXTREMELY long time to find out how to get rid of that dang fish eye effect. I was doing all of this the naive way also, so you are really helping me optimize it.
@InnerTranquility
@InnerTranquility 4 года назад
This is very well made! Great job sir!
@3DSage
@3DSage 4 года назад
Thank you for the nice comment!! :)
@Dr.W.Krueger
@Dr.W.Krueger 8 месяцев назад
Nice video. :) Made one back in 1986 on an Amiga 1000, assembly instead of C/C++.
@3DSage
@3DSage 8 месяцев назад
Hey that's really cool and very impressive! :)
@PinkeySuavo
@PinkeySuavo 23 дня назад
Are you still programming? I was -10 years old back then.
@kellybmackenzie
@kellybmackenzie Год назад
Your channel is amazing. These videos have been my drug for a while now. I LOVE THIS
@dreamhollow
@dreamhollow 2 года назад
I don't mean to sound like a heathen but I was actually following this tutorial using Visual Studio and SFML. Your instructions were still clear enough to get a good idea of what to do. Thank you immensely. This is a great tutorial.
@samwilson5544
@samwilson5544 4 года назад
This cleared something up for me, so thanks ☺
@3DSage
@3DSage 4 года назад
That's what I wanted to hear so thank you for your comment! :)
@TheAnakamex
@TheAnakamex 4 года назад
Now I want to make one myself but maybe in JavaScript or something like that to try how far I could push the idea
@3DSage
@3DSage 4 года назад
Absolutely, you can since this is easy to port between languages. If you post it, send me a link! :)
@Trekeyus
@Trekeyus 4 года назад
@@3DSage tempting to try porting it to python.
@suptnt2004
@suptnt2004 3 года назад
@@Trekeyus me too, but I got stuck at 9:30 how far are you?
@SINDIRELLA-ti1kl
@SINDIRELLA-ti1kl 3 года назад
@@suptnt2004 I'm porting it to GML... stuck at the same spot
@Trekeyus
@Trekeyus 3 года назад
@@suptnt2004 stuck getting motivation to even start keep putting it on the back burner
@selvamthiagarajan8152
@selvamthiagarajan8152 Месяц назад
Simply Brilliant, Brilliant, Brilliant ! You made it look so easy, interesting, and inspiring.
@StevenJonWest
@StevenJonWest 5 месяцев назад
By far the most educational and awesome video I’ve seen in a while! Thanks for sharing this, excited to try and code this myself! 👨‍💻
@battlq6421
@battlq6421 4 года назад
Hey I am having lots of trouble with the code crashing when i am at the point that I have to scan for lines. Could you please send me a link to the source so I can check what I am doing wrong
@gabo9476
@gabo9476 4 года назад
Your name doesn't lie, amazing video! Can't wait for part 2 PS: There is a but... don't like the sponsor, water is such a useless product, i can live perfectly without it...
@3DSage
@3DSage 4 года назад
Thank you for saying that! And good for you. You must be an alien. Welcome to Earth. :)
@KhaliliStudios
@KhaliliStudios 4 года назад
Awesome video loved the sponsors and the “and by we I mean... “ 😂 keep it up man!
@SapphFire
@SapphFire 4 года назад
Really well made and was interesting to watch. I'll look forward to the GBA tutorial.
@ItsRamzi
@ItsRamzi 2 года назад
This is a great tutorial. I implemented it along in Java. So a 17 minute video took more than an hour to get through. I had some problems, though. For example, when running before certain parts were implemented I would get errors that you didn't show getting. In particular there was an index out of bounds error for an array, on the line that used map[mp]. You would later in the video add the condition mp>0 to remove that error. I anticipated that. But it might suck for people implementing along to see that much later, rather than earlier. My final product came out pretty good, but it's a little glitchy. Sometimes I have most rays properly coming out of the 60 degree line of sight, but a few rays coming out of the back of the character's head, in the other direction. I don't yet know what accounts for this. Maybe if I copy and paste your Github source code and then convert it to Java, it will correct whatever error there is. Maybe it is a typo, as I made a few of those already. But the previous typos were easy for me to diagnose and fix. This one seems more confusing to me. I also wonder if your part 2 video won't just correct this automatically, if I am loading a texture rather than drawing a line. But I suspect that the error will remain for as long as any rays are being cast backwards. One part that I thought might cause the problem is... You have two ifs, one which checks a less then, and one that checks a greater then. But this ignores the case where the lines are equal. I had originally coded it with an else rather than two ifs, but I changed it to two ifs thinking that might fix the problem, but it didn't. Hmm... Now that I think of it, maybe this could be the cause of the backward ray cast. If the first if sets the ray correctly... No wait, that doesn't make sense. Hmm... Checking your Github source now, you only have 1 if where you had 2 ifs in the video. The two ifs compared disH and disV. But you only have one condition for that in your Github source, and you set one to be the other if it's longer. I wonder if that'll correct my backwards casting rays. Edit: Yep, that fixed the backward casting rays. But I still have rays traveling through walls sometimes. Weird. I bet if I just copied and pasted your Github source and converted it to Java it'll work. Edit: Translating from your Github source fixed the problems.
@AwesomePowerCat
@AwesomePowerCat 2 года назад
thanks this helped me fix the backwards casting issue
@ItsRamzi
@ItsRamzi 2 года назад
@@AwesomePowerCat :)
@notNull..
@notNull.. Год назад
Min sharing it? I’m trying to do it on javafx but I’m stuck on casting the lines from the center of the rectangle and getting them to move along with it. It would mean a lot
@qu765
@qu765 4 года назад
The only problem with this is that walls can only be in certain places. I made one were the rays just detect with the walls them selfs. (With a loop the find the collision with each wall and finishes on the closest distance) My method is much more efficient for scenes that are big or have walls in any direction. However, for like a big tightly cramped maze, yours would be better. (more walls, less space, straight walls) But I could add in chunking and then there would be almost no situations where mine is worse. My method requires more math, however. How it does it is that it to the ray into a y=mx+b equation with a starting point and each wall into a y=mx+b with two endpoints. Then it performs solving a linear equation of the two to find the intersection point. It makes sure it is valid (correct side of the placer and not above or below the wall). Then finally it calculates the distance to the point. Does this to all the walls then it will find the smallest distance and that is the final distance the ray has traveled. There are also more optimizations that could be done to both yours and I did to mine, in which you only shoot out certain rays in the direction that you need to (this a good description of it ncase.me/sight-and-light/ ). One last thing: whenever I said my method, I do not mean I am the very first to use it or am I trying to talk about how mine is so much better than everything else, it is just that I could not find a better way to say it.
@hungrysparrow
@hungrysparrow 4 года назад
This is awesome! Hope you do a whole series of these.
@ChickenScratch
@ChickenScratch 4 года назад
Gosh a part 2 would be amazing. I've already watched this video at least 20 times and used it to code a ray-casting engine.
@x4d
@x4d 4 года назад
hey, im having issues with creating the rays. is there a discord i could join for someone to help me out?
@goldrn208
@goldrn208 4 года назад
same
@majorcrng
@majorcrng 4 года назад
your sponsor “water” convinced me to go down at 3am and drink “water”
@RubyPiec
@RubyPiec 4 года назад
*w a t e r*
@AnLAdCearbhaill
@AnLAdCearbhaill 4 года назад
Hit us with that second part please! Also, could you highlight the changes you make as you make them? You've really come a far way since your first few tutorials but I find that for some people, who would be total beginners, they could miss some of the quicker changes you make! Keep up the great work man! :)
@Rokkuman10
@Rokkuman10 4 года назад
This was a very interesting video! Looking forward for the GBA tutorial!
@trashtrash2169
@trashtrash2169 4 года назад
wow... you make it sound simple... i feel like i could do it with the minute little programming knowledge i may have with just a bit more effort... and tutorials.
@3DSage
@3DSage 4 года назад
Yes! I was hoping to inspire anyone to make this. It's so rewarding when it works and you can edit your own levels. Please do give it a try! :)
@leosefcik
@leosefcik 4 года назад
Hey ur the guy that wanted minecraft on GBA
@trashtrash2169
@trashtrash2169 2 месяца назад
Lol.
@jojolafrite90
@jojolafrite90 4 года назад
The real new interesting thing invented by ID was the sectors, if I'm not mistaken.
@MinchanLyoko
@MinchanLyoko 3 года назад
Thats right but in my opinion build engine is better 😊
@potatosapien8765
@potatosapien8765 3 года назад
Thanks for making this video! I couldn't find a lot of information about how a raycaster works but your video helped me be able to make my own implementation in python.
@vistisfilm
@vistisfilm 7 дней назад
That water commercial exactly emulates the style of a modern generic commercial. Got that super out of focus lens flare stock footage blended using soft light. Even snuck in a lens flare transition 🤣 beautiful
@darwinandloki5559
@darwinandloki5559 2 года назад
Can someone explain a bit more about -1/tan(ra) at 7:02. What does the negative inverse of tangent do exactly and what happens when you multiply (py-ry) by the negative inverse of tangent. Sorry if this is a simple concept I'm just trying to understand a bit more :)
@RyanBlecher
@RyanBlecher Год назад
This was the fundamental piece missing from this video for me. I struggle with the math. Drawing it and revisiting the trig functions helped me. I also think arctan is incorrect and 1/tan(ray_angle) is actually the cotangent(ray_angle)? If you think of cot and tan as ratios and how all the trig functions relate to the unit circle, the multiplications start to make sense because the values cancel out. 1. (player_y - ray_y) aka: the Y coordinate is the sin(ray_angle) of the triangle you're trying to solve. 2. cot can be expressed as cos/sin 3. sin * cos/sin, the sin cancel out and you're left with cos, which is the ray_x you're looking for, but in the context of your ray angle. The player_x needs to be added so the ray_X point is offset the correct amount of pixels. Use this same approach with the vertical intersections to understand which tan (aka sin/cos) is used instead.
@User-oh8vi
@User-oh8vi 8 месяцев назад
He fixed the negative at the code he uploaded to Github
@eyeindasky3805
@eyeindasky3805 3 года назад
For those using Ubuntu, compile in the terminal like this: g++ original_file_name.cpp -o file_rename -lGL -lGLU -lglut and then just: ./file_rename Luck!
@3DSage
@3DSage 3 года назад
Thank you for letting people know! :)
@stevemuller3324
@stevemuller3324 Год назад
I love games but I know nothing about games engines. This vid was recommended to me by a couple of guys who work in the games industry. I watched this and found it simply fascinating. I was like "That's it? THat's a game engine?" but I was also like "That is so brilliant." Thank you for such a good explanation of how this works.
@fabioazevedo2048
@fabioazevedo2048 3 года назад
Excellent job, @3DSage! Your video is informative, straightforward and even fun to watch (thank the cat - Leo, right?). I got really inspired! Thank you for putting this all together and sharing with us.
@atx4dt
@atx4dt 4 года назад
Love this! I don't fully understand all the math yet :P looks like there is a small mistake around 8:33 with your second typecast on line 70 though. :)
@laz3664
@laz3664 8 месяцев назад
haha I thought I was the only one that didn't get all the math, I'm talking about his dda algorithm
@newtechandcoding2213
@newtechandcoding2213 4 года назад
can you please give me a link to the complete source code?, my code isn't working and I want to see if I can fix it.
@SBX-uf3in
@SBX-uf3in 4 года назад
same here bud
@vriska222
@vriska222 4 года назад
same
@lsk-nf7um
@lsk-nf7um Год назад
I sure love your sponsor. I couldn't live without them!
@johnnysavior4538
@johnnysavior4538 2 года назад
Finally a good raycasting explanation that I can actually follow along. Im using your video for creating a raycasting game on pygame. Thank you!
@dittot
@dittot 4 года назад
Download to the GBA raycaster?
@3DSage
@3DSage 4 года назад
I'll upload that somewhere for you to download soon. And in the next video i'll teach you how to program a GBA game. :)
@dittot
@dittot 4 года назад
@@3DSage Sounds great, would love to start programming my own GBA games. Can we expect downloads for Minecraft & Zelda too (even if they are in early stages/are unfinished at the moment)?
@MatejGames
@MatejGames 4 года назад
Can i get a coupon code for my water?
@3DSage
@3DSage 4 года назад
Waiting on that sponsorship check to come in ;)
@enricmm85
@enricmm85 3 года назад
Your sponsor literally keeps me alive. Thanks sponsor.
@funguslars
@funguslars 4 года назад
I am in the process of writing my own game engine in DirectX and I stumbled upon this video. This is super useful for me! Thank you!
@3DSage
@3DSage 4 года назад
I'm glad to hear that! I hope you post your game engine when you get it working. I hope to see it!
@spigui500
@spigui500 4 года назад
Please do a part 2!!!!!
@3DSage
@3DSage 4 года назад
Ok I will :)
@iDontProgramInCpp
@iDontProgramInCpp 4 года назад
@@3DSage That part 2 seems to take a while to make
@Darksoulmaster
@Darksoulmaster 4 года назад
What the hell where is the promotional code for the water! This is clickbait! Disliked, unsubbed.
@trykx5027
@trykx5027 4 года назад
I've recreated step by step your Raycaster game and it was really fun to do ! I'm hyped for the next episode :D
@elllieeeeeeeeeeeeeeeeeeeeeeeee
How? It doesn't work.
@ThePikmania
@ThePikmania 4 года назад
this is really cool, thanks 3DSage. Relatively little code and yet such an effect
@thatanimeweirdo
@thatanimeweirdo 4 года назад
Interesting, as a high-level programmer, I always thought C was much harder to understand!
@ArtUniverse
@ArtUniverse 4 года назад
C is as hard as you make it out to be. You can write complex programs with simple code.
@deanolium
@deanolium 4 года назад
C really isn't that complicated at all. The only things to be aware of is the need to manage memory. Otherwise you can end up with memory leaks which can ruin your day. These are pretty easy to avoid unless you're doing complicated programs though.
@sh4dow176
@sh4dow176 4 года назад
Where’d you get the “code.cpp” file at the start? And when I typed it out myself and compiled and ran it opens “glut.h” and says (in the compiler tab at the bottom) “483 c:\program files (x86)\dev-cpp\mingw32\include\GL\glut.h undefined reference to `_glutInitWithExit@12’ “ what does this mean and how do I fix this? I know I’m late but i really want this to work! Thanks in advance! EDIT: I fixed it by adding a ‘#define GLUT_DISABLE_ALTEXIT_HACK’ but now it has a red bar on line 7 (now 8) and an error saying “undefined reference to `_imp_glClear@4’” I’ll try to fix it on my own... I’ll update if I fix it and more errors pop up! Guess this comment is my journal now!
@arieyorsson3191
@arieyorsson3191 3 года назад
No idea if you're still facing this error, but you need to link with the opengl libraries
@Aresplaysgd
@Aresplaysgd 2 месяца назад
This tutorial is amazing, I wanted to make a 3d game in pygame, i got all the way to ray casting, but 3d rendering seemed so complicated. Then after hearing that its just rectangles, I attempted to make it all, and it worked firat time, and i exploded in happiness. Gonna learn some more soon. Thanks alot for this
@TheRabbitPoet
@TheRabbitPoet 4 года назад
Thank you so much for the tutorial it was really helpful. It would have taken me ages to figure this out all by myself, but by using this model as a starting point I can customize it and add extra features, for now I'm adding collisions and some wall designs (don't know how to add textures so I'm writing them with code)
@pegfun16
@pegfun16 4 года назад
When I compile at 9:19, the ray doesn't show up.
@susq_345
@susq_345 4 года назад
make sure you check that the ray only collides with white wall
@chxry9670
@chxry9670 4 года назад
make sure you call drawRays2D() in your display function
@markokarsai5705
@markokarsai5705 4 года назад
Change the drawRays3D to drawRays2D and add drawRays2D(); under drawMap2D();. I hope this helped. 😉
@nitrogenthrone1778
@nitrogenthrone1778 4 года назад
I am to
@pegfun16
@pegfun16 4 года назад
@@chxry9670 I did then the ray pointed backwards and it crashed.
@7gennews
@7gennews Год назад
please, name variables properly, this is very bad practice to name variable like pxa, pv, uip etc.
@alexl5941
@alexl5941 3 года назад
Followed this tutorial to make this in java without a game engine, works very well. Thank you! Will be checking part 2 and will be adding some features of my own as well maybe.
@shreeshmeghna7158
@shreeshmeghna7158 4 года назад
Thanks so much for this video! It inspired to write my own ray casting engine in pygame, and you really made me realize how easy it is to do so!
@emneo-dev
@emneo-dev 4 года назад
You really need a coding style dude, the code is almost unreadable :/
@tdif3197
@tdif3197 4 года назад
What do you mean, like five statements all in one line, all using combinations of unexplained two-letter variables isn't a style?!
@user-zu1ix3yq2w
@user-zu1ix3yq2w 4 года назад
@@tdif3197 I feel right at home reading his code. Stop crying, guys.
@pointers2010
@pointers2010 3 года назад
that code is actually really clean for a fast video, if you dont know how to program, then it would be very hard for you to read it :/
@cybroxde
@cybroxde 3 года назад
@@pointers2010 It's annoying to read, even if you know how to program. Formatting code properly just saves everyone lots of mental capacity understanding it. Good luck making sense of that code without watching it being written, I guarantee you waste a few minutes every segment.
@pointers2010
@pointers2010 3 года назад
@@cybroxde good point, but when i started coding i was a bit trash, so i got into reading this type of code
@_Ello
@_Ello 7 месяцев назад
your code is unreadable
@RemainingAxis565
@RemainingAxis565 2 месяца назад
Still better than mine
@JickFincter
@JickFincter 4 года назад
please make a part 2 that is everything I want in a part 2 video about this stuff. Such a good video I love it.
@SilentJ2602
@SilentJ2602 3 года назад
when i hit the ad i instantly subbed lmao this channel is great
@SpencerYonce
@SpencerYonce 2 года назад
I just found you today and you like my favorite person already. I’ve also never heard someone else who does the S whistle with their teeth and tongue when saying some words. I’ve been messing with OpenGL and Vulcan the past few months and you are awesome
@Dadertrix
@Dadertrix 4 года назад
i have a python background, and raycasting has always been interesting to me, but felt like it was too complicated, even though I don't understand a lick of the code, you made the math and concepts way to easy to understand! You are a fool for giving me this power
@amanciofelipezanidasilva148
thx so much for sponsoring this video
@ismaelbies
@ismaelbies 3 года назад
Nice work man! I am waiting for part two.
@xWourFo
@xWourFo 4 года назад
I love that, I can't wait for part two!
@RaposaCadela
@RaposaCadela 2 года назад
Fantastic! This is very straight-forward, I got it all to work in Godot. Except fixing the fish-eye effect, it works vertically, but horizontally it's going insane
@antonnym214
@antonnym214 3 года назад
hyper-interesting and very well-explained! I subscribed immediately. P.S. I love the cat!
@kamranki
@kamranki 2 года назад
Awesome videos sir! Thanks for sharing this. I've always known the basics behind raycasting, but seeing it from a programmer's point of view is fantastic. Thanks again!
@3DSage
@3DSage 2 года назад
I'm working on Doom for my next video! :)
@Yolwoocle
@Yolwoocle 4 года назад
Now this motivates me to listen better at maths classes haha, super interesting video, great job, I really enjoyed it! :)
@tomasburian6550
@tomasburian6550 3 года назад
Ever since it came out, I was curious about how they made this game. I learned C at school at the end of the 90's and still it wasn't clear to me. This video finally tell me the truth, after all those years. Thank!
@motbus3
@motbus3 4 года назад
Hey. Your channel is amazing. Thanks for creating nice content with this great quality!
@maz5-870
@maz5-870 2 года назад
I dont think I could live if you didn't show me the sponsor. Thanks, singlehandedly saved my life!
@3DSage
@3DSage 2 года назад
Not all heroes wear capes. Some have bottled water :)
@susu5331
@susu5331 4 года назад
Thanks for making this AWESOME tutorial video! I started up with a little bit of UE4 and Python knowledge but after watching this with visual studio open for 6 hours, I think I get it and even implemented fun stuffs like coloured blocks (as shown in the video) and jumping. This friendly and interesting tutorial even pushed me to start studying C/C++! Hope to see more good stuffs like this one in the future.
@plrc4593
@plrc4593 2 года назад
You implemented jumpin in a technic of raycasting? How and how does it look like?
@PinkeySuavo
@PinkeySuavo 23 дня назад
@@plrc4593 maybe simply through shifting the displayed lines up and down with respect to the window
@totallynotabot151
@totallynotabot151 2 года назад
Thanks for the excellent explanation! I made a raycaster 30 years ago as a sample project to teach myself x86 assembly. The one part that I never got around to fixing was the fish eye effect. Turns out it's just a projection onto a plane perpendicular to the view vector, but I didn't know that at the time.
@3DSage
@3DSage 2 года назад
Thank you for sharing that! I'm impressed you did it with assembly. And yup, a simple cosine multiplication can correct the fish eye effect. Raycasters are a great program to make so I had to make this video to share it with people.
@barrettkepler7618
@barrettkepler7618 4 года назад
Subscribed! Like your content! Waiting for next part
@datle5585
@datle5585 2 года назад
Please make more and more video like this!!!!!!!! Really appreciate how you break down very complex things for us
@potatopotato7561
@potatopotato7561 4 года назад
Damn, animations on point my man. Keep it up.
@instagib783
@instagib783 Год назад
This was the first advertisement I enjoyed more than LucidChart. Well done, sir.
@danielmj0632
@danielmj0632 4 года назад
I Would love to see a part two. BTW Great video
@lionelleeser3001
@lionelleeser3001 3 года назад
Amazing video. Gave me the will to try new stuff. Part 2 is needed, hope you're working on it.
Далее
Make Your Own Raycaster Part 2
13:46
Просмотров 105 тыс.
Cheapest Bullet Time with a 9 Dollar Camera
6:59
Просмотров 285 тыс.
Lasagna Soup @Lionfield
00:35
Просмотров 1,6 млн
The Most Impressive Basketball Moments!
00:36
Просмотров 9 млн
How I Made a 3D Platformer in 2D Game Engine
21:23
Просмотров 440 тыс.
I made a better Ray-Tracing engine
17:38
Просмотров 247 тыс.
Doom engine - Limited but still 3D
6:57
Просмотров 532 тыс.
Super Fast Ray Casting in Tiled Worlds using DDA
30:03
Просмотров 176 тыс.
100+ Linux Things you Need to Know
12:23
Просмотров 135 тыс.
Wolfenstein 3D's map renderer
14:49
Просмотров 272 тыс.
How we fit an NES game into 40 Kilobytes
12:04
Просмотров 3,5 млн