Picking

Picking

Chi Chung Ko (National University of Singapore, Singapore) and Chang Dong Cheng (CCS Automation PTE LTD, Singapore)
Copyright: © 2009 |Pages: 29
DOI: 10.4018/978-1-59904-789-8.ch009
OnDemand PDF Download:
$37.50

Abstract

The last two chapters have discussed how animation and interaction can be created in Java 3D to increase visual impact, to show object dynamics and hidden views, and to allow the user to interact with the objects in a virtual 3D universe (Emoto et al., 2001, Shyamsundar & Gadh, 2001). Our discussion has been carried in a general tone through the use of the behavior class to capture all types of events to cater to all possibilities. However, it is common that interaction with 3D objects in many applications involves the user to pick up relevant objects and change its positions, angles, and even texture and shapes for a variety of purposes. As a simple example of picking behavior, Figure 1 shows snapshots in an application where the user uses the mouse to pick up a cube and moves it to a new position through a mouse dragging operation. In this chapter, we will discuss how the picking behavior class in Java 3D can be made use of to create interesting customized dynamical picking interaction with any specific visual object. We will start in the next section with the use of some standard picking behavior classes, before embarking on to discuss how custom picking classes can be constructed to suit specific applications.
Chapter Preview
Top

Introduction

The last two chapters have discussed how animation and interaction can be created in Java 3D to increase visual impact, to show object dynamics and hidden views, and to allow the user to interact with the objects in a virtual 3D universe (Emoto et al., 2001, Shyamsundar & Gadh, 2001). Our discussion has been carried in a general tone through the use of the behavior class to capture all types of events to cater to all possibilities.

However, it is common that interaction with 3D objects in many applications involves the user to pick up relevant objects and change its positions, angles, and even texture and shapes for a variety of purposes. As a simple example of picking behavior, Figure 1 shows snapshots in an application where the user uses the mouse to pick up a cube and moves it to a new position through a mouse dragging operation.

Figure 1.

Illustration of picking behavior when the user picks and moves the cube

In this chapter, we will discuss how the picking behavior class in Java 3D can be made use of to create interesting customized dynamical picking interaction with any specific visual object. We will start in the next section with the use of some standard picking behavior classes, before embarking on to discuss how custom picking classes can be constructed to suit specific applications.

Top

Pickrotatebehavior, Picktranslatebehavior, And Pickzoombehavior

The standard PickRotateBehavior, PickTranslateBehavior, and PickZoomBehavior classes in Java 3D include capabilities that allow the user to interactively pick and then rotate, translate, and zoom visual objects in a 3D scene (Nakano, Sato, Matsuo, & Ishimasa, 2000).

Figures 2 to 4 give the code segment and result snapshots in a simple example illustrating the use of these three classes in a picking behavior involving a sphere and a color cube. The interaction includes translation, rotation, and zooming.

Figure 2.

First code segment for PickBehaviour.java

Figure 4.

Third code segment and result snapshoots for PickBehaviour.java

In this example, the objects are immersed in a landscape matrix so that it will be easier to visualize how the objects are being moved or changed as they are picked by using the mouse. Specifically, dragging a visual object while pressing the left mouse button will make the picked object rotate, doing so with the right button pressed will translate the object, and dragging the object with the middle button pressed will make the object zoom in or out.

Note that the picking behavior is unique for individual objects in the same scene. Also, Enable_Pick_Reporting is set for the appropriate transform groups.

Figure 3.

Second code segment for PickBehaviour.java

Top

Picking Classes In General

The picking classes described in the last section are relatively easy to use and can provide some standard interaction between visual objects and the user. However, the interaction may be too rigid to cater to every scenario. Examples are knobs that only allow the user to turn and buttons that can only be pressed as they are pushed in the 3D world.

To satisfy requirements such as those mentioned in the examples, there are very often needs to create customized picking behaviors for certain specific objects in applications. We will now discuss techniques and methods that can be used for constructing customized picking classes for this purpose.

Complete Chapter List

