[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Rotate.java, 1.4, 1.5
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-11-05 18:09:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7819/src/net/sourceforge/bprocessor/model Modified Files: Rotate.java Log Message: implemented the transform operation on rotation Index: Rotate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Rotate.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Rotate.java 16 Apr 2007 15:55:22 -0000 1.4 --- Rotate.java 5 Nov 2007 18:09:53 -0000 1.5 *************** *** 126,130 **** */ public Vertex transform(Vertex vertex) { ! return vertex; } --- 126,141 ---- */ public Vertex transform(Vertex vertex) { ! Matrix matrix = Matrix.rotation(rx, 1, 0, 0); ! double values[] = new double[4]; ! values[0] = vertex.getX(); ! values[1] = vertex.getY(); ! values[2] = vertex.getZ(); ! values[3] = 1; ! values = matrix.multiply(values); ! matrix = Matrix.rotation(ry, 0, 1, 0); ! values = matrix.multiply(values); ! matrix = Matrix.rotation(rz, 0, 0, 1); ! values = matrix.multiply(values); ! return new Vertex(values[0], values[1], values[2]); } |