[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.153, 1.154
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-09-28 06:09:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18824/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: A failed experiment with rotations Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** View.java 27 Sep 2006 08:36:38 -0000 1.153 --- View.java 28 Sep 2006 06:09:14 -0000 1.154 *************** *** 20,23 **** --- 20,24 ---- import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; + import net.sourceforge.bprocessor.model.Matrix; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; *************** *** 1021,1027 **** if (current instanceof Rotate) { Rotate rotate = (Rotate) current; ! gl.glRotated(rotate.rx(), 1, 0, 0); ! gl.glRotated(rotate.ry(), 0, 1, 0); ! gl.glRotated(rotate.rz(), 0, 0, 1); } if (current instanceof AxisRotate) { --- 1022,1039 ---- if (current instanceof Rotate) { Rotate rotate = (Rotate) current; ! double xaxis[] = new double[]{1, 0, 0, 0}; ! double yaxis[] = new double[]{0, 1, 0, 0}; ! double zaxis[] = new double[]{0, 0, 1, 0}; ! ! Matrix zmatrix = Matrix.rotation(Math.PI * rotate.rz() / 180, ! zaxis[0], zaxis[1], zaxis[2]); ! xaxis = zmatrix.multiply(xaxis); ! yaxis = zmatrix.multiply(yaxis); ! Matrix ymatrix = Matrix.rotation(Math.PI * rotate.ry() / 180, ! yaxis[0], yaxis[1], yaxis[2]); ! xaxis = ymatrix.multiply(xaxis); ! gl.glRotated(rotate.rx(), xaxis[0], xaxis[1], xaxis[2]); ! gl.glRotated(rotate.ry(), yaxis[0], yaxis[1], yaxis[2]); ! gl.glRotated(rotate.rz(), zaxis[0], zaxis[1], zaxis[2]); } if (current instanceof AxisRotate) { |