Java Reference
In-Depth Information
Figure 15. Fifth code segment and result of BillboardDemo.java
167. public BillboardDemo()
168. {
169. setLayout(new BorderLayout());
170. Canvas3D canvas3D = new Canvas3D(null);
171. add("Center", canvas3D);
172. SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
173. BranchGroup scene = createSceneGraph(simpleU);
174. simpleU.addBranchGraph(scene);
175.
176. } // end of BillboardDemo (constructor)
177.
178.
179. public static void main(String[] args)
180. {
181. System.out.print("A demonstration of the Billboard Behavior \n");
182. System.out.println("It uses KeyNavigatorBehavior to explore the scene.");
183. System.out.println("At all times the 2D objects found in the scene will face the user.\n");
184. Frame frame = new MainFrame(new BillboardDemo(), 256, 256);
185. } // end of main (method of BillboardDemo)
186. }
187.
Search WWH ::




Custom Search