Normal vector / Unproject

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Normal vector / Unproject

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 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.
Reply | Threaded
Open this post in threaded view
|

Re: Normal vector / Unproject

Patrick Matte-2
http://blog.zupko.info/?p=143

On Thu, Aug 11, 2011 at 11:41 AM, e.derebey <[hidden email]> 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
[hidden email]
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 | [hidden email]


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 [hidden email] and 
please delete the e-mail from your system, retaining no copies in any media. We appreciate your cooperation.


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Reply | Threaded
Open this post in threaded view
|

Yan: Normal vector / Unproject

e.derebey
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 <[hidden email]>
Kime: [hidden email]
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 <[hidden email]> 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
[hidden email]
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 | [hidden email]


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 [hidden email] and 
please delete the e-mail from your system, retaining no copies in any media. We appreciate your cooperation.


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org



_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org