Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13746
Modified Files:
AbstractTool.java
Log Message:
changed way to get corner constructors
Index: AbstractTool.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** AbstractTool.java 27 Jan 2006 11:42:47 -0000 1.56
--- AbstractTool.java 30 Jan 2006 11:32:52 -0000 1.57
***************
*** 429,446 ****
protected Set makeXYZConerConstructors(Vertex v) {
if (v != null) {
Edge x = new Edge(xAxis.getFrom().add(v),
xAxis.getTo().add(v));
! x.getFrom().move(50, 0, 0);
! x.getTo().move(50, 0, 0);
x.setConstructor(true);
Edge y = new Edge(yAxis.getFrom().add(v),
yAxis.getTo().add(v));
! y.getFrom().move(0, 50, 0);
! y.getTo().move(0, 50, 0);
y.setConstructor(true);
Edge z = new Edge(zAxis.getFrom().add(v),
zAxis.getTo().add(v));
! z.getFrom().move(0, 0, 50);
! z.getTo().move(0, 0, 50);
z.setConstructor(true);
Set constructors = new HashSet();
--- 429,470 ----
protected Set makeXYZConerConstructors(Vertex v) {
if (v != null) {
+ Vertex xDir = new Vertex(1, 0, 0);
+ Vertex yDir = new Vertex(0, 1, 0);
+ Vertex zDir = new Vertex(0, 0, 1);
+ double[] center = glv.getView().getCamera().getCenter();
+ double[] camera = glv.getView().getCamera().getCamera();
+ Vertex cameraDir = new Vertex(center[0] - camera[0],
+ center[1] - camera[1],
+ center[2] - camera[2]);
+
Edge x = new Edge(xAxis.getFrom().add(v),
xAxis.getTo().add(v));
! if (cameraDir.dot(xDir) > 0) {
! x.getFrom().move(-50, 0, 0);
! x.getTo().move(-50, 0, 0);
! } else {
! x.getFrom().move(50, 0, 0);
! x.getTo().move(50, 0, 0);
! }
x.setConstructor(true);
Edge y = new Edge(yAxis.getFrom().add(v),
yAxis.getTo().add(v));
! if (cameraDir.dot(yDir) > 0) {
! y.getFrom().move(0, -50, 0);
! y.getTo().move(0, -50, 0);
! } else {
! y.getFrom().move(0, 50, 0);
! y.getTo().move(0, 50, 0);
! }
y.setConstructor(true);
Edge z = new Edge(zAxis.getFrom().add(v),
zAxis.getTo().add(v));
! if (cameraDir.dot(zDir) > 0) {
! z.getFrom().move(0, 0, -50);
! z.getTo().move(0, 0, -50);
! } else {
! z.getFrom().move(0, 0, 50);
! z.getTo().move(0, 0, 50);
! }
z.setConstructor(true);
Set constructors = new HashSet();
|