Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 10 Behavior and Interaction.

Slides:



Advertisements
Similar presentations
Where to get Blender for Free! Download from Blender.org and run the installer.
Advertisements

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 2 2D Graphics: Basics.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. Multithreading Example from Liang textbook.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 20 Recursion.
Programming with Alice. Getting Started with Alice Alice is a free programming language – Named in honor of Lewis Carroll – See web page for download.
© 2010 Pearson Education, Inc. All rights reserved.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation F To understand the.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter Trees and B-Trees.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L13 (Chapter 21) Generics.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 47 Red Black Trees.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 16 Applets.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 7 Geometric Transformation.
Lecture22 Java3D - Interaction - This lecture will not be assessed.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 8 Views F Views in 3D rendering process.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 8 Views.
1 Chapter 10 Behavior and Interaction  To understand dynamic behaviors in graphics  To understand Java 3D Behavior and WakeupCondition classes  To apply.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 14 Applets, Images,
© 2010 Pearson Education, Inc. All rights reserved.
Chapter 1 Overview of Computers and Programming. Copyright ©2004 Pearson Addison-Wesley. All rights reserved.1-2 Figure 1.3 Components of a Computer.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 45 AVL Trees and Splay.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L05 (Chapter 16) Applets.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Overview of Computer Graphics.
Chapter 12 Applets and Advanced Graphics  The Applet Class  The HTML Tag F Passing Parameters to Applets F Conversions Between Applications and Applets.
Programming Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Motion and Rotation. 3 Dimensional Space  An Alice object o Is located in a 3D world, positioned at (x, y, z) o has 3 dimensions o height, width, depth.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 12 Additional 3D Topics.
A Simple Talk on Java 3D Presented by C.H. Chen on Jul. 6, 2004.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 2 1 Java Inheritance.
Balanced Search Trees Chapter 27 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Chapter 12 Applets and Advanced GUI  The Applet Class  The HTML Tag F Passing Parameters to Applets F Conversions Between Applications and Applets F.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Event Driven Programming, The.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 14 Event-Driven Programming.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 3 2D Graphics: Rendering Details.
Copyright © 2010 Pearson Education, Inc. All rights reserved Sec
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 21.1 Test-Driving the Painter Application.
Chapter 10: Applets and Advanced Graphics The Applet Class The Applet Class The HTML Tag The HTML Tag Passing Parameters to Applets Passing Parameters.
Topics Introduction Scene Graphs
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 27 JavaBeans and.
CS324e - Elements of Graphics and Visualization Timing Framework.
Swing - 2 Session 13. Swing - 2 / 2 of 38 Objectives (1) Discuss trees and tables Discuss progress bars Discuss MVC architecture Describe menus.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Lighting and Texturing.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation.
1 5. Behavior Objects  Both interaction and animation are specified with objects  Both interaction and animation are specified with Behavior objects.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 Chapter 15 Event-Driven Programming and.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 5 Basic 3D Graphics.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 Chapter 14 JavaFX Basics.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 32 JavaBeans and Bean.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 Chapter 15 Event-Driven Programming and.
Balanced Search Trees (partial) Chapter 29 Slides by Steve Armstrong LeTourneau University Longview, TX  2007,  Prentice Hall - Edited by Nadia Al-Ghreimil.
Navigating In PowerPoint. The Presentation: Navigation  Next slide:  N (“Next”)  PgDn      Enter  Space  mouse click  mouse wheel.
Further Abstraction Techniques Chapter 10. Abstract Classes There are times when you do not want someone to be able to make an object of your class. For.
Flag Quiz Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Chapter 16 Universal Insurance Issues and International Comparisons of Health Care Systems.
Dive Into® Visual Basic 2010 Express
Chapter 1 Functions Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
© 2015 Pearson Education, Inc.
Alice 3 Using the Alice 3.1 Interactive Development Environment (IDE)
Operator Overloading; Class string
© 2015 Pearson Education, Inc.
EE 422C Java FX.
Exception Handling: A Deeper Look
Chapter 15 Event-Driven Programming and Animations
Section 2.5 Graphing Techniques; Transformations
Advanced Java Topics Chapter 9
Section 2.5 Graphing Techniques; Transformations
Linear Inequalities and Absolute Value
Roots, Radicals, and Root Functions
Presentation transcript:

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 10 Behavior and Interaction

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 2 Objectives F To understand dynamic behaviors in graphics F To understand Java 3D Behavior and WakeupCondition classes F To apply Behavior nodes in scene graphs F To use mouse behaviors F To use key navigator behaviors F To use view platform behaviors F To combine picking and behaviors

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 3 Behavior

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 4 Behavior F During the initialization of the Behavior object, it sets a WakeupCondition object. F When the wakeup condition occurs, it will awaken the Behavior by calling its processStimulus. F After executing the custom code in processStimulus, a wakeup condition can be set again by calling the wakeupOn method. F The process will then repeat indefinitely.

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 5 Behavior Classes

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 6 Wakeup Condition

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 7 Boolean Operators on Wakeup Criteria WakeupAnd(WakeupCriterion[] criteria) WakeupOr(WakeupCriterion[] criteria) WakeupOrOfAnds(WakeupAnd[] criteriaAnds) WakeupAndOfOrs(WakeupOr[] criteriaOrs)

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 8 Implement Custom Behavior F Define a subclass of Behavior class and override the initialize and processStimulus methods. F Set the appropriate wakeup condition in the initialize method. If necessary set the wakeup condition again in processStimulus. F Create an instance of the custom Behavior class and add it to the scene graph as a leaf. F Set the influence bound for the behavior object.

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 9 Example: A Clock SourceRunSource

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 10 Interaction

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 11 Mouse Behaviors F MouseRotate: drag the mouse with the left button down. F MouseTranslate: drag the mouse with the right button down. F MouseZoom: drag the mouse with the middle button down (or with left button down while holding the Alt key). SourceRun

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 12 KeyNavigatorBehavior F, : Rotate left/right F, : Translate forward/backward F Alt-, Alt- : Translate left/right F PgUp, PgDn: Rotate up/down F Alt-PgUp, Alt-PgDn: Translate up/down F -: Reduce back clip distance F +: Reset back clip distance F =: Reset SourceRun

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 13 View Platform Behavior Source Run OrbitBehavior() OrbitBehavior(Canvas3D cv) OrbitBehavior(Canvas3D cv, int flags)

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 14 Picking and Mouse Behavior PickRotateBehavior rotator = new PickRotateBehavior(cv, root, bounds); root.addChild(rotator); Source Run

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 15 Data Visualization Example Source Run

Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 16 Obtaining Pick Intersection PickIntersection inter = results[i].getIntersection(0); Point3d pt = inter.getClosestVertexCoordinates(); int[] ind = inter.getPrimitiveCoordinateIndices();