الزعيم ₪ ادآرة المنتدى ₪
رقم العضوية : 1 عدد المشاركات : 1132 العمر : 29 الهواية : المهنة : المزاج : جنسيتي : برنامج التصميم : نقاط الخبرة : 17731 احترام قوانين المنتدى :
| موضوع: أكشن ] إنشاء الأشكال الثلاثية الأبعاد الثلاثاء فبراير 16, 2010 5:10 am | |
| السلام عليكم ورحمة الله وبركاته ... أكشن خفيف وجميل للأشكال الثلاثية الأبعاد ... :) :) :) أولاً أضف سبيريت جديد وسمه torus ثم أضف الأكشن الموجود ثم اضغط على Ctrl T لتجربة عملك ... تحياتي الزعيم:farao: :farao: :farao: الاكشن - الكود:
-
onLoad () { distance=1000; sinx = math.sindeg(2); siny = math.sindeg(3); cosx = math.cosdeg(2); cosy = math.cosdeg(3); sphere=[[0.9662,-96.6184,0.9662], [0.9662,-48.3092,84.6402], [-71.4976,-48.3092,42.8032], [-71.4976,-48.3092,-40.8708], [0.9662,-48.3092,-82.7078], [73.43,-48.3092,-40.8708], [73.43,-48.3092,42.8032], [0.9662,48.3092,84.6402], [-71.4976,48.3092,42.8032], [-71.4976,48.3092,-40.8708], [0.9662,48.3092,-82.7078], [73.43,48.3092,-40.8708], [73.43,48.3092,42.8032], [0.9662,96.6184,0.9662]]; faces=[ [0,1,2,153], [0,2,3,136], [0,3,4,153], [0,4,5,136], [0,5,6,153], [0,6,1,136], [1,7,8,187], [1,8,2,170], [2,8,9,187], [2,9,3,170], [3,9,10,187], [3,10,4,170], [4,10,11,187], [4,11,5,170], [5,11,12,187], [5,12,6,170], [6,12,7,187], [6,7,1,170], [13,8,7,153], [13,9,8,136], [13,10,9,153], [13,11,10,136], [13,12,11,153], [13,7,12,136]]; } function convert(number_) { hex = toString(number_,16); if (number_>15) { return ("0x"+hex+hex+hex); } else { return ("0x0"+hex+"0"+hex+"0"+hex); } } onEnterFrame() { for (d=0; d<sphere.length; ++d) { tmpzpos = sphere[d][2] * cosy - sphere[d][0] * siny; sphere[d][0] = sphere[d][2] * siny + sphere[d][0] * cosy; sphere[d][2] = sphere[d][1] * sinx + tmpzpos * cosx; sphere[d][1] = sphere[d][1] * cosx - tmpzpos * sinx; } _root.torus.clear(); for (sa=0; sa<_root.torus.faces.length; ++sa) { p1x=(_root.torus.distance/(_root.torus.sphere[_root.torus.faces[sa][0]][2]+_root.torus.distance))*_root.torus.sphere[_root.torus.faces[sa][0]][0]+_root.screenx; p1y=(_root.torus.distance/(_root.torus.sphere[_root.torus.faces[sa][0]][2]+_root.torus.distance))*_root.torus.sphere[_root.torus.faces[sa][0]][1]+_root.screeny; p2x=(_root.torus.distance/(_root.torus.sphere[_root.torus.faces[sa][1]][2]+_root.torus.distance))*_root.torus.sphere[_root.torus.faces[sa][1]][0]+_root.screenx; p2y=(_root.torus.distance/(_root.torus.sphere[_root.torus.faces[sa][1]][2]+_root.torus.distance))*_root.torus.sphere[_root.torus.faces[sa][1]][1]+_root.screeny; p3x=(_root.torus.distance/(_root.torus.sphere[_root.torus.faces[sa][2]][2]+_root.torus.distance))*_root.torus.sphere[_root.torus.faces[sa][2]][0]+_root.screenx; p3y=(_root.torus.distance/(_root.torus.sphere[_root.torus.faces[sa][2]][2]+_root.torus.distance))*_root.torus.sphere[_root.torus.faces[sa][2]][1]+_root.screeny; varz=(p2x-p1x)*(p3y-p1y)-(p2y-p1y)*(p3x-p1x); if (varz<0) { _root.createemptymovieclip ("sphere", 4); tellTarget (_root.torus) { beginFill ((_root.torus.faces[sa][3])-math.abs(90+(int(_root.torus.varz/100))), 100); moveTo (_root.torus.p1x,_root.torus.p1y); lineTo (_root.torus.p2x,_root.torus.p2y); lineTo (_root.torus.p3x,_root.torus.p3y); endFill(); } } } }
| |
|