Sutherland-Hodgman Polygon Clipping Algorithm

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ • 161

  • @rishabsingh2475
    @rishabsingh2475 8 років тому +1

    an entire lecture thing in just 8 min. just wow. much helpful thanks a lot .

  • @CMSARAN
    @CMSARAN 5 років тому +2

    The video was an good guide for me during my semester exam i thank you for your help and i request you to upload this kind of video with updated version of items frequently EVERY ENGINEER SHOULD WATCH

  • @nabeelrao2638
    @nabeelrao2638 8 років тому +1

    I have an exam tomorrow and wasn't being able to understand this from the book.
    But now i clearly understood it. Thanks a lot for this informative video!!!

  • @pe_P
    @pe_P 2 роки тому +1

    Thankyou for the lecture..👍
    And your voice is so beautiful🌝

  • @anushkamittal4132
    @anushkamittal4132 7 років тому

    Amazingly clarified..I must appreciate your way of teaching so politely . Thankyou so mch sir 😇

  • @FPChris
    @FPChris 2 роки тому +7

    You didn’t explain how you clipped the low left corner. V5’ would wrap to V3’ not magically magically create the corner.

    • @yetanother7428
      @yetanother7428 6 місяців тому

      I was thinking the same thing. (Also, I think you meant V2', instead of V3').
      This video is wrong. If anyone is looking around, to save time, I found a video with the correct explanation of the algorithm: ua-cam.com/video/Euuw72Ymu0M/v-deo.html

  • @umangpancholi5888
    @umangpancholi5888 3 роки тому +1

    Thanks a lot! Also, your voice is brilliant XD

  • @markwoo9845
    @markwoo9845 9 років тому +2

    good tutorial for Sutherland-Hodgman Algorithm. thank you, you really help me a lot

  • @talsveta
    @talsveta 9 років тому +22

    Another scenario should be taken into account is the case when both vertices are outside the clipping area, while the line they form *does* cross the clipping area. I guess in this case you should not discard both v1 and v2

    • @TheBootStrappers
      @TheBootStrappers  9 років тому +3

      talsveta yeah in that case you have to assume a point on the line crossing as a vertices of the polygon(hypothetically) and then break that line into the cases mentioned in the video. Thank for pointing it out though:)

    • @arpanmajumder655
      @arpanmajumder655 7 років тому +1

      Yeah,I was also thinking the same!
      Great tutorial otherwise!

  • @dhruvtonemare8473
    @dhruvtonemare8473 9 місяців тому

    Thank you sir simple and easy video with kind understanding ❤😊

  • @akanshachaurasia3329
    @akanshachaurasia3329 7 років тому

    I really liked your lectures they are very beneficial..... I request you to pls upload more videos on computer graphics

  • @Ckcksnsnscive437
    @Ckcksnsnscive437 2 роки тому

    thank you sir, very nice explanation! very useful!

  • @abishekh_kc
    @abishekh_kc 6 років тому

    thanks buddy... well explained without any doubts.

  • @Aziz00747
    @Aziz00747 9 років тому +1

    Thank you so much! really well explained! God bless u!

  • @ostaphrytsyshyn3199
    @ostaphrytsyshyn3199 9 років тому +7

    Considering points as "inside" and "outside" will not work in all cases.
    Check this image. i.imgur.com/e6S0V20.png
    Segment ED is intersecting rectangle, but nither E nor D is inside the rect.

    • @jinxblaze
      @jinxblaze 8 років тому

      +Ostap Hrytsyshyn yup

    • @anshulhedaoo8332
      @anshulhedaoo8332 7 років тому

      did you get any solution of this bro???

    • @LionKILLGER
      @LionKILLGER 7 років тому +1

      The solution is to NOT check the 4 cases according to the rectangle
      but according to the clipping edge I guess.
      If you have a closer look at the pseudocode provided by e.g. wikipedia
      ( en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm#Pseudo_code )
      you quickly see that one has to pick an edge of the clipping polygon.
      E.g.:
      Take the 1. Clipping Edge (e.g. left edge)
      -> now take as input points all points of the polygon and check the 4 cases against this edge
      -> i.e. if its left of the edge -> its outside, if its right of it -> its inside
      -> add the new intersection points like the cases tell you and you get a new list L'
      -> you take that list as the input list for the next iteration
      Take the 2. Clipping Edge (e.g. top edge) and as point input list L' from the previous iteration.
      -> now perform the same steps as before and get the next output list L'
      ... continue this procedure for the other 2 edges of your rectangle.
      I think following the steps like I wrote will indeed capture the edge by E and D.
      ( Please correct me if I am wrong because I also need to know the correct solution :D )

  • @rajeshprajapati6662
    @rajeshprajapati6662 Рік тому

    08:22 So, initially this polygon had 5 sides. After clipping, the polygon has 7 sides. Right ? or is it 6 ?

  • @AndrewJoemon
    @AndrewJoemon 4 роки тому

    thank you for this video... wonderful explanation..

  • @simranguliani1609
    @simranguliani1609 8 місяців тому

    would be great if you have given these in written points,but it was such an easy explanation ,thanks

  • @ashwaniprasad7381
    @ashwaniprasad7381 8 років тому +1

    Just in one word "AWESOME"

  • @this_rishi
    @this_rishi 6 років тому

    Thanks a lot for the video... It was really helpful.

  • @mikhailsartakov4750
    @mikhailsartakov4750 6 місяців тому

    Brilliant video!

  • @prateekparabify
    @prateekparabify 9 років тому +1

    Very nicely explained . very precise

  • @jaiminmistry5240
    @jaiminmistry5240 9 років тому +1

    how can you go vertical form v2' and then horizontal ??( 8:00)
    Vertices of the square polygon have not been saved.

    • @Mahadeva...
      @Mahadeva... 6 років тому

      U have nice communication skills though... And very nicely presented... 👍👌

  • @kaltwarraith5172
    @kaltwarraith5172 2 роки тому

    very useful, one note, what you pronounce as v1 dash is more commonly called v1 prime

  • @varshathaya2515
    @varshathaya2515 10 місяців тому

    very understandable. Thank you 🙏

  • @kshitijmakwana9707
    @kshitijmakwana9707 9 років тому +1

    there seems to be a minor error at time 3:40 in video for rule 'd' as you ask us to save v2'
    but while solving the sum you consider points v1' as at 6:55 you take point v5' instead of v1'
    oh !!
    and love your videos................Good Job :)
    couldnt find for liang barsky algorithm though
    please share the link
    unless you havent made one
    if so please make one
    THANK YOU

  • @talsveta
    @talsveta 9 років тому +10

    Thank you very much! It was great and well explained!
    Just one other note - I think the last edge you made between the vertices v5' and v3' is not trivial and worth to mention.. I.e. if those vertices had not been signed with a dash, you would have needed to connect them with one direct edge and not over the actually 2 edges that are formed by the surroundings of the clipping area

    • @TheBootStrappers
      @TheBootStrappers  9 років тому +2

      talsveta sure thanks !

    • @parvinderyadav007
      @parvinderyadav007 9 років тому

      +talsveta Yess you are right ! i think that's the small mistake done by talented buddy :D

  • @kladimirovo
    @kladimirovo 9 років тому +1

    very good explanation, thanks

  • @Xaknoth
    @Xaknoth 8 років тому +18

    How does this algorithm handle the case when one or more corners of the rectangles is part of the clipping? You just included the corner without any explanation in the example you solved.
    One other case that is not handled is when both v1 and v2 are outside the clipping window but the edge between them intersects the clipping window.

    • @ayeshaparyani1549
      @ayeshaparyani1549 8 років тому +7

      To solve your first query, a corner of the window is supposed to be within its boundaries. So it's treated as 'inside'. For your second question, Sutherland Hodgeman polygon clipping algorithm clips a polygon with respect to one boundary at a time. So you actually need to repeat this four times for a rectangular window. In the video, he has tried to solve it in one go which would create confusion. I suggest you solve this case considering one boundary at a time. It definitely works. However be careful that you figure out 'inside' and 'outside' vertices considering only the boundary then and not the entire polygon.

    • @ayeshaparyani1549
      @ayeshaparyani1549 8 років тому

      Not the entire window* i mean

    • @renzocoppola4664
      @renzocoppola4664 7 років тому

      it works if you repeat the process in EACH edge-boundary, not everything at once.

    • @zandere1
      @zandere1 5 років тому

      @@renzocoppola4664 Yep, and you have to treat them as infinitely long

  • @initpwn
    @initpwn 8 років тому

    +The BootStrappers, 8:01 tho,... That v2' & v5' should be joined connected directly... Right? :\
    Anyway, awesome presentation... really helped me! :) :')

  • @ganeshkolase7203
    @ganeshkolase7203 6 років тому

    Nice explanation.. keep it up👍👍👍👍

  • @krcreddy1671
    @krcreddy1671 8 років тому

    excellent video bro. nice keep it up...

  • @abhishek1verma
    @abhishek1verma 6 років тому

    very good explanation

  • @anmolmangat9128
    @anmolmangat9128 7 років тому

    I have watched a few videos of this channel and they are amazing
    You should publish a full fledged course on Computer Graphics as there is no good source of it on youtube
    Videos were

  • @abrahamjoseph6445
    @abrahamjoseph6445 Рік тому

    I like to point out a small mistake in in 4 th example
    The clipping from inside to outside we have to save the inside point v1dash instead of v2dash

  • @vibecatcher4416
    @vibecatcher4416 5 років тому

    Wow , amazing sir ,, thank you 🙏🏻

  • @ashankavindu2409
    @ashankavindu2409 2 роки тому

    Thank you very much sir ❤️❤️❤️❤️

  • @fasalurahman697
    @fasalurahman697 5 років тому +1

    Simple mistake last step V5 -V1 not V5' its (V1')
    Good work bro..

  • @runasing3293
    @runasing3293 8 років тому

    please upload 2-D and 3-D transformation lecture too....its helping a lot

  • @abhinavnarendrakumar591
    @abhinavnarendrakumar591 5 років тому

    Great tutorial, very helpful

  • @Niteshkumar-zd3kr
    @Niteshkumar-zd3kr 6 років тому

    The polygon you have used for clipping is a concave polygon!!

  • @VarshaGupta-ku4ez
    @VarshaGupta-ku4ez 8 років тому +1

    please upload the video of midpoint circle drawing algorithm

  • @ahmedal-ahmed7606
    @ahmedal-ahmed7606 8 років тому

    Excellent Video , Thanks Bro (Y)

  • @akshaaaaaaaaaaaaaaay
    @akshaaaaaaaaaaaaaaay 8 років тому

    At 3:50 it should be v1 dash not v2 dash. Thnx for great lec.

  • @vinothkumar7
    @vinothkumar7 9 років тому

    Is the algorithm is will work for all complicated shapes??? Or only works on any shapes clipped by rectangle shape??? @The BootStrappers

  • @omarmoataz
    @omarmoataz 8 років тому +1

    This was great, thanks.

  • @journeytolive8386
    @journeytolive8386 8 років тому

    their is a confusion between inside to outside point. which one we have to take you didnt mention in the lecture......

  • @filat239
    @filat239 4 роки тому

    I like that. Well explained!

  • @allurunsprasad9099
    @allurunsprasad9099 8 років тому

    it really helped me.. thanks a lot man

  • @thangklen
    @thangklen 8 років тому

    when V1 goes from outside to inside V2, the intersection is actually V1', not V2'

  • @jarikosonen4079
    @jarikosonen4079 3 роки тому

    This looks like something to test.
    What would happen if there is a hole in the polygon? Looks like O^2 problems.
    If v1&v2 both outside, but their segment crossing the corner?

  • @renzocoppola4664
    @renzocoppola4664 8 років тому

    joining the end points? you mean to reiterate the algorithm?

    • @renzocoppola4664
      @renzocoppola4664 8 років тому

      Uhm, no. You know about this case after checking if it's two sides off

  • @Alex-vi6fr
    @Alex-vi6fr 6 років тому

    how can you tell the direction of the line when the question is not given any direction at all? :/

  • @apurbaghosh4856
    @apurbaghosh4856 8 років тому

    thanks for the video. it helped a lot.

  • @arpityadav1847
    @arpityadav1847 6 років тому

    Nice explanation

  • @BhupendraChoudharyczar
    @BhupendraChoudharyczar 8 років тому

    best video on SHPCA...

  • @zlayaprizlaya
    @zlayaprizlaya 7 років тому

    What about the case if all points are outside the window and window is completely inside the polygon?

  • @grinalpatel1012
    @grinalpatel1012 9 років тому

    Well understood…plz Post liang barsky line clipping

  • @kumaripuja7433
    @kumaripuja7433 8 років тому

    U said for 'inside to outside' that we consider the outside point but while solving problem u saved the inside point.... So which one we hv to save???

  • @ashishmaxmaxal312
    @ashishmaxmaxal312 8 років тому

    Can we start from any vertex of polygon? or what would be the direction to move (clockwise or anti.C)?

  • @shadizebari8161
    @shadizebari8161 9 років тому

    what about if we have a non-rectangular clipping window?

  • @devkaran1448
    @devkaran1448 9 років тому

    Please upload Liang barsky algorithm

  • @1step4ward96
    @1step4ward96 8 років тому +1

    really helping tutorial... thankyou (y)

  • @manognamona9959
    @manognamona9959 5 років тому

    In the rule 4 sir u have mentioned v1 inside and v2 outside and we must save v2' in the polygon example the line from v5 to v1 ,v5 is inside and v1 is outside according to rule 4 v1' must be saved but sir y did u mentioned v5'

  • @trg3-149
    @trg3-149 5 років тому

    realy helpfull for me! thanks

  • @mayurinegi9624
    @mayurinegi9624 6 років тому

    Isn't the last point which you saved, suppose to be v1'?

  • @priyanka9133
    @priyanka9133 6 років тому

    Thankyou very much....😊

  • @cristinjhon8444
    @cristinjhon8444 5 років тому

    How did you determined the inside and outside points !!!!!!say it first

  • @sunny10528
    @sunny10528 9 років тому

    After clipping , in the final diag you didn't name the vertex between v2' and v5' What about that?

  • @d.j.peters
    @d.j.peters 9 років тому +1

    It will fail if v0 ,v1,v2 (a triangle larger as the clip rectangle) all outside the 2D screen rectangle or 3D view frustum.

    • @AryanSingh2512.
      @AryanSingh2512. 5 років тому

      DJLinux007 that’s why we have another algorithms.

  • @cristinjhon8444
    @cristinjhon8444 5 років тому +1

    There is some mistake in this video!!!!! V3 to v4 there should be saved v4' but you saved v3' and there is also mistakes in v5 to v1

    • @iyapa889
      @iyapa889 2 роки тому

      yes how can we save that point
      ?

  • @amaanhamza1776
    @amaanhamza1776 6 років тому

    Tmaari awaaaz, uffff, agar natural hai to im sorry, or ye jaanke istarah ki nikaal rhe ho to, katai jeher ho tum

  • @sohammondal578
    @sohammondal578 9 років тому

    Look the video is very good but there was a problem in the sheet 3 where you did not draw the window..How are gonna know if the line is going in or out if you dont show the window ?

  • @saisaran1882
    @saisaran1882 9 років тому

    well explained.... also post liang barsky algo...pls...

  • @mohamedhossam921
    @mohamedhossam921 5 років тому

    i think according to rules when goes from v3 to v4 we make v4' so how we make 2nd V4' when we go from v4 to v5 that should make also V4' that will make 2 v'4 ???

  • @teemaroronoa9384
    @teemaroronoa9384 9 років тому

    Was useful and helpful

  • @abhaychandrasingha3448
    @abhaychandrasingha3448 7 років тому

    awsome video

  • @sahirsharma4541
    @sahirsharma4541 3 роки тому

    Good job!

  • @aadarshgupta2253
    @aadarshgupta2253 7 років тому

    You have to follow LRBT. Otherwise you can't say about the v2' and v1'.

  • @blackaura345
    @blackaura345 9 років тому +1

    Concise explanation, sir. But be a bit fast.

    • @TheBootStrappers
      @TheBootStrappers  9 років тому

      blackaura345 sure ! Will take note of it in the upcoming videos

    • @halfway16
      @halfway16 9 років тому +1

      The BootStrappers
      This is a good tutorial bro, no need to be faster because there is some people who dont understand english well.. Keep the good work!!

  • @sagarmukherjee6297
    @sagarmukherjee6297 7 років тому

    its wrong the last part v2' should be connected to v5' directly
    how can a line bend between to point in clipping

  • @shubhammittal5164
    @shubhammittal5164 8 років тому

    Hehe
    In the end, V2' and V5' ke centre wala point kaise liya ?

  • @harshpreetbakshi8935
    @harshpreetbakshi8935 8 років тому

    nice explanation...

  • @ElChavale
    @ElChavale 6 років тому

    Which is the link for line clipping?

  • @sanduferi3225
    @sanduferi3225 5 років тому

    God bless you !

  • @antraverma6671
    @antraverma6671 8 років тому

    window is nt visible... :/

  • @DL2UK
    @DL2UK 9 років тому

    very nice mann

  • @pongolo1230
    @pongolo1230 28 днів тому

    mordo jak sie nazywasz do projektu cie wpisze

  • @DayIight.
    @DayIight. 3 роки тому

    Legend

  • @bhavyagosalia4890
    @bhavyagosalia4890 5 років тому

    thanks mahn ....helped a lot

  • @mdsayedahammed2367
    @mdsayedahammed2367 7 років тому

    Amazing !!

  • @bonny27196
    @bonny27196 7 років тому

    Awesome

  • @ankitambekar6073
    @ankitambekar6073 6 років тому

    Good Job..

  • @abuelkheirshorts252
    @abuelkheirshorts252 2 роки тому

    thanks brother

  • @hiteshpanjwani1613
    @hiteshpanjwani1613 6 років тому

    Gr8 one dude

  • @sushmitaroy9684
    @sushmitaroy9684 7 років тому

    thank you

  • @FurqaanShafi
    @FurqaanShafi 6 років тому

    thanks broda!!!

  • @nikhiljagade9533
    @nikhiljagade9533 8 років тому +3

    how d hell u save v3' . according to rule d u should save v4'

    • @thangklen
      @thangklen 8 років тому

      when V1 goes from outside to inside V2, the intersection is actually V1', not V2'

    • @JohnDoe-cf6xw
      @JohnDoe-cf6xw 7 років тому +1

      Thangkhup Hrangkhol irrelevant, 3 to 4 is inside to outside. I also think it should be v4'

    • @ujjwalbhaskar5697
      @ujjwalbhaskar5697 6 років тому

      You are right bro

    • @mohamedhossam921
      @mohamedhossam921 5 років тому

      yes i think so too but if that so how we make 2nd V4' when we go from v4 to v5 that should make also V4' that will make 2 v'4

  • @kaustavsingh4278
    @kaustavsingh4278 8 років тому

    very useful fr me👌👌👌

  • @christopherlusiga2112
    @christopherlusiga2112 8 років тому

    Thank u bro