|
|||
Home Page Download Models Community Models Extensions User Manual:![]() Web version![]() Printable version FAQ Resources Contact Us |
NetLogo Models Library: | ||
|
Run 3D Solids in your browser uses NetLogo 4.0.4 requires Java 1.4.1+ (system requirements) Note: If you download the NetLogo application, every model in the Models Library (besides the Community Models) is included. If you have trouble running this model in your browser, you may wish to download the application instead. |
WHAT IS IT?
This model creates 3D shapes out of 2D turtles by mapping turtles between cartesian and spherical three-dimensional coordinates.
HOW IT WORKS
To create the 3D shapes the program randomly generates turtles about the shell of the shape in either cartesian (x, y, z) or spherical (theta, phi, z) coordinates, depending on which is easier to accomplish but always stores the information converting when necessary in spherical coordinates. To render the sphere in the NetLogo view, it translates the turtles from spherical to cartesian coordinates using color to simulate depth. The positions of the turtles are always stored as spherical coordinates because they are rotated on the z-axis, and the simplest way to do so is to increase theta in spherical coordinates.
Converting from cartesian to spherical coordinates:
x = r * cos(theta) = p * sin(phi) * cos(theta)
y = r * sin(theta) = p * sin(phi) * sin(theta)
z = p * cos(theta)
theta: angle of the turtle's projection on the x-y plane.
phi: turtles angle of incidence to the z axis.
p: distance of the turtle from the origin.
HOW TO USE IT
Click the different setup-SHAPE buttons to generate different 3d-shapes. The turtles are randomly distributed about the surface of the shape. Click the go (forever) button to run the model.
GO starts rotating the model.
COLOR determines the color that is used to simulate depth in generating the various shapes (uses predefined NetLogo color constants).
NUM-TURTLES determines the number of turtles that are used to generate the various shapes.
SHAPE-SIZE determines the overall size of the shape. Most often it is radius or edge length.
THETA-VELOCITY determines the speed at which the turtles are rotated.
(Rotating turtles in the rotate-turtles procedure is implemented simply by increasing each turtle's theta variable by theta-velocity! ROTATING turtles (on its z-axis) is easy in spherical coordinates. However it's far easier to TRANSPOSE turtles in cartesian coordinates.)
THINGS TO NOTICE
Notice that turtles closer (positive) on the y-axis appear lighter in shade and turtles further away (negative) appear darker in shade.
THINGS TO TRY
Try adjusting the theta-vel or render-color slider as the model is running. This will provide real time feedback to your adjustments.
EXTENDING THE MODEL
[EASY] Adjust the setup-square procedure to generate a rectangle.
Create a procedure to transpose turtle coordinates. Remember that it is easier to transpose in cartesian coordinates.
Create a procedure to generate new 3D geometries.
Try animating the phi variable. Conceptually why does this not make sense?
Create a procedure to rotate the geometries on a different axis.
[VERY DIFFICULT] Create a procedure to view the geometries at ANY angle instead of the present three.
NETLOGO FEATURES
Notice the use of scale-color to show the depth of turtles and thereby simulate 3D.
CREDITS AND REFERENCES
To refer to this model in academic publications, please use: Wilensky, U. (1998). NetLogo 3D Solids model. http://ccl.northwestern.edu/netlogo/models/3DSolids. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
In other publications, please use: Copyright 1998 Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/3DSolids for terms of use.
(back to the NetLogo Models Library)