botones
on (rollOver) {
NewPosY = 225;
Vertex1.GotoAndPlay(2);
}
on (rollOut) {
Vertex1.GotoAndPlay(20);
}
fotograma1
count = 0;
while (count < VerticeNum) {
count ++;
this["z" add count] = Math.cos((count*45) * (math.PI/180)) * 50;
this["y" add count] = Math.sin((count*45) * (math.PI/180)) * 50;
this["x" add count] = (count * 40) - (VerticeNum/2 * 40);
duplicateMovieClip("Vertex", "Vertex" add count, count );
}
setProperty("Vertex", _visible, 0);
setProperty("Line", _visible, 0);
CenterRotationX = 0;
CenterRotationY = 0;
TrailerX = 50;
TrailerY = 360;
fotograma2
call("Mousetracking");
call("Calc3d");
fotograma3
prevFrame();
play();
fotograma4
DifferenceX = NewPosX - TrailerX;
DifferenceY = NewPosY - TrailerY;
addX = differenceX / 10;
addY = differenceY / 5;
overshootX = overshootX + addX;
overshootY = overshootY + addY;
TrailerX = TrailerX + overshootX + addX;
TrailerY = TrailerY + overshootY + addY;
Yangle = TrailerX;
Xangle = TrailerY;
fotograma5
c = 0;
while (c < VerticeNum) {
c++;
Xang = Xangle * (math.PI/180);
Yang = Yangle * (math.PI/180);
//-----------------------------------------
//--- y rotate ---
//-----------------------------------------
this["zpos" + c] = this["z" + c] * math.cos(Yang) - this["x" + c] * math.sin(Yang);
this["xpos" + c] = this["z" + c] * math.sin(Yang) + this["x" + c] * math.cos(Yang);
//-----------------------------------------
//--- x rotate ---
//-----------------------------------------
this["ypos" + c] = this["y" + c] * math.cos(Xang) - this["zpos" + c] * math.sin(Xang);
this["zpos" + c] = this["y" + c] * math.sin(Xang) + this["zpos" + c] * math.cos(Xang);
//-----------------------------------------
//-- 3d to 2d --
//-----------------------------------------
this["Depth" + c] = (1 / ((this["zpos" + c]/perspective) + 1));
//-----------------------------------------
//--- draw