math - More complex view matrix calculation required to composite 3d models with 2d video -


<2> To help integrate some 3D models into some 2D playback, I am using some 2D / 3D tracking data (provided by)

video.

Things are working .... well ... but some 'slipping' models of the video against the background are still visible and I suspect that this XNA CreatePerspective Assistant method isn 'PfHoe Keeping in mind some additional data provided by such as the viewing horizontal / vertical field of focal length and angle of focal length.

Can anyone point me to some examples of the creation of that visual matrix, details?

This MSDN article shows you how to write a method that creates a perspective matrix which Takes horizontal and vertical FOV independently (though, in C ++)

  D3x Maxrix Projection Matrix (Constant distance near / point, // distance from near clippers / / Plane const float far_plane, // Distance to clipping // plane const float fov_horiz, // horizontal area of ​​view Vertical Area / Angle, in the radius (Float H, W, Q; W = (float) 1 / tan (fov_horiz * 0.5); // 1 / tan X) = (c) H = (float) 1 / tan (fov_vert * 0.5); // 1 / tan (x) == cot (x) cue = distant / plain / (remote - pass_plain); d Rated (0, 0) = w; write (1, 1) = h; rate (2, 2) = q; rate (3, 2); 3xx; m; rt; = -Q * close_plane; write (2, 3) = 1; return date;} / sum of projection matrix Hybrid  

Mathematics has been explained further in the above article to help you write the C # version of this method. Best wishes: -)


Comments