topical media & game development

talk show tell print

#graphic-flex-image-effects-07-Flex-PyramidMesh.ax

#graphic-flex-image-effects-07-Flex-PyramidMesh.ax [swf] [flash] flex


  package {
  
          import flash.display.DisplayObject;
          import flash.geom.Vector3D;
  
          
Class holding 3D values for pyramid model.

  
          public class @ax-graphic-flex-image-effects-07-Flex-PyramidMesh extends graphic_flex_image_effects_07_Flex_Mesh3D {
  
                  
Constructor. Calls super's contructor.
parameter: container The object in which the model will be rendered.

  
                  public function @ax-graphic-flex-image-effects-07-Flex-PyramidMesh(container:DisplayObject) {
                          super(container);
                  }
  
                  
Initializes all the values needed to render the model, including vertices, sides and uvt data.

  
                  override protected function createMesh():void {
                          _vectors = new Vector.<Vector3D>();
                          _vectors.push(new Vector3D(0, -100, 0));
                          _vectors.push(new Vector3D(130, 100, 130));
                          _vectors.push(new Vector3D(130, 100, -130));
                          _vectors.push(new Vector3D(-130, 100, -130));
                          _vectors.push(new Vector3D(-130, 100, 130));
  
                          _sides = new Vector.<int>();
                          _sides.push(0, 1, 2);
                          _sides.push(0, 2, 3);
                          _sides.push(0, 3, 4);
                          _sides.push(0, 4, 1);
  
                          _uvtData = new Vector.<Number>();
                          _uvtData.push(0.5, 0.5);
                          _uvtData.push(0, 1);
                          _uvtData.push(0, 0);
                          _uvtData.push(1, 0);
                          _uvtData.push(1, 1);
                  }
  
          }
  
  }
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.