Hi David
I tried using the info of the Mouse#devent, but doest work,Im tryn to
do this I have my 3ds exported is animal shape , basically I want to
do make click on the body and add a primitive exactly where I clicked
over the model, I tried using sceneX and scenY but witout success.
if found this old code that try to do this:
It depends on Away3D's MouseEvent3D which gives you u,v
> coordinates of the mouse click. This code then calculates the x,y,z
> of the mouse pointer in object space as a linear combination of the
> vertices of the face you clicked on.
>
> public function onGlobeMouseDown(e:MouseEvent3D):void
> {
> var f:Face3D = (e.drawpri as DrawTriangle).face;
> if(f==null) return;
>
> var fv0:Number3D = f.v0;
> var fv1:Number3D = f.v1;
> var fv2:Number3D = f.v2;
> var m:Matrix3D = new Matrix3D();
> m.n11 = f.uv0.u;
> m.n12 = f.uv1.u;
> m.n13 = f.uv2.u;
> m.n21 = f.uv0.v;
> m.n22 = f.uv1.v;
> m.n23 = f.uv2.v;
> m.n31 = 1;
> m.n32 = 1;
> m.n33 = 1;
> var a:Number3D = new Number3D(e.uv.u, e.uv.v, 1).rotate
> (Matrix3D.inverse(m));
> var b:Number = a.x + a.y + a.z;
>
> // Calculate approximate object coordinates of mouse.
> var obj:Number3D = new Number3D();
> obj.x = (a.x*fv0.x + a.y*fv1.x + a.z*fv2.x)/b;
> obj.y = (a.x*fv0.y + a.y*fv1.y + a.z*fv2.y)/b;
> obj.z = (a.x*fv0.z + a.y*fv1.z + a.z*fv2.z)/b;
> ...
> }
I tried to translate to new version of Away but still is not working.