Search this Book:
Reset
Table of Contents
Preface
Chi Chung Ko
Chapter 1
Chi Chung Ko, Chang Dong Cheng
Web-based virtual reality is fast becoming an important application and technological tools in the next generation of games and simulation as well... Sample PDF
Virtual Reality and Java 3D
$37.50
Chapter 2
Java 3D Overview  (pages 18-31)
Chi Chung Ko, Chang Dong Cheng
In the last chapter, a brief introduction on the creation of 3D content through the use of Java 3D and other programming methodologies for virtual... Sample PDF
Java 3D Overview
$37.50
Chapter 3
Geometry Objects  (pages 32-74)
Chi Chung Ko, Chang Dong Cheng
To create 3D graphics, we have to build graphics or visual objects and position them appropriately in a virtual scene. In general, there are three... Sample PDF
Geometry Objects
$37.50
Chapter 4
Appearance Objects  (pages 75-96)
Chi Chung Ko, Chang Dong Cheng
In the last chapter, the creation of the skeletons or shapes of 3D objects has been discussed through the use of geometry objects in Java 3D. In... Sample PDF
Appearance Objects
$37.50
Chapter 5
Textures  (pages 97-113)
Chi Chung Ko, Chang Dong Cheng
Although extensive use of basic attributes such as color and material will be able to make an object realistic to the human user, it will be time... Sample PDF
Textures
$37.50
Chapter 6
Chi Chung Ko, Chang Dong Cheng
How the properties of virtual 3D objects can be specified and defined has been discussed in earlier chapters. However, how a certain virtual object... Sample PDF
Lighting, Fog, and Background
$37.50
Chapter 7
Animation Objects  (pages 132-158)
Chi Chung Ko, Chang Dong Cheng
We have discussed important Java 3D objects that are basically static in the last few chapters. Starting from this chapter, we will be looking at... Sample PDF
Animation Objects
$37.50
Chapter 8
Interaction  (pages 159-187)
Chi Chung Ko, Chang Dong Cheng
In Chapter VII, we discussed how animation can be applied in Java 3D to increase the visual impact of a virtual 3D world and illustrate the dynamic... Sample PDF
Interaction
$37.50
Chapter 9
Picking  (pages 188-216)
Chi Chung Ko, Chang Dong Cheng
The last two chapters have discussed how animation and interaction can be created in Java 3D to increase visual impact, to show object dynamics and... Sample PDF
Picking
$37.50
Chapter 10
Chi Chung Ko, Chang Dong Cheng
One of the most useful and important advantages of 3D graphics rendering and applications is that there is the possibility for the user to navigate... Sample PDF
Navigation, Input Devices, and Collision
$37.50
Chapter 11
Multiple Views  (pages 238-263)
Chi Chung Ko, Chang Dong Cheng
Our discussions in previous chapters have centered on the creation and interaction of visual objects in a virtual 3D world. The objects and scenes... Sample PDF
Multiple Views
$37.50
Chapter 12
Audio  (pages 264-275)
Chi Chung Ko, Chang Dong Cheng
Of all the human perceptions, two of the most important ones are perhaps vision and sound, for which we have developed highly specialized sensors... Sample PDF
Audio
$37.50
Chapter 13
Chi Chung Ko, Chang Dong Cheng
In this final chapter, we will describe the use of Java 3D as a visualization technology in the development of a Web-based 3D real time oscilloscope... Sample PDF
A Web-Based 3D Real Time Oscilloscope Experiment
$37.50
Appendix A: Downloading Software
Appendix B: Running the Rotating Cube Program
Appendix C: ViewManager
Appendix D: Main Applet for Web-Based 3D Experiment
Appendix E: Scene Graph Implementation for Web-Based 3D Experiment
Appendix F: Knob Class for Web-Based 3D Experiment
Appendix G: Navigation and Collision Detection for Web-Based 3D Experiment
Appendix H: Picking for Web-Based 3D Experiment
Appendix I: Program Summary and Screen Capture
About the Authors