Pythonista_
Pythonista_
  • Видео 5
  • Просмотров 93 723
Let’s build a Raycaster from scratch using Python
After 3 years since the last video I finally had the courage to make and upload another one. This time, about a subject that I was willing to teach for a long time: Raycasting
If you think this video helped you, you may consider supporting my work by clicking this link:www.buymeacoffee.com/magoninho
SOURCE CODE:
github.com/Magoninho/raycasting-python
Chapters:
0:00 - Intro
0:57 - Introduction
1:43 - How it works
4:02 - Initial setup
9:43 - The Map
21:18 - The Player
39:14 - The Ray class
44:01 - The Raycaster class
58:25 - An introduction to the algorithm
1:01:25 - The Raycasting Algorithm
1:16:10 - Coding Horizontal Intersections
1:27:26 - Coding Vertical Intersections
1:38:07 - Drawing walls
1:45:46 - Fi...
Просмотров: 2 152

Видео

How to make a 3D projection in Python | Rendering a cube in 2D! (No OpenGL)
Просмотров 89 тыс.3 года назад
This is a tutorial that shows how to make a 3D projection using python and pygame. This is a way of projecting 3D dimensions to 2D. In this video we will project a cube :O If I said something wrong, forgive me, because english is not my native language :P #python #computergraphics #pygame #3D #gamedev Source code: github.com/Magoninho/3D-projection-tutorial Songs used: We Are The Champions Quee...
Python Timelapse - Minesweeper
Просмотров 9463 года назад
This is me trying to make a minesweeper in only 2 days. Source code: github.com/Magoninho/minesweeper Music: TheFatRat - Time Lapse
Python timelapse - Purple rain
Просмотров 9673 года назад
Desculpem pelo tema branco, o desafio era usar ele até o final do mês. Vídeo do the coding train: ruclips.net/video/KkyIDI6rQJI/видео.html Música usada: Vexento - Digital Kiss (amo esse cara) Source code: github.com/Magoninho/purple-rain-python

