So just so I'm understanding, you are saying that in you _onDragOver
function, the combo of fireMouseEvent() and getMouseEvent() is not
returning the correct screen coordinates?  You didn't list
getMouseEvent() in your code above so I wanted to make sure you did it
after the fireMouseEvent() call.
Have you tried implementing your drag/drop in the original manner that
I mentioned?  With the "drag" events on the UIComponents?  Check this
link for examples:

http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html

Maybe the coordinates returned by the event object in this case will
be more useful to you.  I don't have a specific reason to think this
would resolve your problem, but its something else to try before
moving on to ray casting to find your object.

On Apr 15, 5:35 am, devlander <[email protected]> wrote:
> Nope not working either. I have tried to do this:
>
> // called by flex DragDropManager when mouse moves over UIComponent
> private function _onDragOver(e:DragEvent):void {
>
>         // calls findHit() internally
>         view3D.fireMouseEvent(MouseEvent3D.MOUSE_MOVE, view3D.mouseX,
> view3D.mouseY);
>
> }
>
> The problem is that while dragging away3D seems to loose track of the
> current mouse position which gives unreliable results (I double
> checked that _onDragOver() was called correctly).
>
> So I guess the only solution is going to be to cast a ray and get the
> intersection point with my mesh at drop time.
>
> Thanks savagelook for your help.
>
> On Apr 13, 7:20 pm, savagelook <[email protected]> wrote:
>
>
>
> > Is this line giving you the correct 2d coordinates when you drop an
> > object:?
> > view3D.findHit(view3D.session , view3D.mouseX , view3D.mouseY);
>
> > Have you tried doing something like this? (untested)
>
> > private function _onDragDrop(e:DragEvent):void {
> >        view3D.findHit(view3D.session , view3D.mouseX ,
> > view3D.mouseY);
> >        view3D.fireMouseEvent(MouseEvent3D.MOUSE_UP, view3D.mouseX,
> > view3D.mouseY);
> >        var evt:MouseEvent3D =
> > view3D.getMouseEvent(MouseEvent3D.MOUSE_UP);
> >        // the rest of your code
>
> > }
>
> > On Apr 13, 12:06 pm, devlander <[email protected]> wrote:
>
> > > This is actually exactly the way I implemented my drag&drop feature
> > > (from an image list to an UIComponent parent of my View3D).
>
> > > This issue seems to be related to the way Flex handles the
> > > UIComponents events while dragging ( none of the MouseEvent and
> > > MouseEvent3D events are dispatched  - only DragEvent., DragOver).
>
> > > Unless I investigate what is going on in the flex DragManager I have
> > > to figure out what face3D is hit when dropping my image.
>
> > > My problem is that the combination of view3D.findHit() +
> > > view3D.getMouseEvent() does not give the right result ( the picked
> > > face seems to be random even when dropping at the same place).
>
> > > So do you have any clue on how virtual picking can be done in away3D ?
> > > Maybe the person who implemented the View3D class can help me on that.
>
> > > Thanks again for your precious help.
>
> > > On Apr 13, 3:11 pm, savagelook <[email protected]> wrote:
>
> > > > You mentioned that Flex blocks other mouse events while dragging and
> > > > dropping.  I can't confirm whether or not that is true, but I have an
> > > > idea of what you can try.  Are you implementing the drag and drop
> > > > using the "drag" properties?  Like dragEnabled, dropEnabled, dragOver,
> > > > etc...?  If you are, perhaps these convenience versions of drag and
> > > > drop do not fit your needs.  You may need to implement drag and drop
> > > > yourself so that you can have full access to the "mouse up" and "mouse
> > > > down" events during the process.  Here's a link detailing how to roll
> > > > your own drag and drop in Flex, which will in turn let you have more
> > > > control over the mouse events and likely let you get the scene
> > > > coordinates you are looking for:
>
> > > >http://www.switchonthecode.com/tutorials/simple-flex-drag-and-drop
>
> > > > On Apr 12, 6:59 pm, devlander <[email protected]> wrote:
>
> > > > > Hello,
>
> > > > > I am having an issue when using the flex drag/drop  feature to drop an
> > > > > image on a mesh (3DS model).
>
> > > > > The problem is that while dragging all the mouse events seem to be
> > > > > disabled ( the flex UIComponents below mouse do not throw a MouseOver
> > > > > event  / same for MouseEvent3D)
>
> > > > > So I have tried to retrieve the 3D picking point at drop time on my
> > > > > mesh:
> > > > > (note: I had to modify the View3D class to force _mouseIsOverView
> > > > > param to true when DragEnter inside my view3D UIContainer )
>
> > > > > private function _onDragDrop(e:DragEvent):void {
>
> > > > >        view3D.findHit(view3D.session , view3D.mouseX , view3D.mouseY);
> > > > >        var evt:MouseEvent3D =
> > > > > view3D.getMouseEvent(MouseEvent3D.MOUSE_UP);
>
> > > > >        ...... create 3D image at picking point here (evt.sceneX ,
> > > > > evt.sceneY , evt.sceneZ)
>
> > > > > }
>
> > > > > Unfortunately the picking points I am getting are totally wrong and do
> > > > > not return the Face that was picked.
>
> > > > > So is there a specific way to perform a "virtual" picking over a
> > > > > specific mesh ?
>
> > > > > Thanks a lot for any help.


-- 
To unsubscribe, reply using "remove me" as the subject.

Reply via email to