Bresenham's Line Drawing Algorithm

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 522

  • @Raddaya
    @Raddaya 5 лет назад +255

    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 ruclips.net/p/PLYwpaL_SFmcAtxMe7ahYC4ZYjQHun_b-T

    • @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 6 месяцев назад

      ​@@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 лет назад +172

    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.

  • @bryphi77
    @bryphi77 5 лет назад +126

    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

  • @ritvikdayal3735
    @ritvikdayal3735 4 года назад +13

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

  • @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.

  • @MindBodySoulOk
    @MindBodySoulOk 4 года назад +8

    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.

  • @nahidaahmed8224
    @nahidaahmed8224 5 лет назад +112

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

  • @sanjanaattanayake4231
    @sanjanaattanayake4231 8 месяцев назад +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!

  • @kaushilkundalia2197
    @kaushilkundalia2197 5 лет назад +241

    Algo explaination starts at 14:46 . Thank me later

  • @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

  • @laskdjf3880
    @laskdjf3880 3 месяца назад +1

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

  • @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.

  • @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

  • @rupambose4830
    @rupambose4830 4 года назад +5

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

  • @raghavendrabhadauria5426
    @raghavendrabhadauria5426 4 года назад +1

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

  • @refatkhan7972
    @refatkhan7972 5 лет назад +2

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

  • @ronaldtamsar
    @ronaldtamsar 3 года назад +1

    Nothing clear explanation like this ever seen, good job sir

  • @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.

  • @rainajavid4716
    @rainajavid4716 5 лет назад +3

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

  • @aakura
    @aakura 4 года назад +9

    MORE CONTENT ON COMPUTER GRAPHICS NEEDED!!! EITHER AS UDEMY COURSE OR RUclips VIDEO.

  • @AswinMuralee
    @AswinMuralee 5 лет назад +4

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

  • @parikshithreddyvempati4895
    @parikshithreddyvempati4895 5 лет назад +4

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

  • @lalankarna8253
    @lalankarna8253 4 года назад

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

  • @sohelferdous2599
    @sohelferdous2599 5 лет назад +2

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

  • @SatishKumar-bs8dc
    @SatishKumar-bs8dc Год назад +1

    Best explanation ever for bresenham’s algorithm.

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

    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!! ❤

  • @ashamalkani
    @ashamalkani 3 года назад +3

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

  • @ernestghansah4402
    @ernestghansah4402 2 года назад +2

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

  • @esraelbizuneh9756
    @esraelbizuneh9756 2 года назад +1

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

  • @sarastemkar7835
    @sarastemkar7835 4 года назад +1

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

  • @aakashkumarsingh4840
    @aakashkumarsingh4840 4 года назад +20

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

    • @jawaheerrayhaan9557
      @jawaheerrayhaan9557 3 года назад +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).

  • @vigneshwaran568
    @vigneshwaran568 4 года назад +1

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

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

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

  • @arunasengar4991
    @arunasengar4991 4 года назад +1

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

  • @qotaibai5112
    @qotaibai5112 5 лет назад +3

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

  • @TibebuKejela-md5mz
    @TibebuKejela-md5mz Год назад

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

  • @yyliu0907
    @yyliu0907 5 месяцев назад +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.

  • @ROBINSON_1995
    @ROBINSON_1995 5 лет назад +6

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

  • @devanshusachdev9190
    @devanshusachdev9190 5 лет назад +5

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

  • @suyash.01
    @suyash.01 4 года назад +1

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

  • @vedantshinde3717
    @vedantshinde3717 4 года назад +1

    Excellent
    Your teaching is simply perfect.

  • @swapnilraut1858
    @swapnilraut1858 3 года назад +1

    Thankyou sir for explaining in such a simple way..

  • @priyathakur79
    @priyathakur79 3 года назад +1

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

  • @shamimsarker839
    @shamimsarker839 2 года назад

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

  • @pushpraj853
    @pushpraj853 4 года назад +1

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

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

    The best explanation I've found

  • @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!!!

  • @chandrakantjena3431
    @chandrakantjena3431 2 года назад

    One of the best Teachers.

  • @berkealgul2503
    @berkealgul2503 4 года назад

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

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

    Completly understood the algorithm, thank you very much sir ❤

  • @kaursingh637
    @kaursingh637 4 года назад

    sir u r the best on algorithms

  • @perplexedbot
    @perplexedbot 3 года назад +1

    you're saving my semester

  • @devyanijain6057
    @devyanijain6057 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

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

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

  • @vinayakabegari7724
    @vinayakabegari7724 5 лет назад +1

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

  • @creativeconnect10
    @creativeconnect10 3 года назад +2

    yey dekhne ke baad muje trigonometry easy lagne lgi hai

  • @rajareddy8184
    @rajareddy8184 5 лет назад +3

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

  • @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. ?

  • @zidane6165
    @zidane6165 5 лет назад +6

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

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

    Best teacher ever , forever grateful ❤

  • @ulukbekhamitov6431
    @ulukbekhamitov6431 4 года назад +2

    Thank you Abdul Bari! Your lessons are very useful.

  • @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.

  • @mdnazmulhaque3337
    @mdnazmulhaque3337 5 лет назад +1

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

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

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

  • @rajeshrocky911
    @rajeshrocky911 5 лет назад +2

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

  • @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

  • @nikhilhaspe2734
    @nikhilhaspe2734 3 года назад +1

    Excellent Exlplanation on entire YT

  • @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 3 года назад

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

  • @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?

  • @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....

  • @zaidsaiyed6076
    @zaidsaiyed6076 5 лет назад

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

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

    You are a very good teacher sir❤

  • @vaishnavighode112
    @vaishnavighode112 4 года назад +1

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

  • @sarangabbasi2560
    @sarangabbasi2560 2 года назад

    algo is complex but this video made it simple

  • @mihirvora391
    @mihirvora391 4 года назад +1

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

  • @harshdhawale2669
    @harshdhawale2669 3 года назад

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

  • @awangprajaanugerah8231
    @awangprajaanugerah8231 Год назад +1

    Thanks you sir your video is so easy to understand

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

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

  • @maananth3434
    @maananth3434 4 года назад

    SEMA sir... Your explanation is very much clear

  • @javedshah2218
    @javedshah2218 5 лет назад

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

  • @zhzh-y7h
    @zhzh-y7h Год назад

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

  • @franekbaron9494
    @franekbaron9494 9 месяцев назад +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?

  • @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

  • @bhojpurimashupworld
    @bhojpurimashupworld 4 года назад

    Sir you are super explaining unbelievable.

  • @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;
    }
    }

  • @shashikalaraju5769
    @shashikalaraju5769 5 лет назад +35

    God has manifested to me in your form. Thank you.

  • @travelingintime6460
    @travelingintime6460 4 года назад +1

    d1-d2 = 2m-1
    Which is a constant value
    How can we draw a line if it is negative

  • @snehupadhyay5297
    @snehupadhyay5297 4 года назад

    Example is good it help me alot to understand this..

  • @KY22077
    @KY22077 5 лет назад +1

    Thank you very much Sir,
    Please make videos about Computability, decidable and undecidable problems.

    • @KY22077
      @KY22077 5 лет назад

      @@abdul_bari Thank you Sir for replying me.
      Sir I have searched and look at some videos too, but I didn't understand it correctly. Because they are not explain it in deatils.
      And I have exam in one Week.
      Thank you

  • @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?

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

    It will be great if u make more contents for Computer Graphics, as your explainations are deep and very easy

  • @prasunneupane4053
    @prasunneupane4053 5 лет назад +1

    sir at 36:06 isn't it p=2dy-dx. You have written p=2dx-dy. Great vedio sir keep it up.

  • @duaasaleem6631
    @duaasaleem6631 4 года назад

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

  • @r.prasannavenkatesan9879
    @r.prasannavenkatesan9879 4 года назад

    best explanation out here

  • @kamanamishra1108
    @kamanamishra1108 5 лет назад +1

    now I understand the c.g. , thanks sir for your valuable videos, please update more acc top MCA 3 sem syllabus. And also how to make a notes.

  • @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

  • @malikcampbell4758
    @malikcampbell4758 5 лет назад

    Best teacher ever.

  • @kavithakulandaivel4071
    @kavithakulandaivel4071 4 года назад

    Sir your class is superb . Kindly take circle and ellipse generation algorithms.