Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 9 additions & 5 deletions 3D/Code Examples/Airplane Landing Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[globals [ speed ]
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
globals [ speed ]

to setup
clear-all
Expand Down Expand Up @@ -44,7 +45,8 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-13" height="350" showTickCounter="true" patchSize="12.0" fontSize="10" wrappingAllowedY="true" width="330" tickCounterLabel="ticks" maxPycor="13" updateMode="1" frameRate="30.0" maxPzcor="13" maxPxcor="13" minPxcor="-13" minPzcor="-13"></view3d>
<button x="58" y="52" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="70" sizeVersion="0">setup</button>
Expand All @@ -54,11 +56,13 @@ end
<button x="58" y="204" height="33" disableUntilTicks="true" forever="false" kind="Observer" width="141" sizeVersion="0">ride turtle 0</button>
<button x="58" y="134" height="33" disableUntilTicks="true" forever="false" kind="Observer" width="141" sizeVersion="0">watch turtle 0</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This model is an animation of an airplane landing at an airport.

<!-- 2004 -->]]></info>
<!-- 2004 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Bouncing Balls Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[breed [ balls ball ]
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
breed [ balls ball ]

balls-own [ z-vel x-vel y-vel ]
turtles-own [ col ]
Expand Down Expand Up @@ -68,7 +69,8 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-9" height="254" showTickCounter="true" patchSize="12.0" fontSize="10" wrappingAllowedY="true" width="241" tickCounterLabel="ticks" maxPycor="9" updateMode="1" frameRate="30.0" maxPzcor="9" maxPxcor="9" minPxcor="-9" minPzcor="-9"></view3d>
<button x="63" y="53" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="85" sizeVersion="0">setup</button>
Expand All @@ -79,15 +81,17 @@ end
<button x="70" y="188" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="145" sizeVersion="0">reset-perspective</button>
<button x="69" y="153" height="33" disableUntilTicks="true" forever="false" kind="Observer" width="146" sizeVersion="0">watch one-of balls</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This is an example that displays many of the capabilities of NetLogo 3D.

## HOW TO USE IT

The SETUP button creates BALL-COUNT balls poised above the "floor" of the world. GO releases the balls and "gravity" pulls them down. The balls will bounce until they lose momentum. If the COLOR-SPEED? switch is on the color of the ball will be scaled the speed it is moving. If the TAILS? switch is on the balls will leave a trace of the path they have taken.

<!-- 2005 -->]]></info>
<!-- 2005 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Hill Climbing Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[breed[ stayers stayer ] ;; the actual points of the landscape
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
breed[ stayers stayer ] ;; the actual points of the landscape
breed[ walkers walker ] ;; turtles that move around the landscape

walkers-own
Expand Down Expand Up @@ -85,13 +86,15 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-10" height="152" showTickCounter="true" patchSize="6.0" fontSize="10" wrappingAllowedY="true" width="241" tickCounterLabel="ticks" maxPycor="10" updateMode="1" frameRate="30.0" maxPzcor="5" maxPxcor="10" minPxcor="-10" minPzcor="0"></view3d>
<button x="24" y="51" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="91" sizeVersion="0">setup</button>
<button x="24" y="90" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="91" sizeVersion="0">go</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This example shows make a terrain in 3D and move turtles across the terrain. This is much like the Hill Climbing Example in 2D. However, the elevation variation in the terrain is visible in the 3D space.

Expand All @@ -103,7 +106,8 @@ The hill climbing code is very similar to `uphill` in 2D. However, we want the t

Note that terrain models are not full 3D models. Each spot on the landscape only has eight neighbors; we use links to indicate the neighbors of each location since it cannot be determined spatially. We do, however, use the 3D space to display the height of each location.

<!-- 2007 -->]]></info>
<!-- 2007 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Neighborhoods Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[;; This procedure creates 8 turtles in puts them in a circle
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
;; This procedure creates 8 turtles in puts them in a circle
to setup
clear-all
setxyz 10 -20 6 ; set the observer position
Expand Down Expand Up @@ -63,7 +64,8 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-17" height="341" showTickCounter="true" patchSize="9.0" fontSize="10" wrappingAllowedY="true" width="321" tickCounterLabel="ticks" maxPycor="17" updateMode="1" frameRate="30.0" maxPzcor="6" maxPxcor="17" minPxcor="-17" minPzcor="-6"></view3d>
<button x="76" y="29" height="37" disableUntilTicks="false" forever="false" kind="Observer" width="127" sizeVersion="0">setup</button>
Expand All @@ -76,7 +78,8 @@ end
</chooser>
<button x="10" y="124" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="120" sizeVersion="0">paint-in-radius</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This is a 3D version of the 2D model Neighborhoods Example This code example shows how to use the basic 2D and 3D neighborhood primitives in a 3D world. These include `neighbors`, `neighbors6`, `in-radius`, and `at-points`:

Expand All @@ -90,7 +93,8 @@ This is a 3D version of the 2D model Neighborhoods Example This code example sho

Although in this example, we only change the color of the reported patches, you can of course do more complicated operations, including assigning that agentset to a variable. This is particularly useful for Cellular Automata models.

<!-- 2004 -->]]></info>
<!-- 2004 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Network Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[to setup
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
to setup
clear-all
;; These shapes were drawn using the Shapes Editor, on
;; the Tools menu.
Expand Down Expand Up @@ -47,7 +48,8 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-20" height="436" showTickCounter="true" patchSize="10.0" fontSize="10" wrappingAllowedY="true" width="416" tickCounterLabel="ticks" maxPycor="20" updateMode="1" frameRate="30.0" maxPzcor="20" maxPxcor="20" minPxcor="-20" minPzcor="-20"></view3d>
<button x="100" y="112" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="77" sizeVersion="0">go</button>
Expand All @@ -56,7 +58,8 @@ end
<slider x="8" step="1" y="150" max="100" display="number-of-edges" height="33" min="0" direction="Horizontal" default="20.0" variable="number-of-edges" width="179" sizeVersion="0"></slider>
<button x="27" y="187" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="141" sizeVersion="0">wiggle-nodes</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This is a 3D version of the 2D model Network Example. The only significant difference from the 2D code is that we spread the nodes around the world in 3D space.

Expand Down Expand Up @@ -88,7 +91,8 @@ Network Example

Owen Densmore's "Layout" model, available from the NetLogo User Community Models web page ([http://ccl.northwestern.edu/netlogo/models/community/](http://ccl.northwestern.edu/netlogo/models/community/)), shows how to make the nodes and edges automatically reposition themselves into a pleasing-looking layout. It also shows how to generate a network with "hubs", where the distribution of the number of edges the nodes have follows a power law.

<!-- 2004 -->]]></info>
<!-- 2004 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Shapes Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[to setup
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
to setup
clear-all
let threedshapes [ "default" "square" "circle" "triangle" "cylinder" "line" ]
let positions [ "rt 60" "rt 120" "tilt-up 60" "tilt-up 120" "tilt-up 180" ]
Expand Down Expand Up @@ -28,7 +29,8 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-16" height="422" showTickCounter="false" patchSize="12.0" fontSize="10" wrappingAllowedY="true" width="498" tickCounterLabel="ticks" maxPycor="16" updateMode="0" frameRate="30.0" maxPzcor="2" maxPxcor="20" minPxcor="-20" minPzcor="-2"></view3d>
<button x="105" y="45" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="82" sizeVersion="0">setup
Expand All @@ -42,11 +44,13 @@ end
<button x="32" y="92" height="33" disableUntilTicks="false" forever="true" kind="Turtle" width="108" sizeVersion="0">right 0.1</button>
<button x="32" y="126" height="33" disableUntilTicks="false" forever="true" kind="Turtle" width="108" sizeVersion="0">tilt-up 0.1</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This code example shows all of the 3D shapes currently available in NetLogo 3D.

<!-- 2005 -->]]></info>
<!-- 2005 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Spherical Path Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[globals [ radius ]
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
globals [ radius ]

to setup
clear-all
Expand Down Expand Up @@ -67,7 +68,8 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-16" height="455" showTickCounter="false" patchSize="13.0" fontSize="10" wrappingAllowedY="true" width="435" tickCounterLabel="ticks" maxPycor="16" updateMode="1" frameRate="30.0" maxPzcor="16" maxPxcor="16" minPxcor="-16" minPzcor="-16"></view3d>
<chooser x="35" y="120" height="45" variable="step-size" current="1" display="step-size" width="175" sizeVersion="0">
Expand All @@ -89,7 +91,8 @@ end
<button x="35" y="29" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="175" sizeVersion="0">setup</button>
<slider x="35" step="1" y="65" max="360" display="wiggle-range" height="33" min="0" direction="Horizontal" default="0.0" variable="wiggle-range" units="degrees" width="175" sizeVersion="0"></slider>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This shows how to make turtles move along a perfect sphere. The first procedure moves turtles based a user-defined distance to be travelled; the second moves then based on a user-defined degree measure.

Expand All @@ -101,7 +104,8 @@ We use trigonometry to calculate the turtle's successive positions on the circle

Turtles Circling, Circular Path Example

<!-- 2007 -->]]></info>
<!-- 2007 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Three Loops Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[to setup
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
to setup
clear-all
create-turtles 3 [
set heading who * 90
Expand All @@ -21,17 +22,20 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-9" height="254" showTickCounter="true" patchSize="12.0" fontSize="10" wrappingAllowedY="true" width="241" tickCounterLabel="ticks" maxPycor="9" updateMode="1" frameRate="30.0" maxPzcor="9" maxPxcor="9" minPxcor="-9" minPzcor="-9"></view3d>
<button x="50" y="57" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="63" sizeVersion="0">setup</button>
<button x="50" y="99" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="63" sizeVersion="0">go</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This model shows three turtles moving around in NetLogo 3D. The gray turtle is changing only pitch and moving forward, the red turtle is changing only roll, and the orange turtle is changing pitch, roll, and heading as it is using right3d.

<!-- 2005 -->]]></info>
<!-- 2005 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Trails Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[to setup
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
to setup
clear-all
create-turtles number-of-drawers
[ set size 3
Expand All @@ -22,21 +23,24 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-20" height="436" showTickCounter="true" patchSize="10.0" fontSize="10" wrappingAllowedY="true" width="416" tickCounterLabel="ticks" maxPycor="20" updateMode="1" frameRate="30.0" maxPzcor="20" maxPxcor="20" minPxcor="-20" minPzcor="-20"></view3d>
<slider x="10" step="1" y="40" max="100" display="number-of-drawers" height="33" min="0" direction="Horizontal" default="10.0" variable="number-of-drawers" width="179" sizeVersion="0"></slider>
<button x="38" y="82" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="118" sizeVersion="0">setup</button>
<button x="38" y="117" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="118" sizeVersion="0">go</button>
<button x="38" y="152" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="118" sizeVersion="0">clear-drawing</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This code example shows how to use turtles to draw lines that trace a turtle's trajectory.

Since each line segment in a turtle, the model will eventually slow down once there are too many lines on the screen. If your model is creating too many lines, decrease the resolution of each line by moving more than once between calls to draw-line-to.

<!-- 2006 -->]]></info>
<!-- 2006 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
14 changes: 9 additions & 5 deletions 3D/Code Examples/Turtle Dance Example 3D.nlogox3d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 3D 7.0.4" snapToGrid="false">
<code><![CDATA[to setup
<model version="NetLogo 3D 7.1.0-beta1" snapToGrid="false">
<code><![CDATA[
to setup
clear-all
create-turtles number-of-turtles [
fd 9
Expand All @@ -22,7 +23,8 @@ end

; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.]]></code>
; copyright and related or neighboring rights to this model.
]]></code>
<widgets>
<view3d wrappingAllowedZ="true" x="0" wrappingAllowedX="true" y="0" minPycor="-9" height="254" showTickCounter="true" patchSize="12.0" fontSize="10" wrappingAllowedY="true" width="241" tickCounterLabel="ticks" maxPycor="9" updateMode="1" frameRate="30.0" maxPzcor="9" maxPxcor="9" minPxcor="-9" minPzcor="-9"></view3d>
<button x="20" y="68" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="90" sizeVersion="0">setup</button>
Expand All @@ -31,11 +33,13 @@ end
<button x="7" y="103" height="33" disableUntilTicks="false" forever="false" kind="Turtle" width="103" sizeVersion="0">pen-down</button>
<button x="113" y="103" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="103" sizeVersion="0">clear-drawing</button>
</widgets>
<info><![CDATA[## WHAT IS IT?
<info><![CDATA[
## WHAT IS IT?

This is a simple Code Example to help new users understand how turtles move in 3D space. On each tick each turtle will move forward, turn left and pitch up.

<!-- 2005 -->]]></info>
<!-- 2005 -->
]]></info>
<turtleShapes>
<shape name="default" rotatable="true" editableColorIndex="0">
<polygon color="-1920102913" filled="true" marked="true">
Expand Down
Loading
Loading