Tutorial 1 - Camera TestingNow that you have successfully set up the camera hardware, it is time to test your installation by feeding live video into Director. The Director Movie for this tutorial contains the configuration explained below: DART-tutorial-1.dir (23 KB)
In this tutorial you will learn how to interact with Director and the DART libraries. You will see the basic DART setup and learn some of the intricacies of working with DART. At the end of this tutorial you should have a live video image in the background of the stage like this:
The 3D World
In every DART application, there must be a Shockwave 3D world as the container for all AR-related behaviors. If you don't have one already, create a blank 3D object, call it "3D World", and place it in your internal cast library. Next drop it on to the score.
Now put a loop on the score. This loop is used to keep the play head at a particular frame until the system is told to move to another loop. This is helpful for designing the flow of an application. Make sure to move it to the third or fourth frame on the score so that DART has a few frames to initialize the application.
Next, you must configure the 3D camera on the 3D World. The 3DCamera is the viewport into the virtual world and determines what part of the 3D world the Stage will actually see. You must first access the DART-Lingo cast libraries. Import the libraries to the movie by going to File -> Import and go to the directory called DART-Lingo. Select all the .cst files here to import all of the scripts.
The 3DCamera behavior is under DART-Framework.
Drag and drop "3DCamera " onto the 3D World sprite. You should be presented with a properties window. For now, just keep the default properties how they are. You will learn how to modify these later.
Next, you need to put a container on the score to hold behaviors for the camera. This is a common technique used in DART and most things will start with a container. A container is just a blank text file, but it is needed as a basis to add behaviors. We have provided several specially named containers – in this case, it is called “Cameras”.
Place this container on the score underneath the loop. Modify the length so it only stretches over one frame. Next, find the LiveVideo behavior from the DART-Framework library and place this on top of the container.
(Live Video icon)
You should now see the properties page for the LiveVideo. Choose the type of camera based on what hardware you have. Choose the input and output types for the camera (usually rgb for both) and camera size (most cameras support 640x480, but 320x240 might provide a faster frame rate). Make sure the camera configuration file has the correct name for the local ".cam" file on your machine. Provide the correct path for the Data directory provided in the installation. Click OK to save these settings - these can be changed by going to the properties inspector for the 3D World sprite.
Also, make sure the Director environment is setup correctly. Under movie settings:
Preferred 3D Renderer: #openGL
Stage Size: 640 x 480
Location: 0 x 0
Check RGB, not Index
Under 3D World sprite properties:
Running the Application
Now to test your application, make sure you first save the Director Movie, and then rewind the play head. Every time you play an application in DART, you MUST rewind the play head. There are certain initializations that must happen before the play head stops in the first loop.
When you push play, after a couple of seconds, you should see a live video feed onto the stage. If this doesn’t work, check the message window for error messages. Make sure all the settings in Director are correct. Go back and check the installation procedure and path names. Reinstall DART, if necessary.
Link to this Page