View Javadoc
1 /***************************************************************************** 2 * Virtual Mockup for Machine Vision 3 * Copyright (C) 2001-2003 Fabio R. de Miranda, João E. Kogler Jr., 4 * Carlos S. Santos. 5 * Virtual Mockup for Machine Vision Project funded by SENAC-SP 6 * 7 * Permission is granted to redistribute and/or modify this 8 * software under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 * 12 * This software is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License (http://www.gnu.org/copyleft/lesser.html) 16 * for more details. 17 * 18 *****************************************************************************/ 19 20 package camera3d.test; 21 22 /*** 23 * 24 * @author Carlos da Silva dos Santos, Fábio de Miranda 25 */ 26 27 import camera3d.*; 28 import camera3d.gizmo.*; 29 import javax.media.j3d.*; 30 import javax.vecmath.*; 31 32 public class PlaneGizmoTester { 33 /*** 34 * 35 */ 36 static public void main(String[] args) { 37 Point3d point = new Point3d(5.0, 5.0, 5.0); 38 Vector3d vector = new Vector3d(1.0, 1.0, 1.0); 39 Vector4d plane = new Vector4d(); 40 // Creates horizontal plane from three points 41 Point3d p1 = new Point3d(0.0,1.0,0.0); 42 Point3d p2 = new Point3d(1.0,1.0,0.0); 43 Point3d p3 = new Point3d(0.0,1.0,1.0); 44 PlaneGizmo hor = new PlaneGizmo(p1,p2,p3); 45 46 PlaneGizmo gizmo = new PlaneGizmo(point, vector); 47 System.out.println("Feeding in point "+point+" and vector "+vector); 48 gizmo.buildPlane4dFromPointAndNormal(plane, point, vector); 49 50 System.out.println("Obtained result: "+plane); 51 PlaneGizmo gizmo4d = new PlaneGizmo(plane); 52 53 NodeTester tester = new NodeTester(); 54 tester.getFrame().setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 55 tester.add(gizmo); 56 tester.add(gizmo4d); 57 tester.add(hor); 58 } 59 }

This page was automatically generated by Maven