From e95aadc605cfe57067e98a247d4e2fd6e2d76895 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 9 Jul 2012 09:31:09 -0700 Subject: fix for grid drawing. --- js/helper-classes/3D/StageLine.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/helper-classes/3D/StageLine.js b/js/helper-classes/3D/StageLine.js index 12efb140..e4394650 100755 --- a/js/helper-classes/3D/StageLine.js +++ b/js/helper-classes/3D/StageLine.js @@ -9,6 +9,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot // The line class represents a line intersected with all planes on the scene /////////////////////////////////////////////////////////////////////// var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; +var viewUtils = require( "js/helper-classes/3D/view-utils").ViewUtils; var LinePlaneIntersectRec = require("js/helper-classes/3D/LinePlaneIntersectRec").LinePlaneIntersectRec; var StageLine = exports.StageLine = Object.create(Object.prototype, { @@ -109,6 +110,7 @@ var StageLine = exports.StageLine = Object.create(Object.prototype, { // determine if the intersection is on a front side (no intersection) of the polygons //var ctr = [ 0.5*(boundaryPts[0][0] + boundaryPts[2][0]), 0.5*(boundaryPts[0][1] + boundaryPts[2][1]), 0.5*(boundaryPts[0][2] + boundaryPts[2][2]) ]; //var vec = vecUtils.vecSubtract(3, pt, ctr ); + this.edgeIsFrontFacing2( plane ); if ( !this.edgeIsFrontFacing(boundaryPts, planeEq, plane.isBackFacing(), onEdge[0], onEdge[1]) ) { // take the dot product between the line and the normal to the plane @@ -190,6 +192,15 @@ var StageLine = exports.StageLine = Object.create(Object.prototype, { } }, + edgeIsFrontFacing2: + { + value: function( plane ) + { + var elt = plane._elt; + var bounds = viewUtils.getElementViewBounds3D( elt ); + } + }, + edgeIsFrontFacing: { value: function(boundaryPts, planeNormal, backfacing, iEdge, t) -- cgit v1.2.3