Discussion:
Normal vector / Unproject
e.derebey
2011-08-11 18:41:52 UTC
Permalink
Hi,
I'm trying to find the 3D position of the mouse postion. I found some info
on the net that the unproject method can give us the ray of the 2D mouse
postion. Then we can intersect this ray with the Marker's Plane, so we can
find the intersected postion that is the 3D position of the mouse postion.
But I haven't any idea how to get the plane of the marker? I did some work
like this:

var ray:Number3D = flarCamera3D.unproject(mouse.x, mouse.y);
ray = Number3D.add(ray, flarCamera3D.position);
var p : Plane3D = ??? MARKER PLANE 3D????
var intersect:Number3D =
p.getIntersectionLineNumbers(flarCamera3D.position, ray);

How can I find the marker's plane 3D matrix?
Any help appreciated.
Regards.

--
View this message in context: http://papervision3d.758870.n4.nabble.com/Normal-vector-Unproject-tp3736768p3736768.html
Sent from the Papervision3D mailing list archive at Nabble.com.
Patrick Matte
2011-08-12 17:34:26 UTC
Permalink
http://blog.zupko.info/?p=143
Post by e.derebey
Hi,
I'm trying to find the 3D position of the mouse postion. I found some info
on the net that the unproject method can give us the ray of the 2D mouse
postion. Then we can intersect this ray with the Marker's Plane, so we can
find the intersected postion that is the 3D position of the mouse postion.
But I haven't any idea how to get the plane of the marker? I did some work
var ray:Number3D = flarCamera3D.unproject(mouse.x, mouse.y);
ray = Number3D.add(ray, flarCamera3D.position);
var p : Plane3D = ??? MARKER PLANE 3D????
var intersect:Number3D =
p.getIntersectionLineNumbers(flarCamera3D.position, ray);
How can I find the marker's plane 3D matrix?
Any help appreciated.
Regards.
--
http://papervision3d.758870.n4.nabble.com/Normal-vector-Unproject-tp3736768p3736768.html
Sent from the Papervision3D mailing list archive at Nabble.com.
_______________________________________________
Papervision3D mailing list
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
--
Patrick | Flash Lead

TBWA\Chiat\Day
5353 Grosvenor Boulevard
Los Angeles, CA 90066

Office | 310-305-5078
Cell | 310-254-8106
Fax | 310-305-6078
AIM | patrickmatte-***@public.gmane.org

This e-mail is intended only for the named person or entity to which it is addressed and contains valuable
business information that is proprietary, privileged, confidential and/or otherwise protected from disclosure.

If you received this e-mail in error, any review, use, dissemination, distribution or copying of this e-mail
is strictly prohibited. Please notify us immediately of the error via e-mail to disclaimer-***@public.gmane.org and
please delete the e-mail from your system, retaining no copies in any media. We appreciate your cooperation.
E. Derebey
2011-08-12 23:08:07 UTC
Permalink
Thanks for your reply Patrick;
I've just observed the codes. I want to elaborate my question;
 
When I click to any position of the screen I take a X and Y coordinate values of mouse. But as you know it's imposible to locate a DAE model to that X, Y position. Because the coordinate systems are different. The FLARtoolkit locates the model to scene according to flarBaseNode object. This obeject locates the screen with a 3D coordinate system. After my click I get a X and Y value and can use it like that:

var MyClick3D: Number3D = flarCamera3D.unproject (clickXvalue, clickYvalue);

After this operation a ray goes from camera to that MyClick3D point. But if we don't intersect this ray with a plane it goes to infinite... Now we can define this plane. But as you know the AR scene is dynamically chanes according to camera or marker movement. So it's really unable to intersect the ray with a static plane. As I mention before, my click coordinates defines a point. If I can take the normal vector of this point I can describe a plane like this drawing and the codes below: 
 
var p: Plane3D = new Plane3D();
p.setNormalAndPoint (NORMAL VECTOR OF THE CLICK POS., MOUSE CLICK COORD.);

After that I thing it's easy to intersect the ray and the plane...

My question is: How can I find the normal vector of the mouse click position.

Thank you again,

any help appreciated;
Regards...



________________________________
Kimden: Patrick Matte <patrick.matte-***@public.gmane.org>
Kime: papervision3d-***@public.gmane.org
Gönderildiği Tarih: 12 Ağustos 2011 20:34 Cuma
Konu: Re: [Papervision3D] Normal vector / Unproject


http://blog.zupko.info/?p=143


On Thu, Aug 11, 2011 at 11:41 AM, e.derebey <e.derebey-***@public.gmane.org> wrote:

Hi,
Post by e.derebey
I'm trying to find the 3D position of the mouse postion. I found some info
on the net that the unproject method can give us the ray of the 2D mouse
postion. Then we can intersect this ray with the Marker's Plane, so we can
find the intersected postion that is the 3D position of the mouse postion.
But I haven't any idea how to get the plane of the marker? I did some work
var ray:Number3D = flarCamera3D.unproject(mouse.x, mouse.y);
ray = Number3D.add(ray,  flarCamera3D.position);
var p : Plane3D = ??? MARKER PLANE 3D????
var intersect:Number3D =
p.getIntersectionLineNumbers(flarCamera3D.position, ray);
How can I find the marker's plane 3D matrix?
Any help appreciated.
Regards.
--
View this message in context: http://papervision3d.758870.n4.nabble.com/Normal-vector-Unproject-tp3736768p3736768.html
Sent from the Papervision3D mailing list archive at Nabble.com.
_______________________________________________
Papervision3D mailing list
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
--
Patrick | Flash Lead

TBWA\Chiat\Day
5353 Grosvenor Boulevard
Los Angeles, CA 90066

Office | 310-305-5078
Cell | 310-254-8106
Fax | 310-305-6078
AIM | patrickmatte-***@public.gmane.org


This e-mail is intended only for the named person or entity to which it is addressed and contains valuable
business information that is proprietary, privileged, confidential and/or otherwise protected from disclosure. If you received this e-mail in error, any review, use, dissemination, distribution or copying of this e-mail
is strictly prohibited. Please notify us immediately of the error via e-mail to disclaimer-***@public.gmane.org and
please delete the e-mail from your system, retaining no copies in any media. We appreciate your cooperation.
Loading...