Coding Challenge #15: Fractal Trees – Object Oriented

[ad_1]
In this Coding Challenge, I continue the topic of algorithmic botany with another way of generating a tree. With this method, every part of the tree will be an object, so that we can apply forces and attributes to each element

Support this channel on Patreon:

Send me your questions and coding challenges!

Contact:

Links discussed in this video:
Nature of Code class on Kadenze:
Algorithmic Botany:

Source Code for the Video Lessons:

p5.js:
Processing:

For More Algorithmic Botany Videos:

For More Coding Challenges:

Help us caption & translate this video!


Posted

in

by

Tags:

Comments

32 responses to “Coding Challenge #15: Fractal Trees – Object Oriented”

  1. Jose David Avatar

    "I hear voices!" /

  2. the real alimusicbaba Avatar

    It is 2017! Attach spring forces! Great videos! Just learning p5/JavaScript thanks to you! Really great content!

  3. Ron S Avatar

    You have made watching coding fun. That is pure talent!

  4. Mogwyre Pendelhurst Avatar

    How can I stop the tree from growing past a certain count, say 6 mouse clicks? Currently it just keeps growing until it crashes, and I want to constrain this function.

  5. Liyah A. Avatar

    You should do a video so we could get to know you .. cause I have a few questions you should answer Love your channel btw I'm just getting into computer science I would also like you to do tutoring I need help on the basics but I prefer to learn from you… you have the energy

  6. Olf Mombach Avatar

    What's the difference between
    var a = createVector(42, 24)
    and
    var a = [42, 24]
    ?

  7. Charlie McGuire Avatar

    Hey, I tried impementing this in python using PIL , specifically Image and ImageDraw (with numpy vectors for ease of vector operators) and was mostly successful. The people who created the library said it's not particularly good at making lines look better and was wondering if you know any better ways of implementing this. The lines have jagged edges that aren't in your image, and I just put it through an anti-aliasing filter in GIMP which did help a bit but I think it needs to be fixed when it's drawn. Part of me wants to join you using Processing but I don't know any java or javascript.

  8. JustKath Avatar

    make this in processing 3 please!!!!

  9. Martin Stacey Avatar

    Really cool video! is there a way to mantain the tree structure so that the branch knows which his parents are??

  10. TgRx83 Avatar

    Reminder : you have to take this tree back and add some physics force to it 😀

  11. Demetris Leptos Avatar

    where have you been all my life?

  12. William Bille Meyling Avatar

    i am going to use for a school project where I will animate cancer cell mitose

  13. sanfrozen Avatar

    can u make a floating island.

  14. Overwhelming Sarcasm Avatar

    Wow! I'm only beginning to learn to code now, but through your videos I've found awesome inspiration to put all the maths I've learned at school into use while coding. Fantastic work, keep it up!

  15. TechieW Avatar

    Made this based on your video ( in C++ )
    http://image.prntscr.com/image/955b15ca37cd412695f48d161e7c2c33.png
    Source code will be going up on my channel

  16. bahlaoui youssef Avatar

    that's a happy coding chalenge XD
    keep it up…

  17. Jiho Song Avatar

    I have questions!

    1. why does prccessing works well while using var in iterating loop? I thought in javascript there is always problem using var in loop statement, so it is encouraged to use let.

    2. when you use jitter method, why do not entire branches goes off uncontinuosly? Shouldn't it appear like bunch of segmented sets of branches since we are only moving the end points??

  18. Ayush Seth Avatar

    I made an extenstion of this tree, you can check it out here https://github.com/MasterYushi/Fractal-Tree-Object-Oriented-

  19. Cypress1337 Avatar

    I want your brain 🙂

  20. Yoeri Wysselinck Avatar

    Hi, first time I used P5.js. Somehow I noticed that these build-in event functions do not work for me 🙁 . I have been following your tutorial exactly but it does not recognize the function mousePressed(){}. Any idea ?

  21. Eclipse Avatar

    You need to do a 1 hour coding challenge.

  22. Marc Vredeveld Avatar

    So I will often make sketches that need to have a dynamic canvas. Meaning, there is some content that moves around and needs to be centered on the screen, or in this case, the canvas needs to dynamically resize as the tree gets larger and larger. Is there a recommended method for doing this? I have found some methods that work, but there is some performance impact

  23. YERRAMILLI ROHITH Avatar

    no words to say. u really rock. If i got an army or superpower , i would make all people in world subscribe and vaporise all those who disliked .

  24. Akshay Aradhya Avatar

    Hey guys I just wanted to share something I did using P5.js. http://dollarakshay.com/dataveyes.html Dont view the link on mobile or tablet. 1080p will be the best resolution to watch this in

  25. Martin Stacey Arquitectura Avatar

    is there a way to do this in processing? what is push equivalent to?

  26. space1188 Avatar

    If i wanted wind to be affected by the tree, how could i do that. And can you please make a video on that.

  27. Noob Gaming Avatar

    Another way to go about storing the branches is to have the branches stored inside of its parent branch, so a branch object would have childBranches, or branchA and branchB, depending on how you want to store the branches, then the branches show() function can call show() on its children

  28. Drew Vance Avatar

    i have to use NetBeans in my java class, can i use that to code these challenges?

  29. Timur Uzel Avatar

    why not say if(currentBranch) instead of if(currentBranch == null)? This checks if currentBranch is truthy

  30. Dennis Avatar

    i dont get how that jitter works. if you move all the end positions how does the next branch now to update its start position? the only function being called every frame is the draw and jitter and the jitter only changes the end position not the start?? can someone explain sorry for my shitty english

Leave a Reply

Your email address will not be published. Required fields are marked *