読者です 読者をやめる 読者になる 読者になる

Hope is a Dream. Dream is a Hope.

非公開ふぃふぃ工房ブログ

↓LINE登録はこちら↓

定期的につぶやいてます. 記事に興味を持って頂いたかたや、Line Botを使ってみたいかたは試しに登録どうぞ

友だち追加

THREE.jsにてモデル座標と、世界座標を扱いたいので調べると

数値計算

f:id:hope_is_dream:20140624073816p:plain three.js - documentation

Object3D

Base class for scene graph objects.

Constructor

Object3D()

The constructor takes no arguments.

Properties

.parent

Object's parent in the scene graph.

.children

Array with object's children.

.rotation

Object's local rotation (Euler angles), in radians.

.matrix

Local transform.

.matrixWorld

The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.

.matrixAutoUpdate

When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.

.matrixWorldNeedsUpdate

When this is set, it calculates the matrixWorld in that frame and resets this property to false.
.rotationAutoUpdate

When this is set, then the rotationMatrix gets calculated every frame.

Methods

.localToWorld( vector )

vector - A local vector.
Updates the vector from local space to world space.

.worldToLocal( vector )

vector - A world vector.
Updates the vector from world space to local space.

.add( object )

object - An object.
Adds object as child of this object.

.remove( object )

object - An object.
Removes object as child of this object.

.updateMatrix()

Updates local transform.

.updateMatrixWorld( force )

Updates global transform of the object and its children.

どうやら親子関係を作れば良い見たい。。 iPhoneから取得した角速度から、デバイスの姿勢角度を求めて、子供の座標に入れてあげればいいのか。