[Bprocessor-commit] /gl/src/net/sourceforge/bprocessor/gl/tool FinalMoveTool.java, 1.38, 1.39
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-12-10 08:34:40
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29534/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Finally instancemove works Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** FinalMoveTool.java 9 Dec 2007 08:26:34 -0000 1.38 --- FinalMoveTool.java 10 Dec 2007 08:34:25 -0000 1.39 *************** *** 26,30 **** import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Geometry; - import net.sourceforge.bprocessor.model.Matrix; import net.sourceforge.bprocessor.model.Mesh; import net.sourceforge.bprocessor.model.Project; --- 26,29 ---- *************** *** 195,199 **** private CoordinateSystem handle; private CoordinateSystem initialCoordinate; - private Matrix handleTranslation; /** --- 194,197 ---- *************** *** 206,215 **** this.handle = handle; this.initialCoordinate = instance.getInstanceAnchor().copy(); - handleTranslation = new Matrix(new double[]{ - handle.getI().getX(), handle.getI().getY(), handle.getI().getZ(), 0, - handle.getJ().getX(), handle.getJ().getY(), handle.getJ().getZ(), 0, - handle.getN().getX(), handle.getN().getY(), handle.getN().getZ(), 0, - handle.getOrigin().getX(), handle.getOrigin().getY(), handle.getOrigin().getZ(), 1, - }).invert(); } --- 204,207 ---- *************** *** 228,250 **** } CoordinateSystem cs = CoordinateSystem.systemFor(current.vertex(), n); ! CoordinateSystem anchor = instance.getInstanceAnchor(); ! Vertex handleOffset = handle.center().scale(-1); ! ! Vertex i = handleTranslation.multiply(cs.getI(), false); ! Vertex j = handleTranslation.multiply(cs.getJ(), false); ! Vertex k = handleTranslation.multiply(cs.getN(), false); ! anchor.setIJN(i, j, k); ! anchor.setOrigin(current.vertex()); ! anchor.setOrigin(anchor.unTranslate(handleOffset)); ! /* ! Matrix movement = handleTranslation.copy(); ! movement.translate(x, y, z); ! Vertex i = handleTranslation.multiply(cs.getI(), false); ! Vertex j = handleTranslation.multiply(cs.getJ(), false); ! Vertex k = handleTranslation.multiply(cs.getN(), false); ! anchor.setIJN(i, j, k); ! Vertex center = handleTranslation.multiply(cs.center(), false); ! anchor.setOrigin(center); ! */ } else { // change i, j, n of the anchor back to its originals and then just move the delta --- 220,229 ---- } CoordinateSystem cs = CoordinateSystem.systemFor(current.vertex(), n); ! CoordinateSystem anchor = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), ! new Vertex(0, 0, 1), new Vertex(0, 0, 0)); ! CoordinateSystem tmp = handle.translate(anchor); ! tmp = cs.unTranslate(tmp); ! instance.getInstanceAnchor().setOrigin(tmp.center()); ! instance.getInstanceAnchor().setIJN(tmp.getI(), tmp.getJ(), tmp.getN()); } else { // change i, j, n of the anchor back to its originals and then just move the delta |