Understanding Flash3D Flash programmers have always enjoyed a freedom of expression unparalleled by other programming platforms. And with
12Part 1: Getting Startedimport flash.display.Sprite;//imports sprite classvar zposition:Number = 0;//z positionvar myAngle:Number =0;//Angle of ballv
Chapter 1: Understanding Flash3D13 The stage class is very useful in positioning your Flash objects and will be addressed in more detail in the next c
14Part 1: Getting Started In CS4 the perspective scaling and rotation are automatically built into Flash. It ’ s still important to know the concepts
Chapter 1: Understanding Flash3D15 Using the Big 3 Fundamental to 3D graphics and physics are three fundamental motions: translation, rotation and s
16Part 1: Getting Started The parametric equations for a torus are: x=(c+a*cos(v))cos(u) y=(c+a*cos(v))sin(u) z=a
Chapter 1: Understanding Flash3D17 Creating a Parametric Particle System (Torus Worm) In the previous section, you learned how to get a single eleme
18Part 1: Getting Startedparticles_ary[i].alpha method to change the alpha of each particle based on their ith position. Center the particle system on
Chapter 1: Understanding Flash3D19var myAngle:Number =0;//Angle of ball //Add Multiple Particles function updateStage():void {
20Part 1: Getting StartedFlint - Particle - System (at http://flintparticles.org/), a robust open source project found on Google Code, which can be us
Chapter 1: Understanding Flash3D21 But in CS4 there ’ s a problem with this. When using the sorting algorithm (above) you sort the elements on the z -
4Part 1: Getting Started But before you get started it ’ s important that you understand the coordinate system you ’ ll be rendering your objects in
22Part 1: Getting Started 3D Rotation To rotate x, y, z points in 3D space you use the following equations: xnew = xold*cos(angleZ) - yold*sin(
Chapter 1: Understanding Flash3D23 The conversion between radians and degrees and vice - versa is given below: Radians = Degrees*PI/180Degrees = Radia
24Part 1: Getting Started Finally the display container is rotated based on mouse movement using a simple mouseX displacement algorithm. function
Chapter 1: Understanding Flash3D25plane.rotationY = -360 / numOfParticles * i + 90;plane.alpha=1;particles_ary.push(plane); numVar++;//Sta
26Part 1: Getting Started You must orient the planes to the correct angles so that they uniformly hug the sphere as shown in Figure 1.11. plan
Chapter 1: Understanding Flash3D27 //The vertical angle between circles.var phiStep:Number=30;var phiTilt:Vector. < Number > =new Ve
28Part 1: Getting Started myDisplayObject.addChildAt(particles_ary[k] as Sprite, k); }} function particleZSort(particle1:Display
Chapter 1: Understanding Flash3D29 Weight is the concept most forgotten in animation. Animation software doesn ’ t know how much something weighs.
30Part 1: Getting Started3.0. The ActionScript is then copied to your clipboard and you can paste this code wherever you want. If you try this with th
Chapter 1: Understanding Flash3D31 Here ’ s how the code is put together: The code starts by bringing in a number of imports that set up the animati
Chapter 1: Understanding Flash3D5 In addition, in Flash 9 the coordinate origin (0,0) is not located at the center of the screen, but at the upper lef
32Part 1: Getting Started So what ’ s a Collada File? Essentially, it ’ s an XML document that holds the parameters of your 3D model. It ’ s design
6Part 1: Getting Started Creating the illusion of depth (or 3D) using perspective scaling is sometimes referred to as 2.5D. Another term used to desc
Chapter 1: Understanding Flash3D7 From the law of similar triangles, it follows that hflHfl z By cross - multiplying, you get the scaling equa
8Part 1: Getting Started The curve above is very similar to the gravitational or electrical potential curves found in physics. And it further suggests
Chapter 1: Understanding Flash3D9 In Chapter 2, you ’ ll find out how to obtain the Papervision3D classes and how to drill down and examine its code.
10Part 1: Getting Started The typical flow of such a program involves first initializing the program and then using a listener to loop through a scrip
Chapter 1: Understanding Flash3D11 Call the method addEventListener to listen for an event Name the event you want to listen for Name the funct
Comments to this Manuals