[Papervision3D] Yan: Normal vector / Unproject

E. Derebey e.derebey at gmail.com
Fri Aug 12 19:08:07 EDT 2011


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 at tbwachiat.com>
Kime: papervision3d at osflash.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 at gmail.com> wrote:

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.
>
>_______________________________________________
>Papervision3D mailing list
>Papervision3D at osflash.org
>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 at gmail.com


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 at tbwachiat.com and 
please delete the e-mail from your system, retaining no copies in any media. We appreciate your cooperation. 
_______________________________________________
Papervision3D mailing list
Papervision3D at osflash.org
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20110812/5906da41/attachment.html>


More information about the Papervision3D mailing list