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 javax.media.j3d.*;
29 import javax.vecmath.*;
30 import camera3d.action.ActionQueue;
31 import camera3d.action.ActionExecutor;
32 import camera3d.action.AddPlaneGizmoAction;
33
34 public class PlaneDrawingTest {
35
36 /***
37 *
38 */
39 static public void main(String[] args) {
40 NodeTester tester = new NodeTester();
41 tester.getFrame().setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
42 //GeometryBag bag = new GeometryBag();
43 ActionQueue queue = new ActionQueue();
44 //GUIControl guiControl = new GUIControl(queue);
45 J3DBase base = new J3DBase();
46 GeometryBag bag = base.getDefaultGeometryBag();
47 bag.getBranchGroup().detach();
48 ActionExecutor executor = new ActionExecutor(queue, new ActionQueue(), base);
49 tester.add(bag.getBranchGroup());
50
51
52
53 //1
54 Point3d point = new Point3d(0.3333333333333333, 0.3333333333333333, 0.0);
55 Vector3d vector = new Vector3d(0.0, 0.0, -1.0);
56 bag.addLine(point, vector);
57 bag.addPoint(point);
58 bag.addPlane(point, vector);
59
60 //2
61 Point3d point2 = new Point3d(0.0, 0.3333333333333333, 0.3333333333333333);
62 Vector3d vector2 = new Vector3d(-1.0, 0.0, 0.0);
63 bag.addPlane(point2, vector2);
64
65
66 //3
67 Point3d point3 = new Point3d(0.3333333333333333, 0.0, 0.3333333333333333);
68 Vector3d vector3 = new Vector3d(0.0, -1.0, 0.0);
69 bag.addPlane(point3, vector3);
70
71 //4
72 Point3d point4 = new Point3d(-2.8086301683969737, 2.7582044639297614, -0.12486886355270164);
73 Vector3d vector4 = new Vector3d(-0.3746065906581049, 0.0, -0.9271838556810139);
74 //bag.addPlane(point4, vector4);
75 AddPlaneGizmoAction action4 = new AddPlaneGizmoAction(point4, vector4);
76
77
78
79 //5
80 Point3d point5 = new Point3d(-2.992822590071277, 2.7582044639297614, 0.3090612852270046);
81 Vector3d vector5 = new Vector3d(-0.9271838556810138, 0.0, 0.3746065906581051);
82 //bag.addPlane(point5, vector5);
83 AddPlaneGizmoAction action5 = new AddPlaneGizmoAction(point5, vector5);
84
85 //6
86 /*
87 Point3d point6 = new Point3d(0.3333333333333333, 0.0, 0.3333333333333333);
88 Vector3d vector6 = new Vector3d(0.0, -1.0, -0.0);
89 bag.addPlane(point6, vector6);
90 */
91 action4.doAction(executor);
92 action5.doAction(executor);
93
94 }
95
96 }
This page was automatically generated by Maven