From: <ha...@us...> - 2008-12-07 06:18:15
|
Revision: 10456 http://jmol.svn.sourceforge.net/jmol/?rev=10456&view=rev Author: hansonr Date: 2008-12-07 06:18:12 +0000 (Sun, 07 Dec 2008) Log Message: ----------- version=11.7.17_dev quaternion fix # new feature: q = quaternion(matrixColumn1, matrixColumn2) # quaternion from first two columns of a 3x3 rotation matrix # bug fix: some quaternions cannot be created from a 3x3, namely: # q = quaternion({1 2 -2}, {2 1 2}) = {0.57735026 0.57735026 0.0 0.57735026} (xyzw format) Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Eval.java Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2008-12-07 06:08:23 UTC (rev 10455) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2008-12-07 06:18:12 UTC (rev 10456) @@ -291,7 +291,6 @@ } catch (ScriptException e) { setErrorMessage(e.toString()); errorMessageUntranslated = e.getErrorMessageUntranslated(); - System.out.println("eval e, untrans" + e + " "+ errorMessageUntranslated); scriptStatusOrBuffer(errorMessage); viewer.notifyError( (errorMessage.indexOf("java.lang.OutOfMemoryError") >= 0 ? "Error" @@ -12785,6 +12784,7 @@ // quaternion(q0, q1, q2, q3) // quaternion("{x, y, z, w"}) // quaternion(center, X, XY) + // quaternion(mcol1, mcol2) // quaternion(q, "id", center) // draw code // axisangle(vector, theta) // axisangle(x, y, z, theta) @@ -12794,7 +12794,8 @@ case 4: break; case 2: - if (args[0].tok != Token.point3f) + if (args[0].tok != Token.point3f || tok != Token.quaternion + && args[1].tok == Token.point3f) return false; break; case 3: @@ -12818,7 +12819,10 @@ Point4f p4 = null; switch (args.length) { case 2: - q = new Quaternion((Point3f) args[0].value, Token.fValue(args[1])); + if (args[1].tok == Token.point3f) + q = Quaternion.getQuaternionFrame(new Point3f(0,0,0), (Point3f) args[0].value, (Point3f) args[1].value); + else + q = new Quaternion((Point3f) args[0].value, Token.fValue(args[1])); break; case 3: if (args[0].tok == Token.point4f) { @@ -13542,6 +13546,16 @@ return addX(v4); } switch (n) { + // q%0 w + // q%1 x + // q%2 y + // q%3 z + // q%4 normal + // q%-1 vector(1) + // q%-2 theta + // q%-3 Matrix column 0 + // q%-4 Matrix column 1 + // q%-5 Matrix column 2 case 0: return addX(q.w); case 1: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |