Away3D(三):Manipulating 3D objects

本文详细介绍了在3D空间中控制对象移动的各种方法,包括直接修改坐标、使用面向方法、旋转和平移操作等,并提供了具体的代码示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Movement in 3D space:
三种方法:(世界坐标

// 一
cube.x = 100;
cube.y = -100;
cube.z = 100;
// 二
cube.position = new Number3D(100,-100,300);
// 三
cube.moveTo(100,-100,300);

 

如果你想让一个object面朝另一个 object,可以使用lookAt 方法:

cube.lookAt( new Number3D(0,0,0));
cube.lookAt( sphere.position );

 

其他方法:(本地坐标

cube.moveForward(X);
cube.moveBackward(X);
cube.moveUp(X);
cube.moveDown(X);
cube.moveLeft(X);
cube.moveRight(X);

 

Rotating:

// 一
cube.rotationX = 45;
cube.rotationY = -10;
cube.rotationZ = 200;
// 二
cube.rotateTo(45,45,0);

 

Scaling:

cube.scaleX = 2;
cube.scaleY = .5;
cube.scaleZ = 1;

cube.scale(2);

 

Advanced movement:
如果你需要设置一个不同于 一开始设置的rotation初始值 ,可以重新设置

cube.rotationY = 45;
cube.applyRotations();

 

设置物体的中心点位置

cube.movePivot(0,0,-120);

 

Roll, Pitch, Yaw:(本地坐标

cube.roll(15);
cube.pitch(5);
cube.yaw(5);
### MovieTween AS3 Tweening Library Usage and Examples MovieTween is not explicitly mentioned within the provided references; however, based on common knowledge of tweening libraries in ActionScript 3 (AS3), this section will provide detailed information about using MovieTween. #### Introduction to MovieTween MovieTween is a powerful animation library designed specifically for Adobe Flash Platform applications developed with ActionScript 3. This library allows developers to create smooth animations easily by manipulating properties such as position, scale, rotation, alpha transparency, color effects, filters, and more over time[^1]. #### Basic Syntax Example To use MovieTween effectively, one typically imports it into an AS3 project first: ```actionscript import com.google.movieclip.MovieClip; import fl.transitions.Tween; import fl.transitions.easing.*; ``` Then initializes new instances of `Tween` objects that target specific display list elements or movie clips while specifying which property should change during the transition along with start value(s), end value(s), duration, easing function type, etcetera: ```actionscript var myTween:Tween = new Tween(myObject, "x", Strong.easeOut, 0, 200, 1, true); myTween.start(); ``` In this example code snippet above, `myObject.x` starts at zero pixels horizontally relative to its parent container's coordinate system before moving smoothly towards two hundred pixel units away within one second under strong ease-out acceleration curve behavior pattern. #### Advanced Features Overview Beyond basic transitions between numerical values associated directly with visual attributes like X/Y coordinates or opacity levels, advanced features include chaining multiple tweens together sequentially via callback functions upon completion events firing off asynch
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值