# Tree Simple 3D

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)

### WHAT IS IT?

This is a 3D version of the 2D model Tree Simple. This model draws special types of pictures called fractals. A fractal is a shape that is self-similar - that is, it looks the same no matter how closely you zoom in or out. For instance, a tree can be thought of as a fractal since if you look at the tree as a whole, you see a stick, that is to say the trunk, with branches coming out of it. Then if you look at a smaller portion of it, say a branch, you see a similar thing, namely, a stick with branches coming out of it.

### HOW TO USE IT

Perhaps the best way to start with this program is by looking at an example of a fractal. In the "Interface" tab, press the SETUP button to set up a fractal that draws a tree. Then press the GO button and watch it draw.

You can also have the fractal drawn one step a time. Once you click the SETUP button, instead of clicking the GO button, click on the GO ONCE button. This draws the fractal by drawing one iteration of the fractal per click as opposed to continuously, like the GO button.

If you don't like the location of the fractal you can change it by modifying the value of the following sliders:

The INIT-X slider sets the initial x coordinate of the first turtle. It changes the horizontal starting location of the original turtle.

The INIT-Y slider sets the initial y coordinate of the first turtle. It changes the vertical starting location of the original turtle.

The INIT-Z slider sets the initial z coordinate of the first turtle. It changes the starting location of the original turtle on the z-axis.

If you don't like the color scheme of the fractal you can change it by modifying the value of the following sliders:

The INIT-COLOR slider sets the initial color of the first turtle.

The value of the COLOR-INC slider is added to the turtles color anytime a new turtle hatches.

The NUM TURTLES monitor indicates how many turtles are in the graphics window currently. The ITERATIONS monitor shows how many times through the iterate procedure the model has gone.

Be aware that due to the varying systems that NetLogo runs on, it might be best to limit the number of iterations to about 8 or 9 of any particular fractal. If you go much more than that, you might have trouble with memory problems.

### THINGS TO NOTICE

Notice the self-similarity of the fractal at each iteration. What if one were to perform an infinite number of iterations? Would looking at any piece up close look any different than looking at the whole? Also notice how the number of turtles in each of the example is multiplied by some number at each iteration. Does this make sense? Try to figure out the number of turtles at some arbitrary step n.

### THINGS TO TRY

Now that you have played around with settings for the example provided, why not try making your own tree fractals. Use NetLogo commands to make your own fractals that look like trees. Then change the initial color and color increment values to make the fractal more interesting to look at.

### EXTENDING THE MODEL

Try adding switches or sliders such as max-increment-random-length or min-increment-random-degree or random-length that could impose a random factor to the movement of the turtles. The use of these plus the NetLogo primitive random would increase the realism in a fractal. This would be especially useful in drawing realistic trees since branches are not spaced uniformly on a tree nor do they all branch from the trunk at the same angle.

Pick up a book on fractals or search on the internet to find fractals that are interesting and try to create them. Also try to find different types of fractals such as L-System Fractals. You may find some resources below.

Try starting with more than just one turtle, in a different location or heading, and see how that can affect the fractals that you have made. Does it ruin them or does it make them more interesting and complex?

Try to make a realistic forest. Does this require vastly different commands from making a realistic tree?

### NETLOGO FEATURES

Notice the use of agentsets to make some of the commands only affect certain turtles. For example, the reporter WITH is used to isolate non-new turtles and have the rules only affect them. Also notice how the fractals are formed using several agents following the same rules through the use of the "hatch" primitive which makes it so simple to generate fractals like a tree.

### RELATED MODELS

L-System Fractals

### CREDITS AND REFERENCES

This site offers an introduction to fractals, including L-system fractals as well as others.

http://www.cs.wpi.edu/~matt/courses/cs563/talks/cbyrd/pres1.html

The Fractal Geometry of Nature by Benoit Mandelbrot

### HOW TO CITE

If you mention this model in an academic publication, we ask that you include these citations for the model itself and for the NetLogo software:

- Wilensky, U. (2001). NetLogo Tree Simple 3D model. http://ccl.northwestern.edu/netlogo/models/TreeSimple3D. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

In other publications, please use:

- Copyright 2001 Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/TreeSimple3D for terms of use.

### COPYRIGHT NOTICE

Copyright 2001 Uri Wilensky. All rights reserved.

Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed:

a) this copyright notice is included.

b) this model will not be redistributed for profit without permission from Uri Wilensky. Contact Uri Wilensky for appropriate licenses for redistribution for profit.

This is a 3D version of the 2D model Tree Simple.

This model was created as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227.

## Comments and Questions

breed [ leaves leaf ] turtles-own [ new? ] ; setup the initial turtle and its properties to setup ca create-leaves 1 [ set shape "line" set shape "line" set color init-color setxyz init-x init-y init-z set heading 0 set pitch 90 ] end ; have all non-new turtles draw an iteration of the tree to iterate ask leaves [ set new? false ] ; here are the commands to draw the tree ask leaves with [ not new? ] [ pd fd 2 right 15 fd 4 hatch 1 [ set new? true ] set color (color + color-inc) right 180 jump 4 right 180 left 15 fd 2 left 15 hatch 1 [ set new? true ] set color (color + color-inc) fd 4 right 180 jump 4 right 180 right 15 fd 2 tilt-up 15 fd 4 hatch 1 [ set new? true ] set color (color + color-inc) tilt-up 180 jump 4 tilt-up 180 tilt-down 15 fd 2 tilt-down 15 hatch 1 [ set new? true ] fd 4 set color (color + color-inc) die ] tick end ; Copyright 2001 Uri Wilensky. All rights reserved. ; The full copyright notice is in the Information tab.

There are 3 versions of this model.

## Attached files

File | Type | Description | Last updated | |
---|---|---|---|---|

Tree Simple 3D.png | preview | Preview for 'Tree Simple 3D' | over 9 years ago, by Uri Wilensky | Download |

This model does not have any ancestors.

This model does not have any descendants.