OT: fitting a plane model to 2d points 2003-12-04 - By Danny Kodicek
Back
> 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
|
|