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);
分享到:
相关推荐
representation of color in Direct3D and the macros for manipulating color values are described. The relevant mathematics of vectors, geometry and matrices are reviewed and summarized. A summary of ...
- **Cross-Browser Compatibility**: jQuery abstracts away browser-specific differences, allowing developers to write code that works consistently across different browsers. - **Large Community and ...
Manipulating the Image List after Creation The List View Control Other List View Control Styles Spin Button Control Data Validation Stand-alone Spin Controls Slider Control My Mouse Has Ticks ...
Add behavior to an object that is going away, including object persistence. Chapter 14, Some Advanced Object Topics Use multiple inheritance, automatic methods, and references to filehandles. ...
Table of Contents Summary of gdb . . . . . . . . ....Free Software ....Free Software Needs Free Documentation ....Contributors to gdb....1 A Sample gdb Session ....2 Getting In and Out of gdb ....2.1 Invoking gdb ....