Hi friends!
I’m trying to make the cone (and other meshes) rotate and behave like the line segment (along the normals) (please see attachment)
I’m trying with
testMesh.rotateTo(normal.clone().x, normal.clone().y, normal.clone().z);
or
testMesh.lookAt(normal.clone());
but I guess that I’m doing something wrong.
.........
private function onMeshMouseMove(event:MouseEvent3D):void
{
// Update normal tracer.
var normal:Vector3D = event.sceneNormal.clone();
normal.scaleBy(100);
pickingNormalTracer.position = event.scenePosition;
var lineSegment:LineSegment = pickingNormalTracer.getSegment( 0 ) as LineSegment;
lineSegment.end = normal.clone();
lineSegment.startColor = 0xff0000;
lineSegment.endColor = 0x00ff00;
testMesh.position = event.scenePosition;
// THE SMAR POINT xD
testMesh.rotateTo(normal.clone().x,normal.clone().y,normal.clone().z);
}
......