How to do a Squeak movie

John Hinsley jhinsley at telinco.co.uk
Tue Apr 24 12:43:41 UTC 2001


Can someone explain how to produce a Squeak movie? I'm trying to follow
the instructions in the Cookbook/978 and I'm coming to the conclusion
that the code in there no longer works (if it ever did). And I suspect
that there might be a more Morphic way of doing it. (I hope so!)

Here's the relevant sip with my comments:

> 2. Use a tool (for instance AnimationShop from PaintShop5) to save the frames as bitmaps. The animated gif has 12 frames, so we name the bitmaps like the following: luxo003.bmp, luxo006.bmp, .... ,luxo036.bmp
> You can also download a zip file with the frames.

Well, OK. I'd sooner have used a better format, like .gif or .jpeg, but
I've used Gimp to copy each layer and produce a .bmp. And why that
strange naming method? Surely if there are 12 bitmaps, then luxo001 to
luxo012 makes as much sense? Looks to me as though there's some unspoken
of wizardry going on here.... 

> 3. Evaluate the following code in squeak:
 
> 
> | ps zps f32 out ff |
> 
> out _ FileStream newFileNamed: 'luxo.movie'.
> out binary.
> ff _ Form extent: 64 at 64 depth: 32.
> 
> 1. 
> (22 64 64 32 12 100000) , (7 to: 32)
> 
> do: [:i | out nextInt32Put: i].
>  
> 3 to: 36 by: 3 do: [
>  :i | ps _ i printString. zps _ ps padded: #left to: 3 with: $0.
>  f32 _ Form fromFileNamed: 'luxo' , zps , '.bmp'.
>  f32 displayOn: ff at: 0 at 0. "Convert down to 16 bits"
>  ff display; writeOnMovie: out].
>  out close.
> 

Hmmm. In 3.0 I get: 

1. 
(22  right parenthesis expected ->64 64 32 12 100000) , (7 to: 32)

Every time. I find this code really difficult to read: I've no idea what
zps _ ps is all about and presumably the line fromFileNamed: 'luxo'
should be the path to my files. Ah, there's that zps again. 

Any ideas?

Cheers

John

-- 
******************************************************************************
Marx: "Why do Anarchists only drink herbal tea?"
Proudhon: "Because all proper tea is theft."
******************************************************************************





More information about the Squeak-dev mailing list