unsigned x, y;
unsigned i;
float aspect;
- float cyl_radius;
- float cyl_arc;
+ float curve_radius;
+ float curve_arc;
float sin_ksv;
float cos_ksv;
float distance;
if(monitor->curvature_depth)
{
- cyl_radius = (monitor->curvature_depth*monitor->curvature_depth+0.25f)/(2.0f*monitor->curvature_depth);
- cyl_arc = 2.0f*asin(0.5f/cyl_radius);
+ curve_radius = (monitor->curvature_depth*monitor->curvature_depth+0.25f)/(2.0f*monitor->curvature_depth);
+ curve_arc = 2.0f*asin(0.5f/curve_radius);
}
sin_ksv = monitor->keystone_vertical/sqrt(1.0f+monitor->keystone_vertical*monitor->keystone_vertical);
{
if(monitor->curvature_type==CYLINDRICAL)
{
- v[2] = (1.0f-cos(v[0]*cyl_arc))*cyl_radius-monitor->curvature_depth;
- v[0] = sin(v[0]*cyl_arc)*cyl_radius;
+ v[2] = (1.0f-cos(v[0]*curve_arc))*curve_radius-monitor->curvature_depth;
+ v[0] = sin(v[0]*curve_arc)*curve_radius;
}
else if(monitor->curvature_type==SPHERICAL)
{
float r;
- v[0] = tan(v[0]*cyl_arc)*cyl_radius;
- v[1] = tan(v[1]*cyl_arc)*cyl_radius;
- r = sqrt(v[0]*v[0]+v[1]*v[1]+cyl_radius*cyl_radius)/fabs(cyl_radius);
+ v[0] = tan(v[0]*curve_arc)*curve_radius;
+ v[1] = tan(v[1]*curve_arc)*curve_radius;
+ r = sqrt(v[0]*v[0]+v[1]*v[1]+curve_radius*curve_radius)/fabs(curve_radius);
v[0] /= r;
v[1] /= r;
- v[2] = cyl_radius-cyl_radius/r-monitor->curvature_depth;
+ v[2] = curve_radius-curve_radius/r-monitor->curvature_depth;
}
}
}