public lineManip() { plane = new planeMath(); mousePointGlName = new MPoint(); // Setup the plane with a point on the // plane along with a normal MPoint pointOnPlane = lineGeometry.topPoint(); // Normal = cross product of two vectors on the plane MVector _topPoint = new MVector(lineGeometry.topPoint()); MVector _bottomPoint = new MVector(lineGeometry.bottomPoint()); MVector _otherPoint = new MVector(lineGeometry.otherPoint()); MVector normalToPlane = (_topPoint - _otherPoint).crossProduct(_otherPoint - _bottomPoint); // Necessary to normalize normalToPlane.normalize(); // Plane defined by a point and a normal plane.setPlane( pointOnPlane, normalToPlane ); }
public lineManip() { plane = new planeMath(); mousePointGlName = new MPoint(); // Setup the plane with a point on the // plane along with a normal MPoint pointOnPlane = lineGeometry.topPoint(); // Normal = cross product of two vectors on the plane MVector _topPoint = new MVector(lineGeometry.topPoint()); MVector _bottomPoint = new MVector(lineGeometry.bottomPoint()); MVector _otherPoint = new MVector(lineGeometry.otherPoint()); MVector normalToPlane = (_topPoint - _otherPoint).crossProduct(_otherPoint - _bottomPoint); // Necessary to normalize normalToPlane.normalize(); // Plane defined by a point and a normal plane.setPlane(pointOnPlane, normalToPlane); }