NetLogo banner

Home
Download
Help
Forum
Resources
Extensions
FAQ
NetLogo Publications
Contact Us
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

  Donate

NetLogo Models Library:
Code Examples/Extensions Examples/view2.5d

(back to the library)

2.5d Patch View Example

[screen shot]

Note: If you download the NetLogo application, every model in the Models Library is included.

WHAT IS IT?

This example demonstrates the use of the view2.5d extension. It is based on the Hill Climbing Example model, which shows how to make turtles climb hills using the uphill command. The view2.5d extension allows much better visualization of the "hills" generated in the example.

The model opens a separate "patch view" window by calling:

view2.5d:patch-view window-name [ [the-patch] -> [ pcolor ] of the-patch ]

The anonymous reporter supplied to the view2.5d:patch-view primitive is used by the extension to set the height of each patch.

At the end of the setup procedure, you'll see a few other customizations of this "patch view":

  • view2.5d:decorate-patch-view tells the extension to also show the turtles in the patch view window.

  • view2.5d:set-observer-angles tells the extension to change the position (on an imaginary sphere) of the observer in the view (the two numbers are heading and pitch measured in degrees)

  • view2.5d:set-z-scale tells the extension to change the scale of the z-axis, in this case making our peaks "taller".

In the go procedure, we use view2.5d:update-patch-view to refresh the patch view using the current state of the model.

For more information, please refer to the view2.5d extension documentation and checkout the 2.5d Turtle View Example model.

(back to the NetLogo Models Library)