Although it seems the value returned to be slightly off.
Try set perpective lens to your camera...
Fabrice
On Nov 27, 2009, at 4:41 PM, quinrou . wrote:
yes indeed the port was very easy
here is the code
var ray:Number3D = camera.unproject( view.mouseX , view.mouseY );
var cameraPosition:Number3D = new Number3D( view.camera.x,
view.camera.y, view.camera.z);
ray.add(cameraPosition, ray);
var p:Plane3D = new Plane3D();
p.fromNormalAndPoint(new Number3D(0, 0, 1), new Number3D(0, 0, 0));
var intersect:Number3D =
p.getIntersectionLineNumbers(cameraPosition, ray);
as you said the code was nearly the same. Although it seems the
value returned to be slightly off.
I will have a look at the ray class - thax
On Fri, Nov 27, 2009 at 3:33 PM, Fabrice3D <[email protected]>
wrote:
you can do exact same in away using Plane3D
its in away.core.geom
but if you want precise mouse coordinates with triangle test
you'll be better off using Ray class located in materials utils
Fabrice
On Nov 27, 2009, at 4:22 PM, quinrou . wrote:
Hi,
In papervision you can define a plane3d (which is a virtual plane)
and send a ray from the mouse and work out the intersection of the
mouse ray on the plane3d which give you the sceneX , sceneY.
http://blog.zupko.info/?p=143
Can you you also do this in away3d? and how?
thanks
S
On Tue, Nov 24, 2009 at 12:18 PM, Fabrice3D <[email protected]>
wrote:
What do you mean exactly...
get 3d position of the mouse hit when a raymouse hits a face?
on mouseOver the face when camweera is not updated?
face position in space?
Fabrice
On Nov 24, 2009, at 12:38 PM, quinrou . wrote:
@juliancruz87 - I think you are missing the point here!
I am not after the mouse x and y properties on the flash movie.
I need the scene/world x and y coordinates relative to the center
of the 3d world. sceneX and sceneY provides what I need however
the only way to get these property is when the mouse is hovering a
3d object.
So my question is, is there a way to get those values regardless
of the mouse hover a 3d object. I need to get those value at all
time.
Thanks
S
On Tue, Nov 24, 2009 at 11:30 AM, juliancruz87 <[email protected]
> wrote:
var MouseLocalizationX:String;
var MouseLocalizationY:String;
function MouseUpdate(event:Event){
MouseLocaliztionX = mouseX+"";
MouseLocaliztionY = mouseY+"";
trace(MouseLocaliztionX + " " + MouseLocaliztionY);
}
addEventListener(Event.ENTER_FRAME,MouseUpdate);
hello this is a basic code but you can change the trace for anything
you want to use the mouse
On 24 nov, 05:54, "quinrou ." <[email protected]> wrote:
> HI
>
> It seems that you can only get the sceneX and sceneY properties
when the
> mouse is over a 3d object.
> Is there way to get sceneX and sceneY without having to hover a
3d object?
>
> thanks
> S