If I had a box and I clicked on this box. How would I know where I
clicked on this box?

If I had a sphere (earth) and I clicked anywhere on earth. How would I
know exactly where I clicked on earth?

Basically I'm looking to figure out how to do a Local3D to Global3D
based on the MouseEvent3D.

On Oct 26, 10:01 am, katopz <[email protected]> wrote:
> i think you need no luck for programming :)
> btw i didn't follow much what you trying to do, and i got no more free time
> for that
> so, be patient for a while, i've project to handle til next year ;/
>
> sry!
>
> 2009/10/26 mogg <[email protected]>
>
>
>
>
>
>
>
> > I have tried a few other variances to this but still no luck. Any
> > recomendations.
>
> > On Oct 25, 9:11 pm, mogg <[email protected]> wrote:
> > > Here is close as I have gotten:
>
> > > Setup:
>
> > > View.scene contains one child "ObjectContainer3D".
>
> > > The one ObjectContainer3D has one child "Object3D".
>
> > > I have attached the mouse event to the nested "Object3D".
>
> > > I am trying to dynamically create a sphere and put in in the
> > > View.scene.addChild(sphere). and then move it to the location of where
> > > I click the mouse on the Object3D nested inside the ObjectContainer3D.
>
> > > I did the following conversion from Away3D 3.0.0 to Away3Dlite and it
> > > does not work as expected.
>
> > > //translate
> > > var m:Matrix3D = o3d.transform.matrix3D.clone(); // inner object
> > > (Object3D)
> > > var m2:Matrix3D = objcont.transform.matrix3D.clone(); // outer object
> > > (ObjectContainer3D)
> > > m.append(m2);
> > > m.invert();
> > > var v2:Vector3D = m.transformVector(event.scenePosition);
>
> > > sphr.x = v2.x;
> > > sphr.y = v2.y;
> > > sphr.z = v2.z;
>
> > > Any help would be much appreciated.
>
> > > On Oct 25, 8:41 pm, mogg <[email protected]> wrote:
>
> > > > katopz,
>
> > > > I checked that example out earlier as well and that did not provide a
> > > > solution.
>
> > > > I'm going to take another stab at converting this logic to Away3Dlite
> > > > and get back to you:
>
> > > > var v:Vertex = new Vertex(event.sceneX,event.sceneY, event.sceneZ);
> > > > var m:MatrixAway3D = new MatrixAway3D();
> > > > var m2:MatrixAway3D = new MatrixAway3D();
> > > > var m3:MatrixAway3D = new MatrixAway3D();
> > > > m.clone(this._innerContainer.transform);
> > > > m2.clone(this._outerContainer.transform);
> > > > m3.multiply(m2,m);
> > > > m.inverse(m3);
> > > > v.transform(m);
>
> > > > Thank you again for your help. Great work on the Away3Dlite library!
>
> > > > On Oct 25, 8:36 pm, katopz <[email protected]> wrote:
>
> > > > > well try this instead for point
>
> >http://away3d.googlecode.com/svn/trunk/fp10/Examples/Away3DLite/as/sr...
>
> > > > > as remember is mouse move+pointer on plane there
>
> > > > > hth
>
> > > > > 2009/10/26 mogg <[email protected]>
>
> > > > > > katopz,
>
> > > > > > Thank you for the suggestion but that sample file does not provide
> > any
> > > > > > examples to support this. I had looked at that example before but
> > it
> > > > > > did not demonstrate translating the click point on an Object3D that
> > is
> > > > > > inside a Object3DContainer that is then inside the View3D.
>
> > > > > > I'm looking to figure out how to translate the nested 3D point from
> > > > > > where the user clicked on the object to the View coordinates so I
> > can
> > > > > > target that very point and not the object center.
>
> > > > > > Here is what I would do in Away3D 3.0.0 (not pretty but worked).
>
> > > > > > var v:Vertex = new Vertex(event.sceneX,event.sceneY, event.sceneZ);
> > > > > > var m:MatrixAway3D = new MatrixAway3D();
> > > > > > var m2:MatrixAway3D = new MatrixAway3D();
> > > > > > var m3:MatrixAway3D = new MatrixAway3D();
> > > > > > m.clone(this._innerContainer.transform);
> > > > > > m2.clone(this._outerContainer.transform);
> > > > > > m3.multiply(m2,m);
> > > > > > m.inverse(m3);
> > > > > > v.transform(m);
>
> > > > > > How would I go about this in Away3Dlite?
>
> > > > > > On Oct 25, 8:14 pm, katopz <[email protected]> wrote:
> > > > > > > do try
>
> >http://away3d.googlecode.com/svn/trunk/fp10/Examples/Away3DLite/as/sr...
>
> > > > > > > hth
>
> > > > > > > 2009/10/25 mogg <[email protected]>
>
> > > > > > > > I use to do a few matrix operations to get the exact mouse hit
> > > > > > > > position on a nested object. (object3d inside an
> > objectContainer3D
> > > > > > > > inside the scene).
>
> > > > > > > > I would then translate this to a world coordinate and have a
> > laser
> > > > > > > > bolt go directly to the very spot I clicked on vice just object
> > > > > > > > center. This also involved a matrix invert.
>
> > > > > > > > I have tried several things with the current Away3Dlit and I'm
> > totally
> > > > > > > > lost.
>
> > > > > > > > Any hints on how to go about this. The forums on this subject
> > for
> > > > > > > > Away3Dlite don't seem to answer this yet.
>
> > > > > > > > Again, thank you for the hard work on Away3Dlite. It is
> > amazing!
>
> > > > > > > --
> > > > > > > katopzhttp://www.sleepydesign.com-Hidequotedtext-
>
> > > > > > > - Show quoted text -
>
> > > > > --
> > > > > katopzhttp://www.sleepydesign.com-Hidequotedtext -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -
>
> --
> katopzhttp://www.sleepydesign.com- Hide quoted text -
>
> - Show quoted text -

Reply via email to