ActionScript 3 Flash画廊效果中的AS3 3D旋转螺旋

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 Flash画廊效果中的AS3 3D旋转螺旋相关的知识,希望对你有一定的参考价值。

import com.greensock.*;
import com.greensock.easing.*;


var galItems = new Array();
for(var i=0; i<40; i++){
	var rad = (i * 12) + 60 ;
	galItems[i]=new Box();
	galItems[i].x = Math.sin(rad) * rad;
	galItems[i].y = Math.cos(rad) * rad;
	galItems[i].z = (i - 20) * 40;
	galItems[i].rotationY = 90;
	trace(rad);
	
	///////// This was tricky! Thanks to http://www.foundation-flash.com/tutorials/as3rotation/
	galItems[i].selfRotX = (rad /(Math.PI /180)) + 90 ;
	/////////
	
	galItems[i].rotationX = galItems[i].selfRotX ;
	gallery.helix.addChild(galItems[i]);
	gallery.z = 800;
}

addEventListener(Event.ENTER_FRAME,loop);

function loop(e){

	var distx:Number = mouseX / 650;
	var disty:Number = mouseY / 450;
	TweenLite.to(gallery, 2, {
						rotationY: 90 + ((-70 + (140*distx))*0.6),
						rotationX:(70 - (140*disty))*0.6,
						ease:Expo.easeOut
				 });
	TweenLite.to(gallery.helix, 2, {rotation: (mouseX - (stage.stageWidth/2)) * 1.6});
/*
	for (var i =0; i< galItems.length; i++){
		TweenLite.to(galItems[i], 2, {rotationX: (galItems[i].selfRotX + mouseX - (stage.stageWidth/2 )) -90 });
		
	} */
	
}

以上是关于ActionScript 3 Flash画廊效果中的AS3 3D旋转螺旋的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 Actionscript 3 / Flash中的半色调效果

ActionScript 3 使用Flash / Actionscript 3进行3D翻转效果

带Flash/Actionscript 3的3D翻转效果

actionscript3/Flash中的半色调效果

Flash ActionScript 3.0 调整事件文本大小

ActionScript 3 flash中FLV视频的actionscript cuepoint监听器