Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22145/src/net/sourceforge/bprocessor/model
Modified Files:
Camera.java
Log Message:
made changes to the way factor is evaluated and the placement of the calcs. inserted a combobox with no functionallity yet...
Index: Camera.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Camera.java 12 Jan 2007 11:48:16 -0000 1.33
--- Camera.java 12 Jan 2007 17:52:32 -0000 1.34
***************
*** 7,11 ****
package net.sourceforge.bprocessor.model;
- import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.Collection;
--- 7,10 ----
***************
*** 65,68 ****
--- 64,70 ----
private double factor;
+ /** The ralation between cm and inches */
+ private static final double RELATION = 2.54;
+
/**
* The constructor for the persistence layer
***************
*** 106,110 ****
this.setFocalwidth(c.getFocalwidth());
Iterator clips = c.getClipplanes().iterator();
! c.factor = this.factor;
while (clips.hasNext()) {
ClippingPlane clip = (ClippingPlane)clips.next();
--- 108,112 ----
this.setFocalwidth(c.getFocalwidth());
Iterator clips = c.getClipplanes().iterator();
! this.factor = c.factor;
while (clips.hasNext()) {
ClippingPlane clip = (ClippingPlane)clips.next();
***************
*** 166,173 ****
public void setType(int type) {
if (type == PERSPECTIVE) {
- calcOrthoToPersp();
this.type = type;
} else if (type == ORTHOGRAPHIC) {
- calcPerspToOrtho();
this.type = type;
} else {
--- 168,173 ----
***************
*** 175,198 ****
}
}
-
- /**
- * Change the to reality factor from the camera settings
- */
- private void calcPerspToOrtho() {
- double length = Math.sqrt((camera[0] - center[0]) * (camera[0] - center[0]) +
- (camera[1] - center[1]) * (camera[1] - center[1]) +
- (camera[2] - center[2]) * (camera[2] - center[2]));
- double width = Math.tan(Math.toRadians(focalwidth)) * length;
- factor = width * 100.0 * (96.0 / 100.0);
- log.info("The factor is:" + factor + " for width " + width);
- }
-
- /**
- * Change the camera to corrospond the reality factor
- */
- private void calcOrthoToPersp() {
- // TODO Auto-generated method stub
-
- }
/**
--- 175,178 ----
***************
*** 346,350 ****
}
} else {
! factor *= 2;
}
}
--- 326,330 ----
}
} else {
! factor /= 2;
}
}
***************
*** 359,363 ****
camera[2] += (camera[2] - center[2]) * 0.1;
} else {
! factor /= 2;
}
}
--- 339,343 ----
camera[2] += (camera[2] - center[2]) * 0.1;
} else {
! factor *= 2;
}
}
|