view2.5extension

view2.5extension preview image

1 collaborator

Emily_warsavage Emily Warsavage (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.1 • Viewed 132 times • Downloaded 25 times • Run 0 times
Download the 'view2.5extension' modelDownload this modelEmbed this model

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


WHAT IS IT?

(a general understanding of what the model is trying to show or explain)

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

extensions [ view2.5d ]

globals [
  observer-distance ; the observer's distance from its "focus point"
  observer-heading  ; the heading of the observer's angular perspective
  observer-pitch    ; the pitch of the the observer's angular perspective
  observer-x-focus  ; the x coordinate the observer is "looking at" in the patch plane
  observer-y-focus  ; the y coordinate the observer is "looking at" in the patch plane
  z-scale           ; factor for scaling the computed turtle height value
]
patches-own [ my-var ]

to setup

  ca
  random-seed 271828
  init-globals
  ask patches [ set pcolor random-float 2 + 2  ]
  ask patches [ set my-var pcolor - 2]

  crt num-turtles [ move-to one-of patches ]

  reset-ticks
  create-patch-view
end 

to create-patch-view
  view2.5d:patch-view window-name [ the-patch -> [my-var] of the-patch ]
  wait 1
  set-z-scale
  set-observer-distance
  set-observer-xy-focus
  set-observer-angles
  view2.5d:decorate-patch-view window-name
end 

to go-turtles
  ask patches [
    set my-var min list 5 max list 0  my-var + count turtles-here - 1
  ]
  ask turtles [
    rt (random 90) - 45
    fd random-float .2
  ]
  wait .2
  view2.5d:update-all-patch-views
  tick
end 

; One source for the window name

to-report window-name
  report "My View"
end 

; One could explore the effect of these variables by giving them each a slider

to init-globals
  set observer-distance 32
  set observer-x-focus 3
  set observer-y-focus 2
  set observer-heading 28
  set observer-pitch 56
  set z-scale 1.5
end 

to set-observer-distance
  view2.5d:set-observer-distance window-name observer-distance
end 

to set-observer-xy-focus
  view2.5d:set-observer-xy-focus window-name observer-x-focus observer-y-focus
end 

to set-observer-angles
  view2.5d:set-observer-angles window-name observer-heading  observer-pitch
end 

to set-z-scale
  view2.5d:set-z-scale window-name z-scale
end 

There is only one version of this model, created over 4 years ago by Emily Warsavage.

Attached files

File Type Description Last updated
view2.5extension.png preview Preview for 'view2.5extension' over 4 years ago, by Emily Warsavage Download

This model does not have any ancestors.

This model does not have any descendants.