[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Plane.java,1.4,1.5
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2005-09-02 13:38:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16815 Modified Files: Plane.java Log Message: made orthogonal space method Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Plane.java 31 Aug 2005 07:52:28 -0000 1.4 --- Plane.java 2 Sep 2005 13:38:13 -0000 1.5 *************** *** 44,47 **** --- 44,64 ---- /** + * Find the orthogonal plane to this plane + * @param rayIn the ray into the view + * @return The orthogonal plane + */ + public Plane orthogonalPlane(Edge rayIn) { + Vertex to = rayIn.getTo(); + Vertex from = rayIn.getFrom(); + Vertex alfa = new Vertex("", to.getX() - from.getX(), + to.getY() - from.getY(), + to.getZ() - from.getZ()); + Vertex beta = new Vertex("", a, b, c); + Vertex temp = alfa.cross(beta); + Vertex norm = temp.cross(beta); + return new Plane(norm.getX(), norm.getY(), norm.getZ(), d); + } + + /** * Find the intersection with the ray (x y t), * if the ray is parallel to the Plane, otherwise NaN is *************** *** 98,101 **** return intersection(p0, p1); } ! } --- 115,125 ---- return intersection(p0, p1); } ! ! /** ! * To string ! * @return a string ! */ ! public String toString() { ! return "[Plane a: " + a + " b:" + b + " c:" + c + " d:" + d + "]"; ! } } |