O'Reilly logo

Alice 3 Cookbook by Vanesa S. Olsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling the camera with the keyboard

In this recipe, we will use two keys to zoom in and zoom out of the scene. We will move the camera towards and away from one of the actors according to the key pressed by the user. The rendered view will show the effects of the camera’s movement.

Getting ready

We will use an existing project that has one key listener defined for biff, one of the two characters we have been using from the Looking Glass Characters gallery.

  1. Open the project saved in the Controlling an actor with keystrokes recipe.
  2. Click on Edit Code, at the lower-right corner of the big scene preview. Alice will show a smaller preview of the scene and will display the Code Editor on a panel located at the right-hand side of the main window.
  3. Click ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required