Hi, I have a little problem…
I have already something set up where I read the normal of where I am with my mouse on a mesh…
But now I want to set the orientation of a plane alongside the normal, and I don’t know how to get there.
I think I need to do something with eulers and quaternions, but this is still a bit abacadabra for me.
This is my code:
private function handleMouseMove( event:MouseEvent3D ):void
{
_mouseUV = event.uv;
// Update tracers.
_locationTracer.position = event.localPosition;
_normalTracer.position = _locationTracer.position;
_iconPlane.position = _locationTracer.position;
var normal:Vector3D = event.localNormal.clone();
normal.scaleBy( 50 );
var lineSegment:LineSegment = _normalTracer.getSegment( 0 ) as LineSegment;
lineSegment.end = normal.clone();
// here I want to set the _iconPlane alongside the normal, so in a 90 degrees angle of the hovered face
}