4

I am trying to understand the co-ordinate spaces of three.js, I understand that there is object.matrix and object.matrixWorld.

After stumbling upon this blog post Matrix Basics. How to step away from storing an orientation as ’3 angles’</a>, I decided to try to learn how to manipulate properties of the Matrix4 manually thus avoiding using Euler rotations.

All I am trying to do is translate my cube away from the origin 0,0,0 then rotate it in world space. The result in my mind would be that the cube translates on y axis first, then the rotate would bring it in a large arc back to the plane, but what actually happens is it just goes back to the origin ignoring the translation.

I have been doing a lot of reading about vectors and matrices and I'm confident I understand the theory behind them enough now. What I don't really get is how three.js handles the matrixWorld and matrix. I've attempted both!

Here is a fiddle to demonstrate: http://jsfiddle.net/SCXNQ/151/

Just look in the render() function to see what I'm trying to do!

EDIT - [solved] UPDATED JS FIDDLE OF WORKING VERSION 14/09/12

With the help of the answer below, I thought I would post my updated fiddle demonstrating what I wanted to achieve - http://jsfiddle.net/SCXNQ/363/

4

1 回答 1

2

看看这个,这就是我认为你想要的。

编辑:哎呀,矩阵顺序错了(你需要牢牢掌握的另一件事)->也试试这个

于 2012-06-20T11:27:49.123 回答