Wednesday, January 27, 2010

Alice -- Day 4

Tutorial: Your First Alice Program


Lab project

Create a new world using the Snow template. Place a parking meter and an ice skater in the world. Do not perform any manual operations to set the position or orientation of the ground, the parking meter, the ice skater, or the camera. However, you may perform manual operations to cause the objects in the world to be invisible at startup.

Rename the default method main.

Write the following two world-level methods, and cause these two methods to be called in sequence by the code in the main method:

  • setTheStage
  • playTheShow

Cause the ground, the skater, and the parking meter to be invisible when you click the Play button or the Restart button to play your world.

Assume that the blue axis belonging to the ground points due south.

In the method named setTheStage:

  • Align the viewpoints of all objects with the world.
  • Position the skater 2 meters due east of the parking meter in her default standing position with her feet on the ice facing the parking meter.
  • Position the camera 10 meters due south of the parking meter, 1.5 meters above the ground, facing the skater.

Cause the above actions to take place as quickly as possible while the objects are invisible. Then do the following in sequential order:

  • Cause the ground to become totally visible in 0 seconds.
  • Cause the parking meter to become totally visible over a period of 2 seconds.
  • Cause the skater to become totally visible over a period of 2 seconds.

Then terminate the method named setTheStage.

Write the code in the method named playTheShow to cause the skater to transition from her original default standing position on the ice to the pose and viewpoint shown in Figure 11 over a period of one second. Note that the skater does not move horizontally in this method. Also she does not rotate around her green axis. In other words, she is 2 meters from the parking meter facing in the general direction of the parking meter in Figure 11.

Then terminate the method named playTheShow.

The final view of your world be must as shown in Figure 11 with the skater centered horizontally in the window. When you adjust the size of your World Running... window to match the size of Figure 11, the sizes of the parking meter and the skater must be as shown and the relationships among the skater, the parking meter, and the horizon must be as shown.

Save your world in a file named Alice125LabProjA.a2w and be prepared to deliver it to your instructor in whatever manner the instructor specifies.

Make certain that your preferences are set to Java Style in Color.

Select Export Code For Printing... on the File menu and save your source code in a file named Alice125LabProjA.html. Also be prepared to deliver this file to your instructor in whatever manner the instructor specifies.

Figure 11. Required final program output for lab project A.

View a movie of the lab project

You can download and play a small, low-quality movie of my version of the lab project as it being executed from the Resume button (see Downloads). This movie was designed to give you a rough idea of how your program should behave. The movie was purposely reduced in size and recorded in a low-quality format to reduce the file size and hence reduce the download time.

Because of the low quality of the movie, the execution of your program should provide much smoother animation, and should be less grainy than the movie. Also, because of the low quality of the movie, the timing in the movie doesn't necessarily match the duration times specified for the lab project.

I attempted to synchronize the beginning of the recording with the beginning of the program execution by starting, then quickly pausing, and then resuming the execution. If you watch closely, when the movie starts running, you will see the mouse pointer click the Resume button, and the movie will show one complete pass through the program.

You should view this movie in its original size. If you allow the media player to enlarge it, the quality will be poor.

Monday, January 25, 2010

Alice -- Day 3

You will be reviewing how to set the stage. Read the following online tutorials and complete the labs as shown.

Tutorial: Setting the Stage Manually, Part 1

Lab Project 1:
Create a new world, select the Sand template, and add a Coach object from the People thumbnail.

Modify the color properties of the various subparts of the Coach object to cause the coach to be wearing a red shirt as shown in Figure 11.

Arrange the coach's limbs into the pose shown in Figure 11.

Adjust the camera position and orientation (viewpoint) to approximate the image shown in Figure 11 when you manually resize your World Running... pane to approximately match the size of Figure 11.


Save your world in a file named Yourlastname_Alice115LabProj.a2w and save it in the appropriate x drive folder.


Tutorial: Setting the Stage Manually, Part 2

Lab Project 2
Use interactive method calls (not buttons) on an ice skater object and the camera to produce the pose and the camera viewpoint shown in Figure 18. Save your world in a file named Yourlastname_Alice120LabProj.a2w and save to the x drive appropriate folder.

Friday, January 15, 2010

Alice -- Day 2

Read the Tutorials & Complete Labs:

Tutorial 1: Setting the Stage

Labs Project

Project 1: Object manipulator buttons

Create a new world. Select the template of your choice and click the Open button. Switch into scene edit mode by clicking the ADD OBJECTS button and drag an object from the Gallery into your world. Click on the object in the world to make certain that it is selected.

Select the leftmost button in the line of seven buttons in the upper right area of the screen in Figure 2. Drag the mouse on the object and observe the behavior. Try to understand that behavior. Continue this process for each button in the line going from left to right. (If you allow the mouse pointer to hover over a button, the text above the line of buttons will provide a brief description of the purpose of each button.)

To improve your understanding of the behavior, you may find it useful to read ahead in the lesson titled "Setting the Stage Manually, Part 1" for information on the behavior imparted by each of the seven buttons.

Project 2: Camera controls

Using the world that you created in Project 1 above, click and drag your mouse pointer on each of the ten arrow heads of the three sets of blue arrows that appear below the world in Figure 2. Observe and try to understand the resulting behavior. (If you allow the mouse pointer to hover over a blue arrow head, a tooltip will appear that explains the purpose of each set of blue arrows.)

You may also find it useful to read ahead in the lesson titled "Setting the Stage Manually, Part 1" for information on the behavior imparted by each of the blue arrow heads.

Tutorial 2: Objects in 3-D Space

Lab Project:

Create a new world, select the Snow template, and add an IceSkater object from the People thumbnail.

Arrange the skater's limbs into the pose shown in Figure 13. In other words, Figure 13 shows what should appear in the World Running... pane when you Play your world. Note, however, that the World Running... pane is re-sizable so yours may be a different size.

Hints: You may need to read ahead in the next lesson to learn about the camera controls and the object manipulator buttons. You may also need to check the box labeled affect subparts.

Adjust the camera position and orientation (viewpoint) to approximate the image shown in Figure 13 when you manually resize your World Running... pane to approximately match the size of the above picture.


Save your world in a file named yourlastname_Alice110LabProj.a2w and save to the x drive in the Lesson 2 Folder.