Register

User Tag List

View Poll Results: Should I do more? I'll probably to a raycaster next.

Voters
5. You may not vote on this poll
  • Yes!

    2 40.00%
  • Yes, but something else.

    2 40.00%
  • No...

    1 20.00%
Results 1 to 1 of 1
  1. #1
    Eyes in the sky Zeta Siramnot's Avatar
    Join Date
    May 2016
    Posts
    46
    Thanks
    13
    Thanked 16 Times in 12 Posts

    Who said coders can't art?

    Hi everyone!
    Yes, I can't make art in the traditional sense. My drawing skills are horrible, I can't model in 3D, I can't compose, I can't photograph and my writing skills are decent at best. I, however, can program, meaning I can get a computer to draw for me, more or less.

    Enter my world. A world riddled with insomnia and a dire lack of time. It's about 1:30 AM (I had to be up by 7 AM that day, mind you), when I decided I'd like to make a recursion tree, just for the fun of it. And I did. Because who needs sleep? I clearly don't. And heck, it was fun. Except it was up-side-down.


    I wasn't happy with my tree being upside down. Ugh. I forgot that the drawing origin is at the top-left, unlike in a Cartesian co-ordinate system, where the origin is at the bottom-left. Some pesky tinkering should do the job.



    Awesome. Now I could start having some real fun. Being the obsessive guy I am, I rarely use magic numbers. The angle I used to make the tree was... a constant at the time, yes, but I figured that if I changed it to a variable and added a slider to let me control it, I'd be able to have a ton of fun.



    The slider sets the angle anywhere from 0 to 180 degrees. Some of my favorite angles to play around with are 30, 60 and 90. Anything higher than 90 degrees starts looking odd.

    Then I started wondering how I'd implement multiple branches. I started with one more branch, since that was fairly easy to implement.



    After messing around a bit with pen and paper, I decided how I'd implement multiple branches (higher than 3). Theoretically I could have up to a million, but my craptop miraculously handles 5, and with the resolution I set it to work with, you'd probably barely be able to see much past 9.



    I also did one last thing. Make it look like an actual tree. I painted the logs (lines length != 1) brown, and the leaves (end segments, lines length == 1) green.
    I think it looks pretty nice.


    So what do you think? I attached the source and the program below.
    Staff: if there are any issues with my program, let me know and I'll remove it.



    Program download: Recursion.zip

    Last words: After finishing this program, I had the idea of making more "art-related" programs, and if people like this one, I might post them here. I had a ton of fun making this, and I love how the final result turned out. Thanks for reading, and I hope you guys enjoy this as much as I did.

    Feel free to PM me with issues/requests, or post any cool findings below!
    Last edited by Siramnot; 12-09-2016 at 11:33 PM.
    Davib | Bowmaster

    I'm barely active...

  2. The Following 2 Users Say Thank You to Siramnot For This Useful Post:


 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •