Scripting 3D in Flash
      by senocular

Wire Frame Examples Using the Drawing API
The drawing functions in Flash was only just touched upon in the first example. Its about time we started pushing what they have to offer in terms of getting a true rendered 3D shape out of all that has been learned so far in creating a 3D scene in Flash. No attached movieclips involved here.

Same as before, only now there's a wire frame cube drawn between those rotated points from the pointsArray and no balloon movieclips are involved.

[ drawn wire frame cube ]

Steps to Create Animation (partial)

  1. There's pretty much only one change in this movie from the balloon-based cube, and that's the replacement of the attached clips with the drawing methods needed to draw out the wire frame All that involves is a lengthy planned out list of moveTo and lineTo commands to correctly connect the dots in the screenPoints array in the rotateCube onEnterFrame function.

  1. As an added bonus, the make2DPoint function no longer needs the depth or scaleRatio properties making it much simpler to use (not that it was such a burden previously). Otherwise, everything else can remain the same.

 

Wire frame Tube
So far, in using the drawing API, we've only implemented straight lines. Would you ever have thought curves work in 3D too? Well, they do. We can use curves and approximate a circle for each axis and rotate those circles to give the impression of a curved tube. All that's changed is the pointsArray and the drawing methods used to draw out the shape.

[ drawn wire frame tube ]

There is still quite a bit more, so feel free to explore the next tutorial for more information involving shapes and fills. After all, who likes to look at wireframe objects?

 




SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple.
 
 
 

 

[an error occurred while processing this directive]