Video není dostupné.
Omlouváme se.

Code-It-Yourself! 3D Graphics Engine Part #1 - Triangles & Projection

Sdílet
Vložit
  • čas přidán 3. 08. 2024
  • This video is part #1 of a new series where I construct a 3D graphics engine from scratch. I start at the beginning, setting up the project, then discuss vertices and triangles. Next a description of how 3D coordinates are converted into on-screen 2D coordinates using a projection matrix. This results in seeing a cube being rotated in 2-axis and translated.
    Source: github.com/OneLoneCoder/Javid...
    / javidx9
    / discord
    Blog: www.onelonecoder.com
    Twitter: @javidx9
    Twitch: javidx9

Komentáře • 2,1K

  • @kakkoiichris
    @kakkoiichris Před 6 lety +1058

    With Visual Studio 2017, the old project options window shows up when you choose the "Windows Desktop Wizard" option.

    • @Ageekything
      @Ageekything Před 5 lety

      Nope same thing except now it throws an exception? Can I send you a screen shot?

    • @keilanknight8513
      @keilanknight8513 Před 5 lety +8

      @@Ageekything use the wizard and unselect "precompiled header", also select "empty project" this way you just need to add an item (cpp source file) then you're good to go. Just come across this video now and ran into these same problems after upgrading visual studio! There's something dirty about needing to use a wizard! :)

    • @franklemanschik_de
      @franklemanschik_de Před 4 lety +1

      @@keilanknight8513 you do not even need to use such wizard I for example simply copy project folder structures into so called template projects then I can copy that folder rename it to my new project name and boom it works :D I can open it in any IDE

    • @vlazm1853
      @vlazm1853 Před 11 měsíci

      I have tried coding rotating square once. Took me way more time I want to accept...

  • @taba1950
    @taba1950 Před 6 lety +1901

    -"don't click stop just yet"
    -I'm here for the math

    • @javidx9
      @javidx9  Před 6 lety +245

      Lol thanks Almujtaba! Im pleased to hear some people are!

    • @fuzzycat3651
      @fuzzycat3651 Před 6 lety +58

      If you aren't I would wonder if you really should be here!

    • @aradarbel4579
      @aradarbel4579 Před 6 lety +5

      lol thats so true

    • @stanislavzoldak2198
      @stanislavzoldak2198 Před 5 lety +6

      Came to the comment section to say this exactly.

    • @Luffi98
      @Luffi98 Před 5 lety +6

      @@fuzzycat3651 I expected more literature but only found math, dissapointed :(

  • @iamthebubb
    @iamthebubb Před 4 lety +1606

    I once made a square that moved around using c++, it took me a week

    • @richarddukard8989
      @richarddukard8989 Před 4 lety +488

      Next stop, red dead redemption 2

    • @blatrump
      @blatrump Před 4 lety +74

      @@username6338 So easy, that it's still the primary source of bugs in this language.

    • @obinator9065
      @obinator9065 Před 4 lety +12

      Tompas Trupp yah even with RAII and smart pointers around.
      I’ve created custom allocators for my Game Engine that handle these problems for chunk loading etc.
      I still have leaks from time to time.
      There‘ll be a point in advanced Game Engines where ‚new‘ just isn‘t fast enough. The answer to that is Placement New, bug dangerous for sure.

    • @Odin_Borson
      @Odin_Borson Před 4 lety +7

      I csn do that in C with old graphics.h

    • @alalala132whyisthishandletaken
      @alalala132whyisthishandletaken Před 4 lety +16

      well if you don't know c++/c with classes too well that's not unimpressive given how shattered your view of arrays and data structures becomes when you move onto it from JavaScript.

  • @Okuhno
    @Okuhno Před 3 měsíci +15

    I went through this series years ago, I ended up porting all the code in the series to lua, it legitimately broadend my horizons and general understanding of code and math, I just want to say thank you.

    • @javidx9
      @javidx9  Před 3 měsíci +5

      I'm pleased you found it useful. Thanks!

  • @MrBranh0913
    @MrBranh0913 Před 3 lety +347

    I’m a backend developer who has spent most of my career never dealing with anything related to games or graphics. But lately I’ve had a curiosity about the world of computer graphics. This is an awesome introduction. Not going to lie some of the matrix multiplication stuff requires a refresher for me, but this is super solid material.
    Despite coding for 20 years I feel like a total noob again learning programming for the first time.

    • @carloscepeda8663
      @carloscepeda8663 Před rokem +25

      Same here, lol.
      In my case I'm really bored of programming /maintaining enterprise applications or making API's and nothing else.

    • @symbioticparasite6268
      @symbioticparasite6268 Před rokem +11

      Your only doing a good job in I.T if you're feeling like a n00b....
      It's an infinite loop of knowledge my friend, from 0 to 1 and back again. Nobody knows all, that's why we specialise and collaborate!

    • @prtygrl5077
      @prtygrl5077 Před 11 měsíci +2

      you don't need matrix calculations or transforms. he just makes it looks like difficult. Trust me it just takes 15 or less lines of code without any kind of special scenekits or anything. may be he's too d!mb to think. Our eyes only sees anything around us 360 degree any angle, rotated 2d and then rotated 3d. Same can be implemented with simple code.

    • @helloworld4872
      @helloworld4872 Před 11 měsíci

      ​@@prtygrl5077I am a noob, we don't need to learn vector and matrix transform for game development ?

    • @deathbyslime6725
      @deathbyslime6725 Před 9 měsíci

      ​@@prtygrl5077prove it

  • @amalirfan
    @amalirfan Před 3 lety +736

    I was trying to replicate this in python for past couple of hours, it finally worked.. That was soo satisfying 😄😄

    • @vilasd.chawan1769
      @vilasd.chawan1769 Před 3 lety +22

      But how did you do that

    • @emmettdja
      @emmettdja Před 3 lety +37

      Im trying to replicate it in p5 js and I've almost got all the code transferred. Time to think about it as i sleep til tomorrow morning.

    • @vilasd.chawan1769
      @vilasd.chawan1769 Před 3 lety +5

      @@emmettdja how do you do that ?

    • @emmettdja
      @emmettdja Před 3 lety +33

      @@vilasd.chawan1769 mainly the matrix multiplication is what is doing this. You can recreate this kind of math on almost anything.

    • @vilasd.chawan1769
      @vilasd.chawan1769 Před 3 lety +9

      @@emmettdja ohh , but I didn't get that , as I am new to programming , and I have now only learned python 3 , and made only 3 super simple games

  • @Lennybird91
    @Lennybird91 Před 4 lety +149

    As a Junior software engineer whose coverage of graphics consisted of one course utilizing OpenGL in college, I'm very grateful for this series. Exploring the underlying theory devoid of simplifying libraries is exactly what I'm after. Thanks!

    • @user-ri2ms2mm7w
      @user-ri2ms2mm7w Před 2 lety

      My friends, search for your life purpose, why are we here?? I advise you to watch this series and this video 👇 as a beginning to know the purpose of your existence in this life czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
      czcams.com/video/7d16CpWp-ok/video.html

  • @jeffreyg6850
    @jeffreyg6850 Před 5 lety +183

    When I die... I want to come back as a line of Javidx9's code...

    • @Ghost-gj1bx
      @Ghost-gj1bx Před 4 lety +4

      @@MantasXVIII r/unexpectedmonkeyspaw

    • @Notsogaming0108
      @Notsogaming0108 Před 3 lety

      I mean you don’t come Back but i still like what you would like to be 😂

    • @HalloGaming
      @HalloGaming Před 3 lety +5

      Alright you come back as:
      using namespace std;

    • @samljer
      @samljer Před 3 lety

      system("pause");

  • @thecakeredux
    @thecakeredux Před 3 lety +149

    I coded a 3d engine from scratch this year, without external code examples. Huge headache, but I got it done. Can't wait to see the hundreds of things I did wrong.

    • @lookupverazhou8599
      @lookupverazhou8599 Před 2 lety +13

      That's one way to get good at something.

    • @tellahsage6477
      @tellahsage6477 Před rokem +7

      Fucking cool man, wish i had the guts to do that. Most i've ever done was writing 2D platformers in pure C but never even wet my foot into 3D because bad at algebra and the like. I should pick up a math textbook and then try to do something like this after reading it, must be a rewarding experience once you actually see your code work.

    • @thecakeredux
      @thecakeredux Před rokem +10

      @@tellahsage6477 It was amazing when it worked for the first time. I've tried it a couple times in the past and never got it working just right or only under very specific circumstances. Obviously this version bugged out dozens of times, but when it suddenly worked, I was really happy.
      The math isn't the difficult part about it, I'm pretty much a forklift driver, so I'm no math person by any stretch of the imagination.All you have to do is understand the individual steps, put them to code, abstract it away and you can forget about it forever. I couldn't explain to you vector maths or even do it on paper, but I can write code that does it, and I'm certain you can, too.

    • @prtygrl5077
      @prtygrl5077 Před 11 měsíci +1

      yeah me too, I also made a 3d engine. This video su!ks though. he make it complex but it's not. Our eyes only sees anything around us 360 degree any angle, rotated 2d and then rotated 3d. Same can be implemented with simple code. just need cos tan and basic trigonometry.

    • @thecakeredux
      @thecakeredux Před 11 měsíci +2

      @@prtygrl5077 No, that would cause constant gimbal locks.

  • @TheTukkia
    @TheTukkia Před 5 lety +281

    those pespective equations are things that make so much sense, but you will never think of unless you break the whole problem down really well. Nice job man, you make my geometry classes actually worth something

    • @javidx9
      @javidx9  Před 5 lety +74

      lol thanks Talento, its surprising how much high-school maths has a practical value in programming!

    • @bonbonpony
      @bonbonpony Před 5 lety +5

      Yup, it all boils down to simple geometry of similar triangles ;)

    • @yan-amar
      @yan-amar Před 5 lety +53

      @@javidx9 What's surprising to me is how high school made all those useful maths uninteresting by not telling us it was actually useful somewhere in the real world.

    • @maythesciencebewithyou
      @maythesciencebewithyou Před 5 lety +21

      @@yan-amar Be honest, you never cared to know back then.

    • @nich.1918
      @nich.1918 Před 4 lety +11

      @@maythesciencebewithyou that's literally what he's saying...

  • @wyleong4326
    @wyleong4326 Před 3 lety +28

    1 minute in and I’m already loving this; graphics, maths, programming and art.

    • @PinkeySuavo
      @PinkeySuavo Před rokem

      1 minute in and im out, too dumb for this. Only forwarded for end results.

  • @rightwingsafetysquad9872
    @rightwingsafetysquad9872 Před 3 lety +23

    Episode 2: moving the camera.
    Episode 3: Duke Nukem.

  • @Wjw129
    @Wjw129 Před 5 lety +727

    Finally, a programming tutorial where you cant hear the tutor’s saliva.
    Very helpful though so far, thanks so much.

    • @kenji1856
      @kenji1856 Před 4 lety +17

      yes, I too am no longer educating myself because the person trying to teach me produce saliva in their mouth, and apparently I can hear it.

    • @kristypolymath1359
      @kristypolymath1359 Před 4 lety +5

      Maybe if the teachers weren't buried in your lap....

    • @anisnej10
      @anisnej10 Před 4 lety +7

      @@kenji1856 poor attempt at a verbose meme.

    • @onesubscriberbeforechallenge
      @onesubscriberbeforechallenge Před 4 lety

      no homo

    • @shadybandit7
      @shadybandit7 Před 4 lety +2

      and the damn music

  • @hoax-games
    @hoax-games Před 5 lety +30

    For the people that wonder about the z-values in the projection matrix: for linear scaling, to get z in the range 0 to 1 you need to: z'=(z-znear)/(zfar-znear). However it is recommended to have higher precision for lower z values (objects that are near to the camera) than for higher z values (objects that are far away). Therefore z' is multiplied by zfar and divided by z (== the given projection matrix z-values in the video just written differently). This is an important note to fully understand the math behind the projection matrix. Thx javidx9 for this awesome video. I for the first time finally understand how a projection matrix is constructed. Thx to you!

    • @javidx9
      @javidx9  Před 5 lety +4

      No problem Kreshnik!

  • @tsraikage
    @tsraikage Před 2 lety +7

    i lost track of how many times i've watched this video series. 3d engines are my favorite field to practice with. even though i'm never able to fully recreate code on all platforms, its still so satisfying to listen to somebody's explanation who for sure knows subject so good even dummy like me can understand

  • @Grandalf3004
    @Grandalf3004 Před 4 lety +7

    Following along with this in java, and ive had no trouble keeping up so far. You're a great teacher. You're actually one of the only decent free teachers I've found. You're sitting down and telling me something in a language I've never even programmed in, and I understand it better than the guy using the same language as me and 15 more videos.

  • @rikittu
    @rikittu Před 3 lety +2

    I've always been fascinated how 3d graphics work but couldn't find a good video showing how to make it from scratch. I love that I found this video. Thanks for making it.

  • @jamesw242
    @jamesw242 Před 6 lety +590

    You could charge for these vids.. But i appreciate you not doing. I'm on long term sick and your videos help me do something useful with my time and to better myself

    • @javidx9
      @javidx9  Před 6 lety +216

      Hi James, I really appreciate what you are saying, and it pleases me because youve captured the essence of my entire OneLoneCoder initiative in one personal example. Thank you!

    • @starinsky2873
      @starinsky2873 Před 5 lety +1

      @@javidx9 Thanks programmer!
      Matrix is useful though.

    • @bonbonpony
      @bonbonpony Před 5 lety +17

      @@javidx9 Those who charge for their courses apparently forgot how they learnt their stuff in the first place (from freely available resources). If they had to pay for their knowledge, they would most likely not have it today. Spreading your knowledge for free means that one day someone else will give you their knowledge for free too. And that's how this world should work. Unfortunately, I see that it is heading in the very opposite direction more and more every day ;/ (because of money-induced greed).

    • @bonbonpony
      @bonbonpony Před 5 lety +10

      @Trys10Studios You see, you fell into the same trap most people do, putting the cart before the horse, that is, money before the thing it is paid for. In a logical world, you would do something because you enjoy doing it, and if someone finds it useful, they reward you with some goods in return to support you and make sure you will do more of it. When you do it the other way around, that is, you demand money or else you won't lift a finger, you're planning your own disaster. Because then, if people don't want to pay you, you blame them for being unfair or ungrateful, or blame yourself / your product for not being good enough, etc. Money takes out all the fun from life, because now you're starting to "work for money", and if you don't get money, you start to think that it is pointless to do something that you would otherwise do with pleasure out of pure boredom :q If people worked that way all the time (that is, do nothing unless someone pays them), no one would ever invent anything, created any piece of art, etc.
      And if you think about it somewhat deeper and on a broader scale, who do we work for, really? We work for each other, exchanging money in circles. So why do we really need that money? Couldn't we just work for each other directly, without this additional burden? Well, we could. And we did, back then in the past, when barter was the only means of economy (as it is in nature in general). Originally, money was just another commodity that could be exchanged for other goods or services, because it had inherent value. But then the tricky banksters come up with an idea of forging fake money (bank notes) of no inherent value whatsoever and exchange them for real value on the market, draining all the goods from it and turning people into their clueless slaves. Now we don't really work for each other that much anymore - we work for THEM now, because when you track where all the currency (which is no longer true money) comes from, you will always end up in some bank. They created a system in which you HAVE TO work for them in order to get money for your life, otherwise they don't let you just live happily and do whatever you want.

    • @pubx2719
      @pubx2719 Před 5 lety

      @@javidx9 How to create a game like yourself

  • @CSPlayerDamon
    @CSPlayerDamon Před 5 lety +7

    There is one thing I have to say.. AWESOME! Advanced material like this, presenting both the theory and implementation are quite hard to find. Thank you!

  • @viirtuose.official
    @viirtuose.official Před měsícem +1

    Your channel is one of the internet’s gems. Thank you for your dedication, clarity, and passion. Far too many coding channels provide zero value according to Shannon's information theory-utterly predictable content-which is never the case with your videos. I always feel inspired simply watching you explore the infinite possibilities of programming. Many thanks, and cheers from France!

    • @javidx9
      @javidx9  Před měsícem +1

      Hey that's very kind of you! Keeps me going too, many thanks!

  • @OrangeDied
    @OrangeDied Před 2 lety +4

    The thing I like about this tutorial is how Javid explains the actual math behind it in an easy to understand way, so you actually learn about how it works instead of blindly copying code. Great tutorial!

  • @khrissxander
    @khrissxander Před 5 lety +14

    This is incredible. You continue to amaze me.

  • @renatobritto4096
    @renatobritto4096 Před 5 lety +20

    This is amazing. All that computational geometry being put to practice.

  • @BrisbaneStomp
    @BrisbaneStomp Před 3 lety +1

    I've been thinking about this and other programmes you've made for a while but never thought anyone would be making these kind of programmes. So happy I stumbled across your channel, thanks a lot and keep up the good work mate

  • @mojoofc9528
    @mojoofc9528 Před 5 lety +1

    I recently started learning the language, and this is my first language, this one video felt like 5 minutes, and I’ve learned soooo much. Going to the part two after the breakfast, I love you man

  • @joshlovesfood
    @joshlovesfood Před 3 lety +4

    This video is actually incredible, I am impressed with your skills, and you are a very strong & serious computer scientist

  • @astrahcat1212
    @astrahcat1212 Před rokem +4

    “We’re just gonna paint a lil struct over here……..that’s right, just a lil happy struct…” 😂😂😂😂

  • @dudubroder
    @dudubroder Před 4 lety +2

    Thank you so much! Omg I was so desperate in regards to learning C++ before watching this. You saved me! I know quite a lot of C# but never touched outside big game engines and C++. Now I watch your videos and everytime I have a doubt I stop it, open a tab and find the explanation before continuing. It is working great and also you are the programming bob ross

  • @summer_xo
    @summer_xo Před 2 lety +3

    javid invented computer science, video games, visual studio, 3d graphics and free world class tuition.

    • @javidx9
      @javidx9  Před 2 lety +3

      That's quite a list... I don't recall inventing all those things, but I do appreciate the thought and support. Thanks Shane!

  • @TheGoldenriff
    @TheGoldenriff Před 4 lety +18

    This actually gold. I have a degree in computer science and am employed in the field, always wanted to know deeply about graphics. This puts all the math I have taken into a realistic perspective and im finding myself going OHHH, I can take integrals and use trig identities to play around with the actual physics. I want to generate running water and I now have a new respect for the heavy game programmers!! Such a sick course this is man. Appreciate your effort! Im also glad this was theory based and not coupled with a bunch of assumptions!

    • @wanderingpalace
      @wanderingpalace Před 2 lety +1

      this is cool i cant even get into university because i yeeted my entrance exam with a bit of depression
      now im trying to catch up with stuffs like linear algebra to make my own programs but it is particularly overwhelming after all the wasted years
      support you and looking forward to see your game

    • @nevanncopeland8093
      @nevanncopeland8093 Před rokem +1

      @@wanderingpalace how'd it go. I hope you got into school and doing well.

  • @codecoderr7495
    @codecoderr7495 Před 5 lety +4

    Now this is what I call old school math-rasterizer exercise. Brilliant because you have the talent to teach fluently. Same as I. Cheers fellow coder.

  • @vladisoc2866
    @vladisoc2866 Před 4 lety

    This is pure gold. Your explanation about projection is incredible simple to understand! Thanks for sharing the knowledge!

  • @andrewbhamilton
    @andrewbhamilton Před 4 lety +2

    I have studied 3d maths for games and written a simple software renderer before
    I can safely say, that is the best explanation of the protection matrix I have ever seen. Extremely useful.
    Thank you javid

  • @MuradBeybalaev
    @MuradBeybalaev Před 4 lety +160

    21:51 "If I put some *imaginary numbers* next to this..."
    A mathematician gets excited.
    21:56 Basic *integers* are drawn.
    The mathematician gets disappointed.

    • @youssef2366
      @youssef2366 Před 4 lety +2

      Well in all fairness he didnt say lateral numbers

    • @violenceisfun991
      @violenceisfun991 Před 3 lety +4

      "Pi is exactly 3!"
      Sorry. I couldn't help myself

    • @user-dh8oi2mk4f
      @user-dh8oi2mk4f Před 3 lety +5

      @@violenceisfun991 that’s the fundamental theorem of engineering

  • @robertelder6155
    @robertelder6155 Před 5 lety +8

    Really cool video. Thank you for taking the time to explain the concepts. The visual descriptions were nice and helped a lot. You also moved slowly and it was easier to keep up with your content and explanations. Keep up the good work!! Just started this series.

    • @javidx9
      @javidx9  Před 5 lety

      Hi Robert, great to hear, thanks for your support!

  • @chikokishi7030
    @chikokishi7030 Před 4 lety +1

    I just found this series today. I instantly subscribed because ive been SO interested in this for years, and your videos seem very well made, thank you!

    • @user-ri2ms2mm7w
      @user-ri2ms2mm7w Před 2 lety

      My friends, search for your life purpose, why are we here?? I advise you to watch this series and this video 👇 as a beginning to know the purpose of your existence in this life czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
      czcams.com/video/7d16CpWp-ok/video.html

  • @dz-
    @dz- Před 2 lety +2

    Javidx9, your tutorials are fantastic! Thank you so much for them, and also for the magnificently documented olcPixelGameEngine.

  • @guacamolen
    @guacamolen Před 6 lety +12

    I was trying to find something on how to do this a couple of months ago. I'm glad I subscribed! Nice treat to see it.

    • @javidx9
      @javidx9  Před 6 lety +4

      Good stuff! Thanks Michael

  • @manuellehmann267
    @manuellehmann267 Před 6 lety +235

    Oh, my god. He just opened pandoras box :-D
    3D graphics is an interesting but sooooo complicated topic. Looking forward for upcoming episodes. :-)

    • @javidx9
      @javidx9  Před 6 lety +26

      Thanks donnerbrenn! It certainly does open up lots of opportunities for interesting videos

    • @starinsky2873
      @starinsky2873 Před 5 lety +15

      Next time when you play games you will think about furious developer.

    • @jax2059
      @jax2059 Před 5 lety

      Tro Ivas k

    • @jax2059
      @jax2059 Před 5 lety

      Tro Ivas ok

    • @bonbonpony
      @bonbonpony Před 5 lety

      Well, it's good to know what's in the box if you're gonna use it.

  • @Genciak
    @Genciak Před 4 lety +2

    I really enjoy this video and will watch through the entire series. Thank you for great job!

  • @santichulito
    @santichulito Před 4 lety

    Man i love you, your channel is everything i need and more, just starting to code but this is the stuff i'm most interest on, you have a lot of really good videos with very nice explanation to everything and i can't thank you enough for you work, love from Argentina!

  • @AaronBowley
    @AaronBowley Před 5 lety +14

    Seriously , this is the kind of content I yearn for . True fundamentals

  • @BkSMedia
    @BkSMedia Před 2 lety +4

    As a student in their 3rd year of a degree program, I'm so thankful that my poor knowledge of Calculus, but somewhat decent understanding of Object Oriented Programming is paying off. Lots of really familiar concepts that have clicked and made me go "ahhh so that's what the lecturer was getting at!". It helps that I also used to 3D model game assets as well. Love that you've really gone to the absolute basics which is what I needed!

  • @TrebleWing
    @TrebleWing Před 5 lety +2

    Great presentation. All this kinda code is way above my head (at the moment) but you are entertaining enough to keep watching and absorbing. Thanks for making these.

    • @blacksage81
      @blacksage81 Před 5 lety

      If you really want to learn to code, pick a language, write the most basic of basic programs. "Hello World" I'd recommend C++ since its old and there should be tons of resources and sample code available.

  • @canitbeapplied2500
    @canitbeapplied2500 Před 2 lety

    Awesome tutorial ! The amount of depth you go into with everything makes it easy to translate to other languages.

  • @daviddawkins
    @daviddawkins Před 4 lety +5

    Such a good explanation of the projection matrix. Thank you.

  • @Kazdro009
    @Kazdro009 Před 6 lety +301

    11:49 Top 10 anime betrayals

    • @trevorthieme5157
      @trevorthieme5157 Před 5 lety +7

      LOL I guess that would be true for programmers!

    • @TheBypasser
      @TheBypasser Před 5 lety +4

      Guess it should read "all I want is my program to become my own hell;", yet "using namespace std;" is shorter to type so they substituted it ;)

    • @TheBypasser
      @TheBypasser Před 5 lety +1

      Tro Ivas, Not clear enough - should it be read as "no need to use global-scope #using", or, instead, "no reason to ignore it and keep typing std:: everywhere instead"? If the second option it is, then - think of it - it is just four(4!) damn letters, if it feels too much the next logical step is moving on to non-commented code with single-character variable names ;)

    • @Este44fr
      @Este44fr Před 4 lety +3

      @@TheBypasser std::experimental::filesystem::path myPath;
      This is why you use "using namespace"

    • @TheBypasser
      @TheBypasser Před 4 lety +2

      ​@@Este44fr If used not on a single occasion, the secret spell:
      #define STD_EFS_PATH std::experimental::filesystem::path
      ;)

  • @adibattie9619
    @adibattie9619 Před rokem

    5 years later and this video is still top notch. I followed along a few years ago and got it working in C++. I revisited this today because I wanted to try and get it working using my own programming language, which already has C++/SDL bindings. I wanted to get some 3D action happening but with OpenGL I would need to spend at least a week writing GL bindings, but with this approach I can get some basic 3D stuff happening using only the SDL API I've already written. Amazing stuff, thank you Javid!

  • @fly7188
    @fly7188 Před rokem

    thanks, your illustrations and explicit coding style really help illustrate the different components and concepts for this build. i learned much.

  • @ChillBuilds
    @ChillBuilds Před 4 lety +13

    I'm not sure how much preparation you put in to your videos, but I would guess it's quite a bit because your explanations are well organized and clear of cluttered language. I appreciate that. Well done.

    • @javidx9
      @javidx9  Před 4 lety +3

      Thanks Chill Builds!

    • @charlesdjones1
      @charlesdjones1 Před 7 měsíci

      I agree. Now go watch a tutorial by King Gath if you want to see the exact opposite, it's impossible to follow along with anything he teaches with all the sidebar stuff.

  • @josephmills1104
    @josephmills1104 Před 5 lety +10

    This is just incredible, man. Wow, thanks for this!

  • @erickalvarez6899
    @erickalvarez6899 Před 5 lety +2

    You're awesome!! Thanks for these series. I'm learning a lot watching them!!

  • @christianmoss9196
    @christianmoss9196 Před 3 lety

    Just came across this and your channel, amazing stuff, as a modern day game dev even just watching the videos helps me understand what my abstracted game engine is doing under the hood

  • @uploadschedule
    @uploadschedule Před rokem +3

    When he said that he will talk about the theory and the mathematical stuff at 1:06 i knew it was the right tutorial.

  • @dynamagon
    @dynamagon Před 2 lety +2

    Thanks for the video! You are a very great teacher, and especially great since this video is free. I'm following along in C with a 2D graphics pixel plotting engine I wrote from scratch!

  • @Windeycastle
    @Windeycastle Před rokem +1

    Thank you very much for this series! I'll happily code along and see where I end up

  • @SE45CX
    @SE45CX Před 5 lety

    What I like about your style is that you present this in a general DIY approach. Without the annoying snobbish attitude what you see so often.

  • @vinniciusrosa8284
    @vinniciusrosa8284 Před 4 lety +14

    Things I have noticed here: 1) I have to study math 2) I have to watch this 500 times to understand the main idea. 3) I have to try it 20 times a day to get there. 4) Ok, it is hard, but this is amazing!

    • @DanielCoutoF
      @DanielCoutoF Před 3 lety

      if u cant understand watching it three times, forget about it, your head isnt for programming, specially if u want to work in the field, your productivity will suffer a lot if you take too much time to grasp new concepts.

    • @vinniciusrosa8284
      @vinniciusrosa8284 Před 3 lety +7

      @@DanielCoutoF You are not a programmer. Maybe you feel like "I am the best of my class". I have worked on some big advanced systems that you cannot even imagine. I am talking about REALLY understand 3d. I know linear álgebra and a lot of complicated things. Please, get out. You didn't understand what I said.

    • @DanielCoutoF
      @DanielCoutoF Před 3 lety

      @@vinniciusrosa8284 stop replying to comments and go watch the same video for the 100th time.

    • @javidx9
      @javidx9  Před 3 lety +13

      Hmmmm. The guy just said he didn't understand something. At least he can admit when he doesn't. That's an underestimated skill. So let's keep things a little calmer eh?

    • @nettoribeiro4267
      @nettoribeiro4267 Před 3 lety +2

      @@DanielCoutoF "if you can't understand it watching it three times, forget about it, your head isnt for programming"
      That's not how it works. That would be the same as telling a kid who just started to play piano to go and learn an entire symphony orchestra by himself. He wouldn't be able to do it, because he needs to learn the fundamentals about music and try simpler songs first.
      This applies to programming too, in the case of 3D, maybe your background in math is weak and you need to work on it.
      That said, rewatching the video is a good thing ,every time you watch it, you will see things in a new and clear way. Once you grasp a topic, your mind will be free to worry about the other ones you were to busy to care before.

  • @duality4y
    @duality4y Před 3 lety +1

    I love these videos i never just copy the code I watch the video and try to undestand the concepts and then develop my own solutions which often happen to end up looking like the ones in the videos!

  • @RoboMarchello
    @RoboMarchello Před rokem +1

    This tutorial is so helpful with your math explanations, so easy to understand 3d with your videos compared to others. Thank you so much!

  • @spicytuna08
    @spicytuna08 Před 6 lety +18

    final result is awesome.

  • @saeed6296
    @saeed6296 Před 3 lety +5

    I tried to do this projection in a lame way when I was in high school, this video brings back those memories 😭 you're awesome

  • @thyandyr7369
    @thyandyr7369 Před 5 lety +1

    Oh wow just what I always wanted to see! Exiting hope it's more than just one episode!

    • @javidx9
      @javidx9  Před 5 lety

      Lucky you, there's 3 more and some more this year XD

  • @Pedozzi
    @Pedozzi Před 5 lety

    you are such a smart person. I studied industrial design, and i really appreciated this serie, even if i don't know how to code it is a great way to understand at least what 3d graphic (3D on 2D) engines do on a macro level. Thanks

  • @johnjackson9767
    @johnjackson9767 Před 6 lety +34

    It'll be interesting to see how far you can get with a software renderer using your framework. It's also great that you're showing the math and concepts behind this - it's surprising to me ( and sad, frankly ) that even in industry there are devs who simply don't know this stuff.

    • @javidx9
      @javidx9  Před 6 lety +11

      Hi John, I agree - it's all very well copying code parrot fashion to get a job done, but when it goes wrong knowing how to fix it is where the real talent lies. There will of course be some topics I can't directly cover using a command prompt alone, and as my colour and texture resolutions are a bit low, some techniques we take for granted on GPUs will simply not be applicable.

  • @ankursharma4827
    @ankursharma4827 Před 5 lety +8

    Did I ever tell you this, "You are just awesome, man!" :-)

  • @darklaker
    @darklaker Před rokem +2

    This is something I made myself during a computer graphics subject some years ago on my computer science degree and It was hard to make it work without help or a simple explanation, I could handle solid objects drawing with polygon shading using the normals but I didn't go further to use textures or other advanced lightning like phong shading or raytracing.
    Even if there are much more advanced libraries and 3D engines It's important to understand where all that come from and make it work from scratch is much more satisfying. A tutorial like this would be a life saver for me those years, I haven't seen something like this before. Thanks for sharing!

  • @ffabiang
    @ffabiang Před 2 lety

    Thank you so much for this video, I have been learning more about how 3D engines work and this was just what I needed! Greetings from Peru!

  • @EximiusDux
    @EximiusDux Před 6 lety +18

    Ah. thank you for the projection matrix and its explanation. I once made something similar to this, but i never wrapped my head around the Matrix system. meaning: i was staring myself blind at the concept of it.

    • @javidx9
      @javidx9  Před 6 lety +5

      No problem TriCore, glad it helped!

  • @farazzaidi944
    @farazzaidi944 Před 5 lety +243

    Start of Video - "I'm gonna make a Game Engine myself!"
    After 15 mins - "Well, why waste the efforts of those who've already done this mathematics..."

    • @BlakeKane
      @BlakeKane Před 4 lety +2

      It is a coding practice and a challenge.

    • @zephyr7
      @zephyr7 Před 4 lety +13

      @@BlakeKane he was making a joke

    • @marsireteng3574
      @marsireteng3574 Před 4 lety

      brah thats me right now

    • @madscientist7430
      @madscientist7430 Před 4 lety +1

      @@username6338 #ItsACodingPracticeAndAChallengeGang

    • @aleisterlavey9716
      @aleisterlavey9716 Před 4 lety +2

      "I wanna learn trough experience" perfect excuse for every fail you do.

  • @Poeterish
    @Poeterish Před 3 lety

    Pleeeeease never stop making videos on CZcams !
    Thank you so much for your effort !

  • @mr_noodler
    @mr_noodler Před rokem +1

    This guy is so awesome because the more I practice programming, every time I watch this I understand more and realize how much he really knows what he’s talking about. Javidx9 is well educated and experienced

    • @Agent56000
      @Agent56000 Před 4 měsíci

      Any advice for a complete beginner

  • @aradarbel4579
    @aradarbel4579 Před 6 lety +4

    just found your channel, and saw this video! this is exactly what I was looking for! You have a new sub ;D

  • @joaquimspeck
    @joaquimspeck Před 5 lety +7

    This is awesome! Nicely presented!

    • @javidx9
      @javidx9  Před 5 lety +1

      Thanks joaquimspeck!

  • @arsnakehert
    @arsnakehert Před 2 lety

    This is probably the best explanation of projection matrices I’ve seen on the internet

  • @AlexGarcia-cr5st
    @AlexGarcia-cr5st Před rokem +1

    Love your tutorials man. You are a true computer wizard.

  • @JimmyJohanes
    @JimmyJohanes Před 3 lety +39

    can you imagine the source code complexity of program like 3ds max, blender ..

    • @javidx9
      @javidx9  Před 3 lety +40

      Well i believe blender is open source, so no need to imagine it! Go check it out!

    • @javidx9
      @javidx9  Před 3 lety +33

      github.com/blender/blender

    • @theslavegamer
      @theslavegamer Před 3 lety +3

      @Christian Weissmuller like a 3rd of the program is managing the interface, there's so many hotkeys for re-ordering and hiding UI elements. I love blender

  • @lucs0091
    @lucs0091 Před 6 lety +14

    I learned by heart all the algebra formulas to pass an exam, but never understood them... until now.

    • @javidx9
      @javidx9  Před 5 lety +9

      Good Stuff Lucas, i learn maths much quicker if I have a practical use for it.

  • @reubenbridges
    @reubenbridges Před rokem +1

    Feels like I just watched a classic PBS show on programming, late 80s early 90s. Excellent video.

  • @derek2593
    @derek2593 Před 2 lety +1

    I was bored in algebra class, so I decided it would be cool to draw lines that make a parabola. 10 minutes later, I realized I had stumbled into the basics of 3D graphics/surfaces.

  • @fckyo333ujhjjkrrrr
    @fckyo333ujhjjkrrrr Před 6 lety +4

    Thank you Javid, very cool

  • @gettanned-foureyes2417
    @gettanned-foureyes2417 Před 6 lety +10

    This is What I acutually want to know !
    Hope The Next Video will be Uploaded Tommorow .

    • @javidx9
      @javidx9  Před 6 lety

      lol, sadly it wont be tomorrow - but I hope to show quite a complete system by the end of the series.

    • @gettanned-foureyes2417
      @gettanned-foureyes2417 Před 6 lety +1

      Though it won't be tommorw ,
      it can be uploaded 2 hours later ( exactly not tommorw but today ) .
      ... Sorry , What I wanna say is I like your videos as much as I think so .
      If I can push Like 3.14 times or 2.718 times ...
      But CZcams allow me to push it only once .

  • @Dhurgan
    @Dhurgan Před 3 lety

    Simple and straightforward, think I need to go back and watch your gameengine works :)

  • @VS-rv5xh
    @VS-rv5xh Před 4 lety +2

    thanks to you i finished my bachelor in IT since I really found my love for programming again

  • @pendergastj
    @pendergastj Před 6 lety +7

    Just what ive been waiting to see! Awesome!

    • @javidx9
      @javidx9  Před 6 lety +2

      Hi jamie i hope it lives up to expectation!

  • @kennyotsu4357
    @kennyotsu4357 Před 5 lety +3

    I love ur videos, even when i totally cant understand what the heck is going on here, but i love ur videos :3

    • @javidx9
      @javidx9  Před 5 lety

      lol, thanks Deku, if you get stuck shout out on the discord server, people willing to help on there!

  • @scritch9549
    @scritch9549 Před rokem

    You’re content is absolutely amazing man. Absolute legend

  • @dokoweio988
    @dokoweio988 Před 4 lety

    nice framework for this, finally some engine intuition and beginning anchors for this subject.....this vid is a Gem!!!

  • @mattstirling6317
    @mattstirling6317 Před 5 lety +15

    "Have a think about subscribing"
    I thunk, and I subbed.

  • @3DSage
    @3DSage Před 6 lety +8

    Ahh you beat me to it! Haha great video as always.

    • @Pridetoons
      @Pridetoons Před 6 lety +2

      3DSage I wish you'd post some Gameboy Advance tutorials on your channel.

    • @Pridetoons
      @Pridetoons Před 6 lety +2

      Also from watching your channel I heard you want to make a Game Console. I have two books to recommend to you.
      1) The Black Book of Game Console Design from Andre LaMothe
      2) The ZX Spectrum ULA
      Also check out the UZEbox.

    • @javidx9
      @javidx9  Před 6 lety +3

      Lol oh dear, thanks 3DSage, clues in the name though right? XD it would be interesting to see this done from a more embedded systems perspective.

    • @3DSage
      @3DSage Před 6 lety +1

      Yes I will do that sometime!

    • @3DSage
      @3DSage Před 6 lety +1

      Yes It would be a dream of mine to make my own game console. It would be incredibly simple but even that would be amazing to me. Thank you for the books!

  • @XoIoRouge
    @XoIoRouge Před 10 měsíci

    I've been following other guides to make a rotating cube on screen using quads and a much simpler projection matrix - it only worked when no one actually looked at the math (a varied rotation to all thetas would be hard for a human to naturally track as "correct"); but when I wanted to give players control over the rotation, or interact with it more, it fell apart very fast.
    I'm going to restart my project from the ground up following THIS method, thank you so much for going more indepth into the math and the use of triangles instead of just points!

  • @TheDonaldskates
    @TheDonaldskates Před 2 lety +2

    you explain this very well and you make it seem easy when in reality this takes a lot of patience

    • @javidx9
      @javidx9  Před 2 lety +3

      That's the curse of CZcams videos. Never assume anything I do on screen takes 30 minutes. Editing makes it look that way, but in reality it's much longer. The objective of my videos is to expose people to the things they may need to know about to achieve a specific goal.

  • @alexanderhugestrand
    @alexanderhugestrand Před 5 lety +9

    I liked this video without even watching, since this kind of programming is where I come from. An idea I've implemented myself: Skip the whole concept of a "near" plane for clipping the polygons and clip them against the view frustum instead. That way you can get infinitely close to a wall without seeing anything clipping. In the very unlikely case where the clipped polygon gets a point exactly at the origin, you can skip that polygon altogether to avoid division by zero - the player wouldn't see the polygon anyway, since the camera is exactly in its plane.
    If done right, so that you can trust the clipping algorithm, you'll be able to get rid of a bunch of if-statements in the inner rasterization loops (that's an optimization) where you normally would clip the projected triangle against the screen edges.
    Yet another idea to do all this but still render things on the GPU: Write the rasterization in OpenCL or CUDA.

    • @javidx9
      @javidx9  Před 5 lety +5

      Hi and thanks Alexander. I think there are several ways to interpret near plane clipping - I do move on to frustum clipping later in the series. I spent some time once rendering triangles with CUDA. The rendering bit is easy, but the scene partitioning bits to make sure the right warps/groups are accessing the right structural data is a real pain.

  • @ILGiullareDiCorte
    @ILGiullareDiCorte Před 6 lety +5

    Very thanks! I am a computer science student and i love all your projects but this, is awesome! Thanks for the time that you spend for share your knowledge!

    • @javidx9
      @javidx9  Před 6 lety +2

      No problem! Thanks for your kind words and support!

  • @father_jordan
    @father_jordan Před 2 měsíci

    THANK YOU for this. I've been getting into development for the Playdate handheld using their C API, and this just helped me write a basic 3D renderer. I'll continue on in the series but wanted to say thanks, this is still *very* relevant!

  • @Destroyer19941995
    @Destroyer19941995 Před 3 lety

    LOVE the projection matrix explanation!!

  • @Levigumba
    @Levigumba Před 5 lety +10

    "Now we won't get quite that far in this video..."
    *checks vid length*
    Oh boy do I have some catching up to do

  • @spjewkes
    @spjewkes Před 6 lety +7

    Nicely done, David. I’m looking forward to the last episode of this series where you demonstrate a spinning, textured Vimto can :)

    • @javidx9
      @javidx9  Před 6 lety +6

      Lol Steve, you know what? Challenge accepted!

  • @gamersunite9026
    @gamersunite9026 Před 3 lety

    jesus christ, i have basically no experience with this and im understanding all of it. great job dude, you're the best

  • @otacilioribeiro8944
    @otacilioribeiro8944 Před 4 lety +2

    this is awesome, you are a excellent at what you do and i love your way of explaining stuff;
    I spent some good time pondering about this video and i am amused. Thank you!
    By the way, i noticed that the comments of top and bottom triangles are switched, the bottom is actually the one initialized and drawn first