Steps needed to make 3D pyramid in AS3 code

Asked By 60 points N/A Posted on -

I want create 3 D pyramid (ex. planets in space simulators) using AS 3 code so I could have the flexibility to scale up or down the complexity of the model on a whim. So what are the steps needed to make 3 D pyramid in AS 3 code?

Answered By 0 points N/A #191270

Steps needed to make 3D pyramid in AS3 code


To make a pyramid in as3 code, follow the steps:

1. Import flash display Shape
2. Find Shape. Select new shape addChild
3. Select drawChart to (300, 300, 200, 350, 40);
4. Input Height, input Base, input baseCenter, and baseCenterY to your desired number, change closure to void. to clear, make lineStyle (1, 0x444444) in the box.
5. Do the following inputs one after another-

A. Make BeginFill to (0xD7FFD4); move To(baseCenterX-theBase/2, baseCenterY);
B. lineTo(baseCenterX, baseCenterY +closure);
C. lineTo(baseCenterX, baseCenterY – theHeight); lineTo(baseCenterX-theBase/2, baseCenterY);
D. beginFill(0xB1EEAC); moveTo(baseCenterX+theBase/2, baseCenterY);
E. lineTo(baseCenterX, baseCenterY +closure); lineTo(baseCenterX, baseCenterY – theHeight);
F. lineTo(baseCenterX+theBase/2, baseCenterY);
G.; }

6. Now, our drawChart has 5 parameters – height of our pyramid, base of our pyramid, the coordinates for the center of the base, and a closure value.

***The values can be changed to whatever you like, the pyramid will be drawn automatically according to your values.

Hope these shall help you.


Login/Register to Answer

Related Questions