Danko
Danko

Reputation: 69

How to update vertices geometry of children object after rotate or move parent object

I'm confused. Made a group that includes the line. After moving or rotating the parent, the visible line changed, but the vertices remained the same.

var geometry = new THREE.Geometry();
itemLine = new THREE.Line( geometry, material );
item  = new THREE.Group();
item.attach(itemLine);

After create i saw in console:

geometry.vertices[0]
Object { x: -540, y: 50, z: 0 }

I called

item.rotation.z -= deltaAngel;

But got

geometry.vertices[0]
Object { x: -540, y: 50, z: 0 }

Upvotes: 0

Views: 188

Answers (1)

DumTux
DumTux

Reputation: 726

Vertex coordinates of itemLine are in the space of item local. Rotating item doesn't change local coordinates of its children.

Upvotes: 1

Related Questions