Often, it is useful in instructional media to show the changes across time occurring in a given process from more than one perspective, at the same time. Real-time 3D excels at demonstrating concepts in this way. The first multiple camera technique that I examine uses multiple sprites in the same 3D world to do just that.
As you recall, the 3D scene shows a single animated process but has cameras set up at several different locations, each trained on a part of that process. Initially, the four Shockwave 3D sprites of the jet engine scene in the sample1.dir movie all show the scene through its default camera (see Figure 2). When executed, the four Shockwave 3D sprites each look at the scene through a different camera (see Figure 4).
Figure 4. The sample1.dir movie in action
I accomplished this by using a single behavior attached to each sprite, which instructs it to use a specific camera, specified as a behavior parameter (see Figure 5).
Figure 5. Inspecting the camera-selecting behavior
The behavior accomplishes this by using a single line of code in its
beginSprite handler which sets the camera property of the
sprite to a specific camera name, based on the camera-setting code described
earlier. The remaining code in the behavior helps specify the camera
that the sprite will use, through a behavior property:
property pCamera on beginSprite me -- set this sprite's camera to the -- one selected sprite(me.spriteNum).camera = sprite(me.spriteNum).member.camera(pCamera) end on getPropertyDescriptionList me propList = [:] -- let the author specify which -- camera to use by name addProp propList, #pCamera, [#comment:"Camera name: ", #format:#string, #default:""] return propList end