Important alert: (current site time 7/16/2013 3:13:37 AM EDT)
 

winzip icon

Generate realistic Trees using recursion

Email
Submitted on: 5/29/2001 12:59:22 PM
By: Danish Mujeeb 
Level: Intermediate
User Rating: By 29 Users
Compatibility: VB 5.0, VB 6.0
Views: 22385
(About the author)
 
     This program uses the concept of fractals in nature and generates realistic Trees using recursion ( the recursion part is heavily commented ). Each branch can be thought of a small tree on its own and every other branch on that branch. Hence this program uses the concept of recursion very effectively in creating trees

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

5/29/2001 1:49:20 PMAlmar Joling

Very cool, and very nice example of recursion
(If this comment was disrespectful, please report it.)

 
5/29/2001 2:35:11 PMMike Canejo

Very nice...

(If this comment was disrespectful, please report it.)

 
5/29/2001 4:35:51 PMM@

Good work. Nice recursion example. I gave you a "4" instead of a "5" because you need some bounds checking to prevent overflow errors. I got several while fiddling with the complexity. Otherwise, good job!

M@
(If this comment was disrespectful, please report it.)

 
5/30/2001 7:08:25 AMDondata

Beautifull :)
(If this comment was disrespectful, please report it.)

 
5/30/2001 10:08:03 AMopello

The leafing is superb! The branches make it look fake :( Other than that, nice recursion and tree!
(If this comment was disrespectful, please report it.)

 
5/30/2001 12:33:19 PMVitaly

Way to go!
(If this comment was disrespectful, please report it.)

 
5/30/2001 3:03:44 PMSniperBoB

VERY NICE! This is so cool, but now the problem is converting this to 3D and being able to create low poly, somewhat-realistic trees for a D3D game's level editor :-)
(If this comment was disrespectful, please report it.)

 
5/30/2001 3:08:52 PMSniperBoB

oh yea, I love that font thing, Great idea! Also u got an excelent from me!
(If this comment was disrespectful, please report it.)

 
5/31/2001 3:31:54 AMNathan Chere

Everyone seems to be interested in the recursion but I already know how to utilise that. What really impressed me is the fractal element, I'm totally new to using fractals so this is fascinating to me. 5 globes.
(If this comment was disrespectful, please report it.)

 
6/17/2001 6:32:34 AMCodin Genius

The branches look a bit fake, too calculated. Also you need some error handling, how many times did I get overflow errors when playing around with it, quite alot. Otherwize very cool. 4 globes, 5 if it hadn't been for the errors and the fake looking branches. Lets see if you can generate a landscaped garden scene, make flowers and different types of trees, theres an idea for you. ;)
(If this comment was disrespectful, please report it.)

 
6/18/2001 2:02:46 PMChris

Amazing i gave you 5 out of 5 the tree looks basically real if you hind the trunk
Just amazing!!!
(If this comment was disrespectful, please report it.)

 
6/18/2001 7:17:07 PMMartin

Great Job, but you forgot the autoredraw on the rendering windows
(If this comment was disrespectful, please report it.)

 
6/18/2001 9:45:06 PMTerry Smith

Excellent work. Needs error handling, auto screen clear and better branches, but otherwise excellent!
(If this comment was disrespectful, please report it.)

 
6/18/2001 11:04:25 PMJason

I managed to fix the overflow error by changing Dim prog As Long to Dim prog! in the declarations section of Form1 (tree.frm)
(If this comment was disrespectful, please report it.)

 
6/20/2001 8:13:58 PMhappylobster

I have also made a tree drawing program tho much simpler. Search for graphical tree
(If this comment was disrespectful, please report it.)

 
8/21/2002 8:14:26 AMDragonfly

Try putting in some random numbers to keep the branches from propagating all the same way, otherwise, looks very nice.
(If this comment was disrespectful, please report it.)

 
8/21/2002 12:44:59 PMVi11

Excellent. I gave you a five even with the overflow errors. Visually stunning.
(If this comment was disrespectful, please report it.)

 
2/28/2009 4:55:39 AMadel elkabany

great code , very well crafted
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.