Monday, July 18, 2005

Forming 4 corners

First arbitrarily take the edge length of the plane to be 100 world space units.

The plane lies at a distance of 1 unit from the camera position , along the positive z-direction of the camera coordinate system.

The four corners will be :

ll.x=view_origin.x + itself->view->c_sys.z_axis.x - 50.0*itself->view->c_sys.x_axis.x - 50.0*itself->view->c_sys.y_axis.x;
ll.y= view_origin.y + itself->view->c_sys.z_axis.y - 50.0*itself->view->c_sys.x_axis.y - 50.0*itself->view->c_sys.y_axis.y;
ll.z=view_origin.z + itself->view->c_sys.z_axis.z - 50.0*itself->view->c_sys.x_axis.z - 50.0*itself->view->c_sys.y_axis.z;

ul.x=view_origin.x + itself->view->c_sys.z_axis.x - 50.0*itself->view->c_sys.x_axis.x + 50.0*itself->view->c_sys.y_axis.x;
ul.y=view_origin.y + itself->view->c_sys.z_axis.y - 50.0*itself->view->c_sys.x_axis.y + 50.0*itself->view->c_sys.y_axis.y;
ul.z=view_origin.z + itself->view->c_sys.z_axis.z - 50.0*itself->view->c_sys.x_axis.z + 50.0*itself->view->c_sys.y_axis.z;

ur.x=view_origin.x + itself->view->c_sys.z_axis.x + 50.0*itself->view->c_sys.x_axis.x + 50.0*itself->view->c_sys.y_axis.x;
ur.y=view_origin.y + itself->view->c_sys.z_axis.y + 50.0*itself->view->c_sys.x_axis.y - 50.0*itself->view->c_sys.y_axis.y;
ur.z=view_origin.z + itself->view->c_sys.z_axis.z + 50.0*itself->view->c_sys.x_axis.z + 50.0*itself->view->c_sys.y_axis.z;

lr.x=view_origin.x + itself->view->c_sys.z_axis.x + 50.0*itself->view->c_sys.x_axis.x - 50.0*itself->view->c_sys.y_axis.x;
lr.y=view_origin.y + itself->view->c_sys.z_axis.y + 50.0*itself->view->c_sys.x_axis.y - 50.0*itself->view->c_sys.y_axis.y;
lr.z=view_origin.z + itself->view->c_sys.z_axis.z + 50.0*itself->view->c_sys.x_axis.z - 50.0*itself->view->c_sys.y_axis.z;

0 Comments:

Post a Comment

<< Home