3D Animation Workshop: Lesson 118: WildTangent for Online Games | 2 | WebReference

3D Animation Workshop: Lesson 118: WildTangent for Online Games | 2

Lesson 118 - WildTangent for Online Games - Part 2

A WildTangent project typically requires geometry (models) created in standard packages, as well as bitmap images for textures and sound files. All these resources need to be packaged into appropriate form using WildTangent utility programs. WildTangent also offer a special program for assembling scenes. But let's leave these issues aside to get right to the heart.

The core of WildTangent development is the Web Driver API (Application Programming Interface). It's a collection of programming objects uses to create and control a 3D interactive application. These objects can be used through JavaScript or Java for content to be displayed in a Web browser, and through C++, Visual Basic and Java for content in standalone applications. Just as with Shout3D, commercial development using the Wild Tangent API should be done in Java, but JavaScript provides an outstanding way to learn the system.

Whatever language you use, programming your project involves working within the fundamental framework common to all interactive 3D. Your program must first set up everything needed to begin the interactive experience. This "initialization" typically involves getting the scene elements organized and putting everything in its proper place before raising the curtain. Once initialized, the program responds to mouse and keyboard input from the user, typically needs to perform actions or tests between every render cycle (such as moving animated objects).

A great place to start is by looking over the JavaScript template file that comes with the SDK. This simple example creates an animated rotating box without using any outside resources at all. The program itself generates the box, and no bitmaps are used as textures. To set up the scene, a WTStage object (which amounts to the scene) is first created. Its background color is set and a camera is added and positioned. An ambient light and a directional light are then created and added to the scene.

A box model is created and each of its sides is assigned a different color. A WTGroup object must then be created to hold the box geometry. This group object is simply a standard transform node that allows the geometry to be positioned (translated), rotated and scaled in the space of the scene. After putting the model in the group, and adding the group to the scene, the group is made to rotate continuously

The template contains empty methods to handle mouse and keyboard input from the user, and to perform tasks between render cycles. The use of these important methods becomes clear in a wonderful tutorial in which you build a simple game.

To Continue to Part 3, or Return to Part 1, Use Arrow Buttons

Comments are welcome
and brought to you by webreference.com

Created: May 8, 2001
Revised: May 8, 2001

URL: http://webreference.com/3d/lesson118/2.html