1 / 16

Web Games Programming

Web Games Programming. Shockwave 3D Environment and Lingo Scripting Basics. Agenda. Shockwave 3D Coordinate System Basics of Shockwave Cameras and Lights Lingo Scripting Review Getting Started Tutorial Overview of 3D World Tutorial Activites. Director 3D Coordinate System. +. y. -. -.

abby
Download Presentation

Web Games Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Games Programming Shockwave 3D Environment and Lingo Scripting Basics

  2. Agenda • Shockwave 3D Coordinate System • Basics of Shockwave Cameras and Lights • Lingo Scripting • Review Getting Started Tutorial • Overview of 3D World Tutorial Activites

  3. Director 3D Coordinate System + y - - - z x + Eye point +

  4. Shockwave Cameras • Always in focus • No given depth of field • No aberrations e.g lens flare • Could create some of effects when required but resource intensive

  5. 3D Viewing Frustrum

  6. Clipping Planes

  7. Camera Attributes • transform (rotate and translate) • projection (orthographic or perspective) • fieldofview ( a value > 0 and < 180) • orthoheight ( value > 0) • hither (near clipping plane) • yon (far clipping plane) • background colour (rgb value)

  8. Camera Attributes • Default camera is referenced as camera 1 • Scene.camera[1].translate(0,70,0) (move in y plane) • Scene.camera[1].rotate(-15,0,0) (rotate about x axis) • Scene.camera[1].fieldofview = 22 (set lens angle) • New cameras can be named on creation: • --create new camera called closeup • scene.newcamera(“closeup”) • --position camera • scene.camera(“closeup”).translate(100,200,75) • --rotate camera • scene.camera(“closeup”).rotate(-10,0,0) • --set field of view • scene.camera(“closeup”).fieldofview = 11

  9. Creating Lights • Light Types - Point, Directional, Spot, • General syntax • member(“castmember”).newLight(“name”,#type) • Example • member(”spotlightOne”).newLight(“spotOne”, #spotlight)

  10. Light Node Attributes Property Light Type Value Format Color All rgb(R,G,B) Rotation #directional, #spot vector(x,y,z) Position #point, #spot vector(x,y,z) Specular #directional, #point, #spot true or false Spotangle #spot 0-90 Spotdecay #spot true or false Attentuation #point, #spot vector(C,L,Q) constant, linear, quadratic - default is (1,0,0)

  11. Spot Light Attributes • Intensity - how much light emitted from the source light • Decay - how much light diminishes away from the source light (fall -off) • Cone Angle - width of the lights cone of influence - area outside cone not illuminated • Penumbra Angle - fall off at edge of cone angle - more gives a softer edge to the light cone • Drop-off - how much the light diminishes at the outer edges • Colour - set an RGB colour for the light - affects colour of scene

  12. Lingo The Lingo scripting language features the usual facilities for declaring Variables of a given type and controlling logic via loops and branches. Syntax (structure) , Keywords (reserved), variables, types int, float, string, if .. then, repeat while comments need to preceded by -- -- this is a comment Use the message window to evaluate Lingo code immediately via the put statement type in message window put 14 + 5 19

  13. Lingo Scripts Types • Movie scripts - global across entire movie • Behaviour (sprite) scripts - associated with an instance of a sprite or frame in the Score - active at given frame or frames to which assigned • Parent scripts are special scripts that contain Lingo that is used to create child objects. You can use parent scripts to generate script objects that behave and respond similarly yet can still operate independently of each other. • Object scripts which hold properties and methods (handlers)

  14. Lingo Handlers • Director implements the event -driven programming model • Lingo refers to what other programming environments call functions or methods ‘handlers’ • Use Lingo handlers (function, method) to ‘handle’ the event -- mouseDown event handler on mouseDown beep end

  15. Lingo compared to other OOP Languages OOP Term Lingo Equivalent Base Class Ancestor Script Class Parent Script Instance Variable Property Variable Class Instance/Object Child Object Method / Member Function Method Event Listener Handler

  16. Lingo API Lingo has an extensive API for all aspects of multimedia development. Shockwave 3D has its own additional API for development of 3D navigable interactive environments which can be deployed on the web.

More Related