3d fishbowl in Squeak

by Diego Gomez Deck - english translation by German Morales

Introduction

You will learn how to build a 3d fishbowl using Wonderland and eToys scripts. Don't worry about the meaning of these names now, you will learn more about them later.

Let's begin

Don't run away with the idea that writing code is bad, but for this tutorial you need to write just one line of code: Wonderland new.

In order to write it, you have to open a Workspace. You do that clicking with the left button on the World, and selecting the open... option and then workspace (k)

Now write the following in the Workspace: Wonderland new, and then evaluate it. To do so, 'paint' what you just wrote (select it using the mouse), then press the right button on the mouse and finally select do it (d)

If it all went OK, you will see this:

Next, you need to get the Halos in order to handle your objects. To do so, click with the left button on the camera object, while pressing the ALT key. You get the following:
If you drag the yellow Halo , you can change the object's size. Make it larger to work more easily. Another halo you can use is the black one . Use it to move the object to another place.

Now let's draw a fish... select the white halo . When you do that, the mouse cursor changes to an X. With that X, paint a fish shape over the camera. When you release the mouse button, squeak will create a 3d fish for you.

Take some time to play with your fish. If you click with the left button and then drag the mouse without releasing the button, you can move the fish in the 3d space. If you left click with the SHIFT key pressed, you can move the fish up and down, by pressing CONTROL you can rotate it, and by pressing CONTROL+SHIFT you can rotate it freely.

Now you can ask for the fish halos.

The fish shape is nice, but its color is boring... to improve it, select the white halo with a pen picture . When you do that, a new tool appears:
Now you can select the painting bucket and then a color... and apply the bucket to the fish. Later you can select the brush and draw on the fish. Take all the time you want to complete this step... painting is fun, remember?... When you've finish, press the Keep button
(tip: while painting the fish, you can move and rotate the fish as you learned before)
This is my fish painted:


Now you can play with movement and actions in 3d... When you created the fish, a new item named sketch1 appeared in the Wonderland editor window, pressing with the right button on the new item you see some options to play with:

Test it all, if you don't like what happened, you can press the Undo button .


NOTE: you can have hours of fun with what yo've learned so far. Take all the time you want to enjoy yourself with it.


Let's continue...
Ask for the fish halos again, but now select the cyan halo with an eye picture . When you do so, your fish's Viewer appears. This Viewer allows you to look at the internals of your fish

If you press the exclamation sign which is next to or the fish will follow your orders. You can also change the X, Y or Z values to move the fish, or if you move the fish with the mouse you can see how this values change.

My fish is too fat... if I click where it says 'color' and search for the category named 'geometry':

now I can change the 'width' value until the fish is thin enough. I left it like this:


Now drag the to an empty space in the World. When you do that, the following script appears:

Pressing on the clock you start the script. Your fish would be turning round! clicking again on the clock you make your fish stop.

Now drag the , but instead of dropping it in an empty space, drop it over the previous script. Youe get the following...


Now when you run the script, your fish will make a turn!!!


A fishbowl with only 1 fish is going to become boring, but remember that you have IMAGINATION, and you can use it to make the fishbowl more exciting, more beautiful... This is one of the goals of Squeak, to extend your creative capacity...

I hope you enjoyed it as much as I did!... see you in the next tutorial, Diego Gomez Deck

back to the tutorials main page