Importing Image to World

If you're planning to load an image in NetLogo. Check out the available commands below and decide which one is approprite.

> import-pcolors-rgb filename
Reads the image file and scales it to the dimensions of the patch grid while maintaining the original aspect ratio of the file. The pcolor variable of the patches contain an RGB list, which corresponds to the exact colors in the original image. And because the image can be detected through patch's pcolor value, agents can perform, analyze or interact with the image.



import-pcolors-rgb


> import-pcolors filename
Unlike import-pcolors-rgb, the resulting patch colors may be distorted since NetLogo's color range availability is limited. Images with bigger size and with different colors will eventually take longer time to load. And because it sets the pcolor of patches, agents can detect the image through patch's pcolor value.


import-pcolors

> import-drawing filename
In this type, agents cannot interact with or process images because they cannot sense the imported image. This is useful when an image is only used  as static backdrop. However, if agents need to interact with the image, import-pcolors-rgb or import-pcolors should be used.


import-drawing


( I do not own the image used in the examples. They are merely used for demonstration purposes only. )
Share on Google Plus

About SSabal

:)
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment