Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv504/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
PencilTool.java
Log Message:
Minor refactoring of ray-plane intersection code
Index: PencilTool.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PencilTool.java 31 Aug 2005 07:02:52 -0000 1.5
--- PencilTool.java 31 Aug 2005 08:03:32 -0000 1.6
***************
*** 98,113 ****
} else {
Plane xy = new Plane(0, 0, 1, 0);
! Vertex origin = new Vertex("origin");
! origin.setX(x);
! origin.setY(AbstractView.getHeight() - y);
! origin.setZ(0.0);
! origin = transformation.unProject(origin);
! Vertex direction = new Vertex("direction");
! direction.setX(x);
! direction.setY(AbstractView.getHeight() - y);
! direction.setZ(1.0);
! direction = transformation.unProject(direction);
! direction = direction.minus(origin);
! Vertex vertex = xy.intersection(origin, direction);
}
}
--- 98,114 ----
} else {
Plane xy = new Plane(0, 0, 1, 0);
! Vertex near = new Vertex("near");
! near.setX(x);
! near.setY(AbstractView.getHeight() - y);
! near.setZ(0.0);
! Vertex far = new Vertex("far");
! far.setX(x);
! far.setY(AbstractView.getHeight() - y);
! far.setZ(1.0);
! Edge ray = new Edge("ray");
! ray.setFrom(near);
! ray.setTo(far);
! ray = transformation.unProject(ray);
! Vertex vertex = xy.intersection(ray);
}
}
|