Monday, January 13, 2014

A GIF in Netlogo? Yup.

What's in common with the following photos?


You might want to say: 
"All of these photos have a shark, isn't it obvious!"
But you're wrong. All of these photos are fake. None of those photos have real sharks. SO THERE. FOOLED YOU. 

---

Moving on....

GIFS!

Oh, but I think we have a problem. When you read "gif" how do you say it? Did you say "gift" without the 't'? Or did you say "jif" like you're telling your mom what peanut butter to buy.

Well. *ahem* Hank is going to put this argument to death.



For me personally, I love peanut butter, and Jif is a peanut butter company, and I LOVE talking about peanut butter and I LOVE gifs, so naturally...

I say Jif

And for those of you who dont like saying jif, here's a cute ferret:


GET TO THE POINT, MAN!
So there's this gif:
Note that I did not create it, as my name is not Sarah Johnson. We are also working our best scientists around the clock to find out what the shark is saying at the end of the gif. We're assuming it is shark-speak, and is never to be uttered.

So I took the gif file, I used a handy-dandy split-into-frames command Dr. Stonedahl showed me, (I can post this command soon), I selected the frames that showed the shark swimming, and I made sure the images from each frame were filled in using the image editor, Gimp. I loaded each image into netlogo, and then "mosaic-fied" them, playing them in order of the gif. This generated the swimming animation of the tail, but the image did not move as if it were going somewhere. Because each frame was a new image, I could not simply use the method in the example files from day5 class. (as they would only work for one image, not multiple, because the patches change) Dr. Stonedahl helped me create a process that stores the value and make sure the new frame moves more than the frame prior, so that everything stacks up correctly. The result?



[click to enlarge, and then click to cycle through them]



A gif! (of sorts)
I'll post an actual gif version of it eventually.

1 comment:

  1. You simply have too much fun. I am with you on the gif (jif). Peanut butter is good too.

    ReplyDelete