3D-Online Product Configuration by Java3D

Slides:



Advertisements
Similar presentations
Department of computer science and engineering INTRODUCTION TO JAVA 3D Martin Čadík Czech Technical University in Prague, Czech Republic.
Advertisements

Java3D Presented By Chris Gundlach
Lecture21 Other Java Gamming technologies – Java3D (This lecture will not be assessed)
Lecture22 Java3D - Interaction - This lecture will not be assessed.
1 Review of applets & Computer Graphis GUILecture 6 Review of Applets & Compute Graphics GUI Overview  Introduction to Graphics. Applets: a quick review.
1 Chapter 10 Behavior and Interaction  To understand dynamic behaviors in graphics  To understand Java 3D Behavior and WakeupCondition classes  To apply.
Java 3D Pablo Figueroa University of Alberta April 2000.
26 June 2015The eScience Wedge1 An Interactive and Immersive Virtual Environment A guide to developing applications using the TIWI package and utilities.
Creating a GUI with Swing. Introduction Very useful link: Swing – is a part of JFC (Java Foundation.
Object Oriented Programming Java 1 GUI example taken from “Computing Concepts with Java 2” by Cay Horstmann GUI Programming.
Introduction to Java3D 1 3D-Pool Game Simulator CS491B Aslan Neishaboori.
Nathaniel Salazar Massachusetts Institute of Technology Mentor: Thomas Meyer Internship Site: MHPCC.
Basic 3D Graphics Chapter 5. Bird’s Eye View  Basic 3D Graphics –Basic concepts of 3D graphics, rendering pipeline, Java 3D programming, scene graph,
Io package as Java’s basic I/O system continue’d.
1 Introduction to Java 3D Java 3D Overview v API for 3D applications v Portable.
Java 3D Introduction Stefan Rufer Assistant Computer Science Departement
Java ME & Blackberry APIs for Game Dev Week III. Overview Java 2D API Java 3D API SVG Blackberry APIs
, Computer Engineering Lab II (3rd Year)
CS324e - Elements of Graphics and Visualization Checkerboard World.
Java3D Overview Scene graph Java 3D classes Describing objects Groups, transforms Behaviors, interpolators Lighting.
1 Animation & Java3D ©Anthony Steed Overview n Introduction to Animation Kinematics Dynamics Boids n Java3D Scene graph Animation Vehicles.
Learn about the types of Graphics that are available Develop a basic Graphics applet Develop a basic Graphics application Review the Java API and use.
A Simple Talk on Java 3D Presented by C.H. Chen on Jul. 6, 2004.
Introduction to GUI in Java 1. Graphical User Interface Java is equipped with many powerful,easy to use GUI component such as input and output dialog.
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
GUI programming Graphical user interface-based programming.
Java Quiz Bowl A fun review of the Java you should know from CMPT 201 If you don’t know the answers - this week is for you to study up!
Cs884(Prasad)java12AWT1 Abstract Windowing Toolkit Support for Graphical User Interface (Event-driven programming)
Interfaces. –An interface describes a set of methods: no constructors no instance variables –The interface must be implemented by some class. 646 java.
Objectives of This Session
Event Handling Mohanraj S AP / IT Angel College of Engg & Tech.,
Intro to Applets August 19, 2008 Mrs. C. Furman. Java Applets vs. Java Applications Java Applet: a program that is intended for use on the web. Java Applet:
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
CSC 205 – Java Programming II Applet. Types of Java Programs Applets Applications Console applications Graphics applications Applications are stand-alone.
CompSci 100E 35.1 Graphical User Interfaces: GUIs  Components  Flat Layouts  Hierarchical Layouts  Designing a GUI  Coding a GUI.
Chapter 5: Ball Worlds Features 2 classes, constant data fields, constructors, extension through inheritance, graphics.
Object Oriented Programming (OOP) is a style of programming that incorporates these 3 features: Encapsulation Polymorphism Class Interaction.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
1 / 67 COP 3503 FALL 2012 SHAYAN JAVED LECTURE 14 Programming Fundamentals using Java 1.
111/22/ :40 UML VRML 2.0 Scene Graph Structure Group Transformation Shape Nodes.
CS324e - Elements of Graphics and Visualization Java 3D Intro.
Java GUI. Graphical User Interface (GUI) a list a button a text field a label combo box checkbox.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Interface Opportunities for 3D Data and Media User Interface Software TechNote Panel Virginia Tech CS Fall 2002 Nicholas F. Polys Umur Yilmaz Will Lee.
Java 3D Web Apps and Services. Presentation Overview l Java3D Overview l Software l Java3D API l Scene Graph Programming Model l Java3D Terminology l.
Your name CSCI/CMPE 3326 Object-Oriented Programming in Java Dongchul Kim Department of Computer Science University of Texas – Pan American 1.Applet.
1 9 Lighting a Scene v There are four types of lighting: –ambient light –directional light –point light –spotlight v Any number of these can be added to.
Computer Science 209 GUIs Model/View/Controller Layouts.
Chapter 2 Creating a Java Application and Applet.
CSI 3125, Preliminaries, page 1 AWT. CSI 3125, Preliminaries, page 2 AWT Java AWT (Abstract Windowing Toolkit) is an API to develop GUI or window-based.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 5 Basic 3D Graphics.
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Lesson 28: More on the GUI button, frame and actions.
CPCS 391 Computer Graphics Lab One. Computer Graphics Using Java What is Computer Graphics: Computer graphics are graphics created using computers and,
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
GUI.1 Graphical User Interfaces GUIs. GUI.2 The Plan Components Flat Layouts Hierarchical Layouts Designing a GUI Coding a GUI.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 7 ( Book Chapter 14) GUI and Event-Driven Programming.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Event-Driven Programming and Basic GUI Objects.
CSC 205 Programming II Lecture 5 AWT - I.
GUIs Model/View/Controller Layouts
Ellen Walker Hiram College
MVC Paradigm The MVC paradigm breaks applications or interfaces into three parts: the model, the view, and the controller. A --> 25 % B --> 60 % C -->
Unreal Engine and C++ We’re finally at a point where we can start working in C++ with Unreal Engine To get everything set up for this properly, we’re going.
UNIT-5.
Section 9.1 Introduction.
class PrintOnetoTen { public static void main(String args[]) {
Chapter 11 Inheritance and Polymorphism Part 1
GUI building with the AWT
Graphical User Interface
Presentation transcript:

3D-Online Product Configuration by Java3D Fachhochschule Stralsund University of Applied Science Prof.Dr.-Ing. Christine Wahmkow Department of Mechanical Engineering only Phylosophy of Java3D and an easy example 10.11.2018

Philosophy of Java3D – think in Scenegraph 10.11.2018 3D-Online Product Configuration by Java3D Philosophy of Java3D – think in Scenegraph Virtual universe as the root The virtual universe is described by a scenegraph Each scenegraph has always only one rrot The virrtual universe can have a lot of local objects. Normally a 3D program has only one licale objekt The locale object is a startpoint to which the virtual object get their position A branchgroup is the root of a subgraph of the local tree In maintenance there are 2 branchs: content and view branch Content branch: describes the 3D virtual world (Geometry, Light Behavior, outfit of the objects) View Branch: specifys how the world is showing Here you can select options for thedifferent output devices for normal PC‘s you can use default values canvas3D : the surface where the object are rendered Content Branch: is lived when he is hanging under the locale node The developer has to describe the objects Objects are living, if you set the necessary capabilities 10.11.2018

Philosophy of Java3D – think in Scenegraph 3D-Online Product Configuration by Java3D Philosophy of Java3D – think in Scenegraph View Branch: Very complex and complicated But: Java3D offers a utility class The developer can concentrate on the virtual world 10.11.2018

An easy recipe to produce a Java3D-application 3D-Online Product Configuration by Java3D An easy recipe to produce a Java3D-application create a subclass of class Applet public class HelloJava3D extends Applet create a constructor for the subclass which then builds the virtual world public HelloJava3D() define a method to create the Content branch public BranchGroup createSceneGraph() call the applet in a MainFrame object in the main method of the applet public static void main(String[] args){ Frame frame=new MainFrame(new HelloJava3D(),400,400); } 10.11.2018

An easy recipe to produce a constructor (scenegraph) 10.11.2018 3D-Online Product Configuration by Java3D An easy recipe to produce a constructor (scenegraph) Create a Canvas3D object Canvas3D canvas3D=new Canvas3D(null); Create a SimpleUniverse object, which has a reference to the canvas3D SimpleUniverse simpleU=new SimpleUniverse(canvas3D); simpleU.getViewingPlatform().setNominalViewingTransform(); Create the Content branch BranchGroup scene=createScenegraph(); Compile the Content branch scene.compile(); Add the Content branch to the locale object of the SimpleUniverse simpleU.addBranchgraph(scene); 2 5 1 4 3 10.11.2018

3D-Online Product Configuration by Java3D The constructor public class HelloJava3D1 extends Applet { public HelloJava3D1() { setLayout(new BorderLayout()); Canvas3D canvas3D = new Canvas3D(null); add("Center", canvas3D); BranchGroup scene = createSceneGraph(); SimpleUniverse simpleU = new SimpleUniverse(canvas3D); // This will move the ViewPlatform back a bit so the objects in the scene can be viewed. simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); } // end of HelloJava3D1 (constructor) 10.11.2018

3D-Online Product Configuration by Java3D The content branch public BranchGroup createSceneGraph() { // Create the root of the branch graph BranchGroup objRoot = new BranchGroup(); objRoot.compile(); return objRoot; } // end of CreateSceneGraph method of HelloJava3D1 // The following allows this to be run as an applicationas well as an applet public static void main(String[] args) { Frame frame = new MainFrame(new HelloJava3D1(), 256, 256); } // end of main (method of HelloJava3D1) 10.11.2018

3D-Online Product Configuration by Java3D import java.applet.Applet import java.awt.BorderLayout; import java.awt.Frame; import java.awt.event.*; import com.sun.j3d.utils.applet.MainFrame; import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils.geometry.ColorCube; import javax.media.j3d.*; import javax.vecmath.*; 10.11.2018

3D-Online Product Configuration by Java3D The expanded content branch public BranchGroup createSceneGraph() { // Create the root of the branch graph BranchGroup objRoot = new BranchGroup(); objRoot.compile(); return objRoot; } // end of CreateSceneGraph method of HelloJava3D1 objRoot.addChild(new ColorCube(0.4)); 10.11.2018

Mouse behavior BranchGroup objRoot = new BranchGroup(); TransformGroup objTransform = new TransformGroup(); objTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); objRoot.addChild(objTransform); objTransform.addChild(new ColorCube(0.4)); MouseRotate myMouseRotate = new MouseRotate(); myMouseRotate.setTransformGroup(objTransform); myMouseRotate.setSchedulingBounds(new BoundingSphere()); objTransform.addChild(myMouseRotate); MouseTranslate myMouseTranslate = new MouseTranslate(); myMouseTranslate.setTransformGroup(objTransform); myMouseTranslate.setSchedulingBounds(new BoundingSphere()); objTransform.addChild(myMouseTranslate); MouseZoom myMouseZoom = new MouseZoom(); myMouseZoom.setTransformGroup(objTransform); myMouseZoom.setSchedulingBounds(new BoundingSphere()); objTransform.addChild(myMouseZoom); objRoot.compile(); return objRoot; Add the packages: import com.sun.j3d.utils.behaviors.mouse.*; import java.awt.event.*; import java.util.Enumeration; 10.11.2018

AWT-Interaction- example to change the background color Additional packeges: import java.awt.*; import java.awt.event.*; import java.util.Enumeration; import java.awt.event.ActionEvent; import java.awt.event.WindowAdapter; Background define in the Content branch bg=new Background(); bg.setCapability(bg.ALLOW_COLOR_READ); bg.setCapability(bg.ALLOW_COLOR_WRITE); bg.setColor(0.0f,0.0f,0.0f); //black bg.setApplicationBounds(new BoundingSphere()); objTransform.addChild(bg); AWT Interaction by an additional method public void actionPerformed(ActionEvent e ) { if (e.getSource()==Backg){ bg.setColor(0.0f,0.0f,0.8f); //blue } 10.11.2018

AWT-Interaction- example to change the rotation speed of the cube Alpha define // Alpha as an object of time Alpha rotationAlpha; rotationAlpha=new Alpha(-1,rottime); RotationInterpolator rotator= new RotationInterpolator(rotationAlpha,objTransform); BoundingSphere bounds=new BoundingSphere(); rotator.setSchedulingBounds(bounds); objTransform.addChild(rotator); public void actionPerformed(ActionEvent e ) { if (e.getSource()==RottimeP){ rottime=rottime+2000; rotationAlpha.setIncreasingAlphaDuration(rottime); } if (e.getSource()==Rotstop){ rotationAlpha.setLoopCount(0); } 10.11.2018