From 3987b73569e58843f2a91c0c6c4e4132f51ac247 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 21 Mar 2012 17:13:56 -0700 Subject: Do not set webkit-transform styles on elements unless 3d is used on them. Signed-off-by: Nivesh Rajbhandari --- js/tools/drawing-tool-base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tools/drawing-tool-base.js') diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index 8d87605c..84602186 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js @@ -442,7 +442,7 @@ exports.DrawingToolBase = Montage.create(Montage, { flatMat = divMat; flatMatSafe = MathUtils.scientificToDecimal(flatMat, 10); - return "perspective(" + 1400 + ") matrix3d( " + flatMatSafe + ")"; + return "perspective(" + 1400 + ") matrix3d(" + flatMatSafe + ")"; } }, -- cgit v1.2.3 From 952e0b2c28af081041fa8987c3e865b931d052fa Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 9 Apr 2012 16:04:24 -0700 Subject: Single perspective fix. Note that rotating multiple objects when the stage is rotated still doesn't work and flatten still doesn't work. Signed-off-by: Nivesh Rajbhandari --- js/tools/drawing-tool-base.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'js/tools/drawing-tool-base.js') diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index 84602186..476dca66 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js @@ -227,7 +227,7 @@ exports.DrawingToolBase = Montage.create(Montage, { //var planeMatInv = planeMat.inverse(); var planeMatInv = glmat4.inverse( planeMat, [] ); //var midPt = this.unprojectPoints( s0, s1, planeMat, planeMatInv, s1Proj ); - var midPt = this.unprojectPoints( s0, s1, planeMat, planeMatInv, true ); +// var midPt = this.unprojectPoints( s0, s1, planeMat, planeMatInv, true ); // get the 4 points of the bounding box in 2D space p0 = MathUtils.transformPoint( s0, planeMatInv ); @@ -237,7 +237,7 @@ exports.DrawingToolBase = Montage.create(Montage, { //midPt = s0.add(s1); //midPt = midPt.multiply(0.5); //midPt = MathUtils.makeDimension3(midPt); - midPt = vec3.add(s0, s1, []); + var midPt = vec3.add(s0, s1, []); midPt = vecUtils.vecScale( 3, midPt, 0.5 ); // the mid point is now relative to the center of the 3D space. To @@ -371,6 +371,9 @@ exports.DrawingToolBase = Montage.create(Montage, { // determine if the geometry is going to be projected. If so a second projected rectangle is drawn var isProjected = ((MathUtils.fpCmp(thePlane[2],1.0) !== 0) || (MathUtils.fpSign(thePlane[3]) !== 0)); + // TODO - We no longer need to project drawing after perspective fix. Need to clean up this code. + // For now, just setting isProjected to false so rest of the drawing still works. + isProjected = false; // get and draw the unprojected object points var projPtArr = []; if (isProjected) @@ -442,7 +445,7 @@ exports.DrawingToolBase = Montage.create(Montage, { flatMat = divMat; flatMatSafe = MathUtils.scientificToDecimal(flatMat, 10); - return "perspective(" + 1400 + ") matrix3d(" + flatMatSafe + ")"; + return "matrix3d(" + flatMatSafe + ")"; } }, -- cgit v1.2.3