share Happy Valentine mari forked:10favorite:24lines : 48license : All rights reserved modified : 2009-02-14 22:03:38 package { import flash.display.Shape; import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; [SWF(width="400", height="400", backgroundColor="0xFFFFFF", frameRate="30")] public class StValentine extends Sprite { private const SCALE:int = 40; private var container:Sprite; private var tf:TextField; public function StValentine() { container = new Sprite(); container.x = stage.stageWidth/2; container.y = stage.stageHeight/2; addChild(container); tf = new TextField(); tf.x -= 60; tf.y += 10; tf.text = "Happy Valentine"; tf.autoSize = "left"; tf.setTextFormat(new TextFormat("Helvetica", 16, 0xff00ff)); container.addChild(tf); var sp:Shape; var r:Number = 0.0, theta:Number = 0.0, z:Number = 0.0; for(var i:int=-Math.PI*8; i<=Math.PI*8; i++) { for(var j:int=-8; j<=8; j++) { theta = i/8; z = j/8; r = 4*Math.sqrt(1 - z*z)*Math.pow(Math.sin(Math.abs(theta)), Math.abs(theta)); sp = new Shape(); sp.graphics.beginFill(0xff007f, 0.5); sp.graphics.drawCircle(0, 0, 4); sp.graphics.endFill(); sp.x= SCALE*r*Math.sin(theta); sp.y= SCALE*r*Math.cos(theta); sp.z= SCALE*z; container.addChild(sp); } } addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(e:Event):void { container.rotationY++; container.rotationX++; } } } Code Fullscreen Preview Fullscreen 3d algorithm happy love valentine FlashFit TUNCAYS siouxcitizen.. minon nyamogera paq tkinjo alumican_net.. web_shiino s26 wanson clockmaker naoto5959 MoMNi uly zahir asnike: happylovevalentinegood!!!!!!! bkzen: 短い! k0rin: コード短い berian: algorithmハートの模様 ish_xxxx: 3d naoaniki: cute ton: 短い・・・! mash: 3dコードの短さに感動した Math.abs rotationX rotationY Math.pow addChild Math.sqrt addEventListener Math.PI Math.cos text TextFormat Math.sin Event.ENTER_FRAME Event Sprite int Number sort new page view favorite forked pv66 forked from: Happy Valentine karacas forked:0 fav:0 lines:48 tag: pv0 forked from: Happy Valentine karacas forked:0 fav:0 lines:48 tag: pv132 forked from: Happy Valentine yo0_0oy forked:0 fav:0 lines:45 tag: pv147 forked from: Happy Valentine hacker_crgfx2ih forked:1 fav:0 lines:48 tag: pv131 forked from: Happy Valentine pasodania forked:0 fav:0 lines:46 tag: 1 2NEXT