[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.189, 1.190
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-03-01 14:54:13
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15680/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Experimenting with move-interaction Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.189 retrieving revision 1.190 diff -C2 -d -r1.189 -r1.190 *** View.java 21 Feb 2007 14:57:24 -0000 1.189 --- View.java 1 Mar 2007 14:53:56 -0000 1.190 *************** *** 3038,3043 **** /** {@inheritDoc} */ ! public Vertex toModelCoords(double[] coords) { ! return toPlaneCoords(coords, new Plane(0, 0, 1, 0)); } --- 3038,3043 ---- /** {@inheritDoc} */ ! public Vertex toModelCoords(double x, double y) { ! return toPlaneCoords(x, y, new Plane(0, 0, 1, 0)); } *************** *** 3051,3074 **** /** {@inheritDoc} */ ! public Vertex toPlaneCoords(double[] coords, Plane plane) { ! if (coords.length == 2 && plane != null) { ! double x = coords[0]; ! double y = View.getHeight() - coords[1]; ! ! Transformation transformation = transformation(); ! ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = transformation.unProject(ray); ! Vertex vertex = plane.intersection(ray); ! ! if (vertex != null) { ! return vertex; ! } ! } else { ! log.warn("Too many arguments " + coords.length + ", " + plane.toString()); ! } ! return null; } --- 3051,3063 ---- /** {@inheritDoc} */ ! public Vertex toPlaneCoords(double x, double y, Plane plane) { ! y = View.getHeight() - y; ! Transformation transformation = transformation(); ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = transformation.unProject(ray); ! Vertex vertex = plane.intersection(ray); ! return vertex; } |