4 #ifndef tools_sg_set_plotter_camera
5 #define tools_sg_set_plotter_camera
14 plotter& a_plotter,
ortho& a_camera,
unsigned int a_ww,
unsigned int a_wh) {
15 if(!a_ww || !a_wh)
return;
21 enum plotter_viewport_mapping {
26 plotter_viewport_mapping pvp = pvp_adjust_viewport;
32 float aspect = float(a_ww)/float(a_wh);
37 (pvp==pvp_adjust_viewport)) {
50 {
float camera_znear = 0;
51 float camera_zfar = 0;
52 float camera_z_pos = 0;
54 float camera_height = 0;
60 camera_znear = 0.01F*z;
66 if(pvp==pvp_leave_alone) {
72 float plotterAspect = XSIZ/YSIZ;
73 if(aspect<plotterAspect) {
74 camera_height = XSIZ / aspect;
78 }
else if(pvp==pvp_adjust_viewport) {
93 float xfac = 1.0F/20.0F;
94 float yfac = 1.0F/20.0F;
95 float XSIZ = 20 * xfac;
96 float YSIZ = 20 * yfac;
97 float zfac = 1.0F/20.0F;
98 float ZSIZ = 20 * zfac;