Комментарии

  • @guilhermecampos8313
    @guilhermecampos8313 14 дней назад

    Thanks man, you explanation is very good.

  • @BielDespair
    @BielDespair 27 дней назад

    Nice music from Death Note

  • @whtiequillBj
    @whtiequillBj Месяц назад

    no. Doom was NOT a ray-caster! It used binary-space-partitioning.

    • @pythonista_333
      @pythonista_333 Месяц назад

      Didn't know that :O

    • @whtiequillBj
      @whtiequillBj 25 дней назад

      3D Sage has some great videos on developing both a ray cast engine and binary space partition engine. His videos are between beginner and intermediate coding. But the videos expects you may know nothing and simply want to learn.

    • @pythonista_333
      @pythonista_333 25 дней назад

      @@whtiequillBj 3D Sage videos were actually the reason why I made my own tutorial. I didn't like the way he explained the code and, for a beginner, I thought it would be tough to understand.

    • @ErcepBayram
      @ErcepBayram 12 дней назад

      @@pythonista_333 he is over focused on trying to be funny. Your video is much better.

  • @alokraj4619
    @alokraj4619 Месяц назад

    very informative and easy to digest thank you

  • @qwaxi4512
    @qwaxi4512 Месяц назад

    In OpenGL you will do the same concept but OpenGL is harder than PyGame

  • @magoninhogamer
    @magoninhogamer Месяц назад

    Nice video

  • @mansulol5458
    @mansulol5458 Месяц назад

    Great video bro, i wish i were as good at python as u, i started learning python a week ago and this is way toooooooo impresive, new follow ❤

    • @pythonista_333
      @pythonista_333 Месяц назад

      Nice to hear that, man! Keep learning and you will achieve even more impressive stuff :D

  • @kendeki
    @kendeki Месяц назад

    🔥

  • @mokouu
    @mokouu Месяц назад

    1:04:14 This formula can be confusing if you're truly unfamiliar with how computer graphics work. In computer graphics, y increases downwards, so the opposite side is py - ay, not ay - py. If that's the case, why does the formula still work? Why isn't py - ay correct? It's because our y is flipped. Imagine you're looking up-right: tan(a) is negative (angles increase clockwise in graphics), and py - ay is positive. Positive over negative is negative, so instead of going right, we go left. The simple solution? Just multiply by -1, and suddenly ay - py works. Or, you could calculate tan(360° - a) to get the nice counterclockwise increment that's so popular in math books.

    • @pythonista_333
      @pythonista_333 Месяц назад

      You're absolutely right, I actually made a mistake there. The proper way of showing that was if I flipped the image vertically. The ray would be facing bottom right, and Ay - Py would be right. imgur.com/a/48vshnV

  • @user-zq9vq7nl8b
    @user-zq9vq7nl8b Месяц назад

    amazing! its so easy! thx!

  • @cyklop1977
    @cyklop1977 Месяц назад

    Thx

  • @WahranRai
    @WahranRai 3 месяца назад

    Why mixing with pygame ! Just use numpy , your array multiplication (projection) and matplotlib to draw the figure. Keep it simple and stupid !

    • @pythonista_333
      @pythonista_333 2 месяца назад

      You're right! But pygame would give more views lol

  • @person10103
    @person10103 3 месяца назад

    is there a way to fill every face of the cube?

  • @srblender5327
    @srblender5327 4 месяца назад

    i am comverting the code to work with geometry dash triggers XD

  • @curcumin417
    @curcumin417 4 месяца назад

    Awesome tutorial!

  • @harigopaladamus9481
    @harigopaladamus9481 5 месяцев назад

    bro entered the matrix 💀

  • @coolmanthecool603
    @coolmanthecool603 5 месяцев назад

    Why are you using python for this?

  • @Arium_games_YT
    @Arium_games_YT 6 месяцев назад

    Ugh not again I made Minecraft i was trying to make a cube

  • @cheeseburgerinvr
    @cheeseburgerinvr 7 месяцев назад

    That intro makes me scared already I knew this was a bad idea.

  • @SquirtingBlood
    @SquirtingBlood 7 месяцев назад

    when will there be new videos?(

  • @programm_mister9692
    @programm_mister9692 7 месяцев назад

    Good job bro, How to a make a frustum projection?

  • @hezziacGames
    @hezziacGames 8 месяцев назад

    Great to code along simple to follow as well as learned a few things... and i got a spinning cube on my computer 😎

  • @burhanyasir4614
    @burhanyasir4614 9 месяцев назад

    thee shape problem you were having on which you spent a lot of time researching it could be fixed by just adding the [0,0,0] at the end of the projection matrix. That's how I fixed it. And by the way the projection matrix is useless

  • @peeper2070
    @peeper2070 9 месяцев назад

    Unexpected death note. Very unexpected.

  • @renejr2006
    @renejr2006 9 месяцев назад

    any idea how i can connect points to a 4d square using the p in range

  • @knut-olaihelgesen3608
    @knut-olaihelgesen3608 10 месяцев назад

    I too can copy paste in under 10 seconds

  • @maynermoran
    @maynermoran 11 месяцев назад

    De aquí va a salir mi tesis gracias ❤

  • @ranveerdev4514
    @ranveerdev4514 11 месяцев назад

    hi sir it is really good tutorial, can you tell me that how can we use arroy of other OBJ and then render that. Please reply me soon.

  • @SaferSephy
    @SaferSephy Год назад

    to solve the issue with matrix multiplication you have to match up the shapes in terms of mn * nm. Easiest to do this here is to transpose the point vertex with .T

  • @tiktoks4579
    @tiktoks4579 Год назад

    it's cute

  • @hessnin
    @hessnin Год назад

    the into says it all

  • @kevinquintana3085
    @kevinquintana3085 Год назад

    Man that's what I needed, an actual tutorial on drawing points and lines using a not so bloated library in a good language (fck java) in structured programming (fck classes), not to simple or starting from the ground and not too complex or starting with OpenGL (vulkan gives me nightmares)...

  • @remot1
    @remot1 Год назад

    Please upload more, you cool.

    • @pythonista_333
      @pythonista_333 8 месяцев назад

      I'm back now, I think I will upload a very long video in the near future

  • @user-so1qk2sy3h
    @user-so1qk2sy3h Год назад

    Hi! Your video is really helpfull, ty!!!

  • @xixixitsme
    @xixixitsme Год назад

    this is art, congratulations!

  • @9Lights
    @9Lights Год назад

    Wah! Your videos are too good for 385 subscribers. Thanks lot for the video tho.

  • @vinnn8694
    @vinnn8694 Год назад

    Thanks a lot, this was perfect for me as i could understand it and change it to my own needs. I used it to create a Hexagon viewed from an x-axis angle. Now I want to try making a game-grid for pygame from this.

    • @vinnn8694
      @vinnn8694 Год назад

      Although, I guess I will run into a problem. I am not sure what the right words are, but i guess i need orthographic perspective to get rid of the depth skewing? If anyone can help me with this, leave a comment pls :) Meanwhile I will try to figure it out myself.

    • @Sycro11
      @Sycro11 4 месяца назад

      @@vinnn8694 im a bit late but orthographic projection is a completely different thing and the whole purpose of using perspective projection is to see depth and majority of games use it. orthographic projection is mainly used for things like engineering where they dont want this depth.

  • @prod_guzz
    @prod_guzz Год назад

    can u make a texture tutorial?

  • @jasonboyd782
    @jasonboyd782 Год назад

    I can't stand stammering and stuttering speech, it drives me crazy.

  • @relativistico3794
    @relativistico3794 Год назад

    vulkan please

  • @nio8739
    @nio8739 Год назад

    now do it in vulkan :p

  • @sandiguha
    @sandiguha Год назад

    Hi I make games with pygame. I want to meet more people who fiddles with pygame and game developement. Is there any group or hub you can suggest me please?

  • @01bit
    @01bit Год назад

    Thanks!!!!

  • @oracuda
    @oracuda Год назад

    "how to make a 3d projection": shows orthographic projection

  • @cgiscript415
    @cgiscript415 Год назад

    I just cant find the right words to explain how i am appreciate this. Man i spent weeks to understand 3d projection and because my math background is weak i just disappointed and stopped to try. But God finally sent you to me :) Thanks man, this is awesome explanation for aliens to 3d(like me). Also thanks again for funny presentation.

  • @bueno_excelente
    @bueno_excelente Год назад

    Good job, now enter Z depth. Filling of polygons by scaline, and shading. There we will congratulate you, newbie

  • @legendrags
    @legendrags Год назад

    Nice vid but WHY ON HELL DID U TEACH US ON LIGHT MODE DO U WANT TO BLIND US!?!?

  • @brickolo_
    @brickolo_ Год назад

    I love how you got L's theme playing in the background lol, great tutorial

  • @RenderingUser
    @RenderingUser Год назад

    man started this video like the monogatari series

  • @dynast7550
    @dynast7550 Год назад

    how do u get that cursor?