OT: fitting a plane model to 2d points 2003-12-04 - By pat hammond
Back thanks Danny, I've got around this problem using quads & the mapMemberToStage function which was one of those really useful commands I never knew existed but just seem to materialise to save the day. the problem still remains an interesting one and could be a good exercise in something. sorry, I didn't explain it too well before: imagine having a plane of known size, now rotate this randomly on all axis & take a photo of it. is it possible, just by having this photo (2d version) of the plane to reconstruct it in 3d, given the corner x,y co-ords, length of all sides & the field of view of the camera? just curious :) Pat
-- --Original Message-- -- From: dir3d-l-bounces@(protected) [mailto:dir3d-l-bounces@(protected)] On Behalf Of Danny Kodicek Sent: 04 December 2003 12:31 To: dir3d-l@(protected) Subject: Re: [Dir3d-l] OT: fitting a plane model to 2d points
> Hi, > I'm trying to create a simple version of the shadow garden idea > http://www.mine-control.com/ in director using the excellent > trackThemColors xtra to capture video from a webcam. To make collision
> detection easier I'm trying to align a virtual camera in director to > match the webcam's view, therefore being able to translate the > location of objects I'm interested in from the scene's main camera to > the 'virtual webcam' without relying on motion tracking. My problem is
> calibrating the virtual web camera, simply, I have 4 points (corners > of the projection screen), I need to convert this to a 3d plane > without having any z-axis information but knowing the length of the > sides. This has been bugging me for days, if anyone has ideas I'd be > really thankful,
I'm not quite sure what it is you're trying to do, sorry.
You're trying to map the image on the screen to points in 3d space, yes? So if I understand it, you're saying that there is a rectangle (aligned with the x-y plane), which fills the camera view. You know the lengths of its sides as viewed through the screen, but you want to know how far away it is. Have I got it?
This is reasonably simple. Halving the fieldofview property of the main camera gives you the angle a from the camera to the top of the rectangle you want. Then the z-distance is half the height of the rectangle divided by tan(a)
HTH Danny
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|