Presentation is loading. Please wait.

Presentation is loading. Please wait.

UFCEKU-20-3Web Games Programming Overview of the Shockwave 3D API used in the Game Scenario.

Similar presentations


Presentation on theme: "UFCEKU-20-3Web Games Programming Overview of the Shockwave 3D API used in the Game Scenario."— Presentation transcript:

1 UFCEKU-20-3Web Games Programming Overview of the Shockwave 3D API used in the Game Scenario

2 UFCEKU-20-3Web Games Programming Agenda Review functional aspects of the 3D drive-around scenario Identify the Application Programmers Interface (API) Important API calls used in the scenario Consider implementing further game elements and functionality within the scenario

3 UFCEKU-20-3Web Games Programming Functional Aspects Lighting - default Cameras - default camera Navigation - (keyboard control) Terrain-following Collision detection Scoring Additional features - third-person chaseCam with dynamics (lag) Score-based initialization and timings

4 UFCEKU-20-3Web Games Programming API (Application Programmer Interface) The programming interface to available functionality provided by the designers of a particular software system or framework Collections of functions/methods organised by similar purpose Examples: Java Swing, Flash networking components, Director Shockwave 3D components For any given API function / method API documentation would provided Context of use Its purpose Parameters Return type (if any) API documentation often vague and some aspects undocumented Investigate and understand purpose of API through experimentation

5 UFCEKU-20-3Web Games Programming Script:seekFloor Positions model onto the land(floor) at a given height and direction seekFloor(modelName, floorName, worldName, modelHeight, directionVector) Parameters: model being place on the floor name of the floor name of the world height of the model above the ground direction in which to look for the floor -- called in carObject and boxObject floorDetails = seekFloor("car", "land", "world", carHeight, upVector floordetails = seekFloor(gameWorld.model[i].name, "land", "world", boxheight, vector(0,-1,0))

6 UFCEKU-20-3Web Games Programming Director 3D Coordinate System z x + - + - Eye point y + -

7 UFCEKU-20-3Web Games Programming modelsUnderRay (API) seekFloor uses an important API method called modelsUnderRay(….) Usage (taken from Director API documentation) member(whichCastmember).modelsUnderRay(locationVector, directionVector, optionsList) Description 3D command; returns a list of models found under a ray drawn from a specified position and pointing in a specified direction, with both vectors being specified in world-relative coordinates. Within the returned list, the first model listed is the one closest to the position specified by locationVector and the last model listed is the furthest from that position. Only one intersection (the closest intersection) is returned per model. The command returns an empty list if there are no models found under the specified ray.

8 UFCEKU-20-3Web Games Programming land car look for a model called land floorDetails = seekFloor("car", "land", "world", carHeight, upVector) -- floorDetails stores the return values from the seekFloor method -- floorDetails[1] is the boolean flag 0 if a floor not found 1 if found -- floorDetails[2] is the tilt vector (direction) -- floorDetails[3] is the tilt angle (angle of direction)

9 UFCEKU-20-3Web Games Programming Car height variable determines height of car from land - current setting.9

10 UFCEKU-20-3Web Games Programming Car height variable determines height of car from land - current setting.9 Car Height

11 UFCEKU-20-3Web Games Programming Walk-Through setup on exitFrame me -- game startup end on prepareframe me declare objects end On exit of the frame if all the box objects have been found goto to the frame labelled gameover else stay on this frame play on exitFrame me go the frame and wait for a mouse event to continue gameover carObject cameraObject boxObject seekFloor initialize Movie Scripts Frame (Behavior) Scripts Frame Labels

12 UFCEKU-20-3Web Games Programming Chase Camera with Glide Effect Implemented in the cameraObject script

13 UFCEKU-20-3Web Games Programming Chase Camera with Glide Effect Dummy object (invisible) chaseCam.transform.interpolateto(dummyObject.getworldtransform(), lag)

14 UFCEKU-20-3Web Games Programming Chase Camera ‘eases in’ to position of dummy lag = 5 -- the higher the lag value the closer fixed is the camera (try 50) chaseCam.transform.interpolateto(dummyObject.getworldtransform(), lag) Have a look at the interpolateto method in the Shockwave3D API

15 UFCEKU-20-3Web Games Programming Further Enhancements ? Consider what other features and game elements could be included…

16 UFCEKU-20-3Web Games Programming Further Game Elements Additional lighting Ambient sound and effects Additional camera viewpoints Additional geometry Replacement geometry Texture maps for environment graphics Splash screen with associated graphics Timed challenges – search for objects to gain points Game state changes based on player location in world Enemy vehicles Physics

17 UFCEKU-20-3Web Games Programming Scripts initialize cameraObject carObject boxObject seekFloor Frame Scripts for “play” and “gameover” Scripts available outside my office (2P16)


Download ppt "UFCEKU-20-3Web Games Programming Overview of the Shockwave 3D API used in the Game Scenario."

Similar presentations


Ads by Google