Bresenham's Line Drawing Algorithm

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 522

  • @Raddaya
    @Raddaya 5 ปีที่แล้ว +264

    Sir, last sem due to you alone I survived algorithms. Now it seems you will help me survive Graphics as well. I desperately wish all teachers could explain like you!

    • @abc-ym4zs
      @abc-ym4zs ปีที่แล้ว +3

      Bro i have sem exams can you suggest some good youtube channel for computer graphics please reply bro i don't know anything for exam

    • @settings_json
      @settings_json ปีที่แล้ว +1

      @@abc-ym4zs th-cam.com/play/PLYwpaL_SFmcAtxMe7ahYC4ZYjQHun_b-T.html

    • @wolf6221
      @wolf6221 ปีที่แล้ว +2

      ​@@abc-ym4zsdid you found any?

    • @shantanu9879
      @shantanu9879 ปีที่แล้ว

      @@abc-ym4zs 5 minutes engineering is a great channel for studying CG

    • @067-anurag9
      @067-anurag9 8 หลายเดือนก่อน

      ​@@abc-ym4zs1$11

  • @bernarmay1950
    @bernarmay1950 5 ปีที่แล้ว +33

    This is the best so far I have seen on Bresenham's algorithm explanation. You deserve an accolades👍

  • @ifargantech
    @ifargantech 5 ปีที่แล้ว +173

    I am sorry on 35:56 ... P=2dy-dx.... not p=2dx-dy .... This lecturer is greater than attending my normal class. Thank you... Also you are my great lecturer of Analysis of Algorithm. I have knowm TIME COMPLEXITY because of you only... THANK YOU!!

    • @jpsilver3510
      @jpsilver3510 5 ปีที่แล้ว +2

      This took me 3 hours to figure out ':D

    • @infotainment7123
      @infotainment7123 4 ปีที่แล้ว +6

      this is a error right? its always P=2dy-dx

    • @sheetaljain3569
      @sheetaljain3569 4 ปีที่แล้ว

      After 35;56 ,we will take dy,ex in if and else block as well. Because sir there is no variable in the algorithm as you have written in algorithm in if and else block ∆x, ∆y

    • @justforfun4680
      @justforfun4680 4 ปีที่แล้ว

      Yes, it is an error.

    • @nsptech9773
      @nsptech9773 4 ปีที่แล้ว +7

      Yes! There was an error but if you take a look at 38:06 the code is corrected.

  • @ritvikdayal3735
    @ritvikdayal3735 4 ปีที่แล้ว +14

    People like you are blessed with a beautiful skill, "Teaching". Thanks for being such a good teacher to all of us.

  • @MindBodySoulOk
    @MindBodySoulOk 4 ปีที่แล้ว +9

    Dr. Breshingham was impressed with my graphics programming back in the late 80s. He came to visit the IT department at Coastal Carolina. Never forgot that. He lives in Rock Hill or did at the time.

  • @bryphi77
    @bryphi77 5 ปีที่แล้ว +127

    I have learned so much from you... cant thank you enough!
    I got your c++ course a while back, and just got your data structures course now. Cant wait to start :)

    • @princegirish1991
      @princegirish1991 5 ปีที่แล้ว

      Where did u get the course from

    • @gadswez
      @gadswez 5 ปีที่แล้ว

      @@princegirish1991 See the description.

    • @mryup6100
      @mryup6100 5 ปีที่แล้ว +1

      @@SATYAMYADAV-xy3mx support Mr. Bari buddy

  • @kaushilkundalia2197
    @kaushilkundalia2197 5 ปีที่แล้ว +245

    Algo explaination starts at 14:46 . Thank me later

  • @shivkrishnajaiswal8394
    @shivkrishnajaiswal8394 2 ปีที่แล้ว +7

    Great explanation. Thanks.
    @24.31 you should not skip that term as it will be needed to define the sign. However, in calculation of P[k+1], you will not need it as it is defined in terms of P[k] and P[k] takes care of this constant term.

  • @shivamkhare9472
    @shivamkhare9472 2 ปีที่แล้ว +5

    sir, literally you are the most amazing teacher of all the teachers I have seen on youtube.thank you very much sir for your efforts

  • @raghavendrabhadauria5426
    @raghavendrabhadauria5426 4 ปีที่แล้ว +1

    you are the only one who explaind derivation of breshanham algorithm on youtube even my university teacher didnt explained it

  • @sanjanaattanayake4231
    @sanjanaattanayake4231 9 หลายเดือนก่อน +1

    These explanations are so clear because of the background order you follow Sir.
    Once we learn from you, we are less likely to forget because we know "why" it was done :)
    Thank you very much!

  • @laskdjf3880
    @laskdjf3880 5 หลายเดือนก่อน +1

    I've been frustrated with this concept for a bit, but you're explanations are fantastic. Thank you!!!

  • @rupambose4830
    @rupambose4830 4 ปีที่แล้ว +5

    Best explanation of Bresenham's algorithm I have ever heard.

  • @RossMcgowanMaths
    @RossMcgowanMaths ปีที่แล้ว +3

    Fantastic. I thought I was going to have to derive this by myself as I only seen superficial descriptions on other videos. A full and complete derivation with example. Nice. Very pleased that I found this video.

  • @nahidaahmed8224
    @nahidaahmed8224 5 ปีที่แล้ว +114

    Sir ,pls make more videos on computer graphics ...

  • @refatkhan7972
    @refatkhan7972 5 ปีที่แล้ว +2

    The best teacher i have ever seen,the way you explain is awsome.

  • @parikshithreddyvempati4895
    @parikshithreddyvempati4895 5 ปีที่แล้ว +4

    I love you sir Got good marks in DAA all thanks to your videos

  • @abinayaragunathan8399
    @abinayaragunathan8399 4 ปีที่แล้ว +7

    Yesterday only I saw ur DDA line drawing algorithm video for the first time.. Ur way of explanation helps me to understand the concept well.. Thank you sir.. Pls make more videos based on circle and ellipse generating algorithms, 2D geometric transformations, matrix representations, 2D viewing in graphics..

    • @shairyasharma9506
      @shairyasharma9506 2 ปีที่แล้ว

      yes

    • @abc-ym4zs
      @abc-ym4zs ปีที่แล้ว

      Bro do you find any good youtube channel for computer graphics please tell bro I have sem exams

  • @AswinMuralee
    @AswinMuralee 5 ปีที่แล้ว +4

    Dear sir I have cleared my exams after taking lectures from ur videos Thank you so much sir...😀

  • @Sharmii25
    @Sharmii25 หลายเดือนก่อน +1

    i'm watching this in 2024... and really grateful for every word in your explanation sir my frustration just got away , !!!!

  • @ronaldtamsar
    @ronaldtamsar 3 ปีที่แล้ว +1

    Nothing clear explanation like this ever seen, good job sir

  • @rainajavid4716
    @rainajavid4716 5 ปีที่แล้ว +3

    sir you are really great
    especially your way of explanation i haven't seen anyone like you on youtube

  • @underwaterdol613
    @underwaterdol613 3 ปีที่แล้ว +2

    One of the best explanations and instructors in the web. He has additional C++ courses and algorithms in C++ courses which are one of the best in the net.

  • @ashamalkani
    @ashamalkani 3 ปีที่แล้ว +3

    Sir I understood the DDA algorithm. Thanks a lot. And wishing you a happy Teachers Day.

  • @aakashkumarsingh4840
    @aakashkumarsingh4840 4 ปีที่แล้ว +21

    28:51 I have a doubt , instead of " if (Pnext - Pk

    • @jawaheerrayhaan9557
      @jawaheerrayhaan9557 4 ปีที่แล้ว +1

      I literally scrolled down to see this!!

    • @praveensharma4014
      @praveensharma4014 2 ปีที่แล้ว +1

      You're correct. He should have given this clarification. Otherwise it's very confusing. Also at 29:41 it should be Pk >= 0 instead of P next - Pk >= 0.

    • @thecrazygamer7334
      @thecrazygamer7334 2 ปีที่แล้ว

      Imo we will check pk for first operation but after that We will pk+1-pk

    • @brandon.h9624
      @brandon.h9624 ปีที่แล้ว +2

      @@praveensharma4014 I took like 1 hour to get around how Pnext - Pk < 0. I think he was trying to say, Pnext - (pk if less - 0) and Pnext - (pk if greater or equal to 0).

  • @aakura
    @aakura 5 ปีที่แล้ว +9

    MORE CONTENT ON COMPUTER GRAPHICS NEEDED!!! EITHER AS UDEMY COURSE OR TH-cam VIDEO.

  • @SatishKumar-bs8dc
    @SatishKumar-bs8dc ปีที่แล้ว +1

    Best explanation ever for bresenham’s algorithm.

  • @sohelferdous2599
    @sohelferdous2599 5 ปีที่แล้ว +2

    This man is owsome Singham....full of knowledge...

  • @lalankarna8253
    @lalankarna8253 4 ปีที่แล้ว

    sir, no one can teach like u. thanks God.. to give us teacher like u......

  • @nitukiran5833
    @nitukiran5833 3 หลายเดือนก่อน

    The views are more than the likes, why is this so?? Can't we just like for his efforts?
    I found it useful sir.Thank you for your efforts!! ❤

  • @ernestghansah4402
    @ernestghansah4402 2 ปีที่แล้ว +2

    Thank you, sir. I now understand the DDA algorithm. Your explanation will help me get an A in computer graphics.

  • @sarastemkar7835
    @sarastemkar7835 4 ปีที่แล้ว +1

    Thing is i am really enjoy your lecture so please teach everything you learn in your entire life

  • @devanshusachdev9190
    @devanshusachdev9190 5 ปีที่แล้ว +5

    Sir you are outstanding!!!
    You made it crystal clear...thank you so much for putting your efforts.😊

  • @samlinus836
    @samlinus836 ปีที่แล้ว

    You're a lifesaver sir. The clear cut xplanation ever. Thank u much sir

  • @ROBINSON_1995
    @ROBINSON_1995 5 ปีที่แล้ว +6

    *Thank you so much...now i clearly understood about Bresenham's Algo.* 👍😍

  • @franekbaron9494
    @franekbaron9494 11 หลายเดือนก่อน +1

    28:29 Why Pk+1 - Pk < 0 means we stayed on the y value.Why it means that we were not incrementing? I cannot catch that. Why didn't u write that if Pk < 0 then we do something and if Pk > 0 then we do something. What is about this Pk+1 - Pk < 0?

  • @priyathakur79
    @priyathakur79 3 ปีที่แล้ว +1

    this is just awesome, finally, i understood an algorithm, and if I understood then anybody can. thank you so much.

  • @itcoolboy
    @itcoolboy 3 ปีที่แล้ว +2

    Sir, I am interested in computer graphics. I love your lecture very much. Your lecture is very comprehensive and easy for me to understand. Please keep on making similar video, thanks!!!

  • @arunasengar4991
    @arunasengar4991 4 ปีที่แล้ว +1

    Sir very clear and detail explanation. Thankyou for explaining algorithm in such an easy way.

  • @esraelbizuneh9756
    @esraelbizuneh9756 2 ปีที่แล้ว +1

    amazing tutor and amazing teacher Ihave ever seen thanks sir from Ethiopia

  • @qotaibai5112
    @qotaibai5112 5 ปีที่แล้ว +3

    Hey, i am studying Virtual Reality and you helped me with graphics do much.. thanks ❤

  • @AlgoRhythmsWithAyush
    @AlgoRhythmsWithAyush 2 ปีที่แล้ว +1

    At 31:14 why are we saying if Pk=0 for the lower equation, when it actually depends on the difference of Pk+1 and Pk?

  • @yyliu0907
    @yyliu0907 7 หลายเดือนก่อน +1

    from 24:18 there appears to be a redundant explanation about constant which confused me.
    P[k] needn't change at all.
    and if condition of 29:46 should be just whether P[k] is negative or positive to be clear.
    overall, thank you for your video.

  • @pushpraj853
    @pushpraj853 4 ปีที่แล้ว +1

    Lecture was great Sir.
    Thank you for making our B.Tech. Easy.

  • @TibebuKejela-md5mz
    @TibebuKejela-md5mz ปีที่แล้ว

    i have't seen ever like you ,you have agreat teaching skill

  • @vigneshwaran568
    @vigneshwaran568 4 ปีที่แล้ว +1

    give medal to this great man................................................................

  • @naisha_budhu
    @naisha_budhu 2 ปีที่แล้ว

    The best explanation I've found

  • @suyash.01
    @suyash.01 4 ปีที่แล้ว +1

    May god bless this teacher! So much valuable content for free! Thanks! Thanks!

  • @perplexedbot
    @perplexedbot 3 ปีที่แล้ว +1

    you're saving my semester

  • @dvyadav2307
    @dvyadav2307 9 หลายเดือนก่อน

    Completly understood the algorithm, thank you very much sir ❤

  • @shamimsarker839
    @shamimsarker839 2 ปีที่แล้ว

    Blessed are those who are your students. Why my university teachers are not like you?

  • @swapnilraut1858
    @swapnilraut1858 3 ปีที่แล้ว +1

    Thankyou sir for explaining in such a simple way..

  • @berkealgul2503
    @berkealgul2503 4 ปีที่แล้ว

    Sir thank you for straightforward explanation with good english speaking. i subbed to your channel

  • @vinayakabegari7724
    @vinayakabegari7724 5 ปีที่แล้ว +1

    Very good job sir. It's very easy to learn while ur teaching. Thank you sir.

  • @kaursingh637
    @kaursingh637 4 ปีที่แล้ว

    sir u r the best on algorithms

  • @nathancannell6272
    @nathancannell6272 11 หลายเดือนก่อน

    Thank you very much sir, I can now pass my computer class sir. Thanks sir.

  • @vedantshinde3717
    @vedantshinde3717 4 ปีที่แล้ว +1

    Excellent
    Your teaching is simply perfect.

  • @KushG420
    @KushG420 4 ปีที่แล้ว +1

    At 28:30
    It should've been Pk which you should be checking for less than 0 or not right anyone?

  • @harshdhawale2669
    @harshdhawale2669 3 ปีที่แล้ว

    9:20 what a perfection man !!!!!

  • @nikhilhaspe2734
    @nikhilhaspe2734 3 ปีที่แล้ว +1

    Excellent Exlplanation on entire YT

  • @laylaDoughsAreolas
    @laylaDoughsAreolas ปีที่แล้ว

    Best teacher ever , forever grateful ❤

  • @devyani_jain2000
    @devyani_jain2000 3 ปีที่แล้ว +5

    This was very helpful and easy to understand video...thankyou sir❤. Can you plz make a playlist on computer graphics and multimedia subject. I literally understood the algorithm in one go..🙌🙌

  • @AyshaFilms
    @AyshaFilms 2 ปีที่แล้ว +1

    THANK YOU!!! Been struggling for so long, this made is clear and understandable

  • @rajeshrocky911
    @rajeshrocky911 5 ปีที่แล้ว +2

    Thank you sir it is very useful😳😇and it's very helpful for my exams thank u so much sir

  • @chandrakantjena3431
    @chandrakantjena3431 2 ปีที่แล้ว

    One of the best Teachers.

  • @zaidsaiyed6076
    @zaidsaiyed6076 5 ปีที่แล้ว

    Great..great...great....simple and amazing explaination....i did not get bored even 1 sec.....superbbb.

  • @DenisRizovBG
    @DenisRizovBG 4 ปีที่แล้ว +2

    Very helpful. I had to create a vision check system on a 2D grid on a game I was working on, based on this algorithm. First I tried with wikipedia, and found out that the pseudocode there is incorrect. This video helped me to understand how the algorithm works. Once I found out is was trivial to tweak it for all 4 octants. Thank you very much.

  • @vandanagoud2957
    @vandanagoud2957 5 หลายเดือนก่อน

    You are a very good teacher sir❤

  • @mdnazmulhaque3337
    @mdnazmulhaque3337 5 ปีที่แล้ว +1

    your lecture is very exclusive i have never seen such lecture.

  • @ulukbekhamitov6431
    @ulukbekhamitov6431 5 ปีที่แล้ว +2

    Thank you Abdul Bari! Your lessons are very useful.

  • @vintoncerf7562
    @vintoncerf7562 ปีที่แล้ว

    Again, I'm learning a computer science subject from an Indian guy. Thank you

  • @HarshitPR6644
    @HarshitPR6644 4 ปีที่แล้ว +3

    Sir you are a god sent for us, thank you sir 😭😭

    • @sagaralwani75
      @sagaralwani75 4 ปีที่แล้ว

      at 31:19 he said if pk < 1 we follow first one, but see as we know if pnext-pk < 0 we follow this, how pk be less than zero now...?
      have you understood this?

    • @suyashsharma2094
      @suyashsharma2094 4 ปีที่แล้ว

      @@sagaralwani75 same issue it should be Pk>0 for 1st one

  • @zidane6165
    @zidane6165 5 ปีที่แล้ว +6

    My professor abdul bari thank you so much for your hard work

  • @faizakim4998
    @faizakim4998 5 ปีที่แล้ว +6

    Sir pls make some vedios on midpoint circle drawing algorithm and midpoint ellipse drawing algorithm am really waiting for ur lecture in a short period of time

  • @mihirvora391
    @mihirvora391 4 ปีที่แล้ว +1

    Thank you soo much.U made the concept crystal clear..TYSM❤️❤️

  • @zhzh-y7h
    @zhzh-y7h ปีที่แล้ว

    This video is so great and easy to understand. Thank you!

  • @jpsilver3510
    @jpsilver3510 5 ปีที่แล้ว +2

    For anyone trying to figure out how to implement m > 1, here is a c++ implementation i created from the pseudo code on the wiki
    Just replace all the classes that's not found(like vector and color, these are classes i created)
    void DrawPane::renderLine(Vector2f a, Vector2f b, int color) {
    if(abs(b.getY() - a.getY()) < abs(b.getX() - a.getX())){
    if(a.getX() > b.getX()){
    renderLineLow(b, a, color);
    }else{
    renderLineLow(a, b, color);
    }
    }else{
    if(a.getY() > b.getY()){
    renderLineHigh(b, a, color);
    }else{
    renderLineHigh(a, b, color);
    }
    }
    }
    void DrawPane::clearCanvas() {
    std::fill_n(m_canvas_data, m_width * m_height, 0);
    }
    void DrawPane::renderPolygon(Vector2f f, Vector2f f1, Vector2f f2) {
    renderLine(f, f1, Color::RED);
    renderLine(f1, f2, Color::GREEN);
    renderLine(f2, f, Color::BLUE);
    }
    void DrawPane::renderLineLow(Vector2f a, Vector2f b, int color) {
    float dx = b.getX() - a.getX();
    float dy = b.getY() - a.getY();
    float p = 2*dy -dx;
    float i = 1;
    if(dy < 0){
    dy = -dy;
    i = -1;
    }
    int y = a.getY();
    for (int x = a.getX(); x < b.getX(); x++) {
    m_canvas_data[y * m_width + x] = color;
    if (p > 0){//Set bottom pixel
    p -= 2*dx;
    y += i;
    }
    p = p + 2*dy;
    }
    }
    void DrawPane::renderLineHigh(Vector2f a, Vector2f b, int color) {
    float dx = b.getX() - a.getX();
    float dy = b.getY() - a.getY();
    float p = 2*dx -dy;
    float i = 1;
    if(dx < 0){
    dx = -dx;
    i = -1;
    }
    int x = a.getX();
    for (int y = a.getY(); y < b.getY(); y++) {
    m_canvas_data[y * m_width + x] = color;
    if (p > 0) {//Set bottom pixel
    p -= 2*dy;
    x += i;
    }
    p += 2*dx;
    }
    }

  • @itz_me_imraan02
    @itz_me_imraan02 4 ปีที่แล้ว +1

    Best explanation on youtube💓

    • @sagaralwani75
      @sagaralwani75 4 ปีที่แล้ว

      at 31:19 he said if pk < 1 we follow first one, but see as we know if pnext-pk < 0 we follow this, how pk be less than zero now...?
      have you understood this?

    • @itz_me_imraan02
      @itz_me_imraan02 4 ปีที่แล้ว

      @@sagaralwani75 here he used it as a general term...by Pk he meant the value of Pk (decision parameter)

    • @sagaralwani75
      @sagaralwani75 4 ปีที่แล้ว

      But, how he decides pk

    • @itz_me_imraan02
      @itz_me_imraan02 4 ปีที่แล้ว

      @@sagaralwani75 at 31:19 when he said pk

    • @sagaralwani75
      @sagaralwani75 4 ปีที่แล้ว

      Waha nahi bata rakha h, ek baar wapis dekhiye aap

  • @javedshah2218
    @javedshah2218 5 ปีที่แล้ว

    Nice explanation... examples are explained very easily and carefully...

  • @rajareddy8184
    @rajareddy8184 5 ปีที่แล้ว +3

    Dear sir do compiler design tutorials and the way you explain is awesome

  • @awangprajaanugerah8231
    @awangprajaanugerah8231 2 ปีที่แล้ว +1

    Thanks you sir your video is so easy to understand

  • @maananth3434
    @maananth3434 4 ปีที่แล้ว

    SEMA sir... Your explanation is very much clear

  • @mrSolo295
    @mrSolo295 3 ปีที่แล้ว +1

    why Pnext - Pk?? Pnext will also be dependent on d1 and d2??

  • @prakashkhadka579
    @prakashkhadka579 5 ปีที่แล้ว

    sir you are really great .........your teaching influence every students........I was totally satisfied with your lectures......i hope you will make more videos in computer graphics too

  • @creativeconnect10
    @creativeconnect10 3 ปีที่แล้ว +2

    yey dekhne ke baad muje trigonometry easy lagne lgi hai

  • @nishchalvashisth1627
    @nishchalvashisth1627 5 ปีที่แล้ว

    as we can show on 37:39 that tou use in red color marker (D=delta) p=2Dy-Dx but in algo you use p=2dx-dy but as i know dx=x2-x1 while Dy=y2-y1

  • @mikeyao1868
    @mikeyao1868 ปีที่แล้ว

    Sir, your explanation is so clear that you could consider opening a specific course on computer graphics or digital image processing. ❤

  • @faisalmalik1433
    @faisalmalik1433 5 ปีที่แล้ว +7

    Thank you sir....for great explanation....plz make videos on other graphical theorem's like polygon filling and boundry fill algorithm.....plz sir...my exams are starting from 30 March.....plz help me sir....

  • @sashamakeev7547
    @sashamakeev7547 5 หลายเดือนก่อน

    Amazing lecture, would love to get explanation on how to transform the algorythm for octants other than first, but i guess i'll be able to do that myself :D

  • @vaishnavighode112
    @vaishnavighode112 4 ปีที่แล้ว +1

    Sir pls add bresehams circle drawing algorithm 👍your videos are so helpful to us to easily clear the concepts🙏

  • @anushka_5163
    @anushka_5163 2 ปีที่แล้ว

    @28:28 We are assigning the value for P next based on the difference of Pnext and P ,but before knowing the value of Pnext , how do we make the judgement, is this some sort of prediction method, where we backtrack on contradiction? I am very confused

  • @nitishkushwaha3821
    @nitishkushwaha3821 ปีที่แล้ว

    Kudos to you sir!! one doubt the algorith you wrote is only when m < 1 for m > 1 we have to do the same just y and x reversed. ?

  • @qwwert
    @qwwert 4 ปีที่แล้ว

    Sir you are super explaining unbelievable.

  • @sarangabbasi2560
    @sarangabbasi2560 2 ปีที่แล้ว

    algo is complex but this video made it simple

  • @Amisha_Nepal
    @Amisha_Nepal 3 ปีที่แล้ว

    Easily explained.....Thank you sir

  • @supersakib62
    @supersakib62 10 หลายเดือนก่อน

    As usual, great explanation.

  • @buntygupta7812
    @buntygupta7812 4 ปีที่แล้ว

    Sir your lectures are too good.. Thank you sir

  • @duaasaleem6631
    @duaasaleem6631 4 ปีที่แล้ว

    explanation outstanding sir .you make my day sir .stay blessed .

  • @anjanavattamparambath4179
    @anjanavattamparambath4179 2 ปีที่แล้ว

    Good explanation 👍🏻👍🏻thank u so much sir

  • @haniqx96
    @haniqx96 2 ปีที่แล้ว +1

    You are amazing. Thank u so much for this video ❤