1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Java 3D 1.4: Picking Changes</title>
</head>
<body>
<h2>Java 3D<sup><font size="-2">TM</font></sup> 1.4:
Picking Changes</h2>
<h3><span style="color: rgb(0, 153, 0);"><i>ROUGH DRAFT: This API
is a Work in Progress</i></span></h3>
<hr>
<p>This page describes the proposed picking changes in Java 3D 1.4. The
main motivation is to improve picking performance. It eliminates the
need to rely on picking utility for extra pick information, such as the
color, normal and texture coordinates of the intersection points. This
information will be returned, from the core picking methods, in a newly
created PickInfo class.<br>
<br>
<span style="font-weight: bold;">The proposed API is:</span><br>
</p>
<h4><big style="font-weight: bold;">The following 4 methods will be
added to
Locale and BranchGroup :</big><big style="font-weight: bold;"></big>
<br>
</h4>
<div style="margin-left: 40px;"><span style="font-weight: bold;">public
PickInfo[] pickAll(
int mode, int flags, PickShape pickShape )</span><br>
<span style="font-weight: bold;">public PickInfo[]
pickAllSorted( int mode, int flags, PickShape pickShape )</span><br>
<span style="font-weight: bold;">public PickInfo pickClosest(
int mode, int flags, PickShape pickShape )</span><br>
<span style="font-weight: bold;">public PickInfo pickAny( int
mode, int flags, PickShape pickShape )</span><br>
</div>
<p>
<br>
Where <br>
</p>
<div style="margin-left: 40px;"><span style="font-weight: bold;">mode</span>
is an enum of [ Bounds, Geometry ] <br>
<span style="font-weight: bold;">flags</span>
is a mask indicating which components are present in each returned
PickInfo object. This is specified as one or more individual flags that
are bitwise "OR"ed together to describe the returned per PickInfo data.
<br>
The flags include: <br>
<code>SCENEGRAPHPATH
- request for computed SceneGraphPath; </code> <br>
<code>NODE
- request
for computed intersected Node;</code><br>
<code>LOCAL_TO_VWORLD
- request for computed local to virtual world transform;</code><br>
<code>CLOSEST_INTERSECTION_POINT -
request for
closest intersection point.</code><br>
<code>DISTANCE
-
request for the closest distance of the intersection.</code><br>
<code>CLOSEST_GEOM_INFO
- request for
ONLY the closest intersection geometry information.</code><br>
<code>ALL_GEOM_INFO
- request for all intersection geometry information. </code>
<br>
</div>
<p></p>
<p>
<br>
NOTES : <br>
</p>
<div style="margin-left: 40px;">If <code>CLOSEST_INTERSECTION_POINT</code>
is not set
return PickInfo.closestIntersectionPoint is set to null.<br>
If <code>CLOSEST_GEOM_INFO</code> is
set the return PickInfo.intersectionInfos is of length 1, and
pickInfo.geomPickInfo
contains the
information of the closest pick.<br>
If <code>ALL_GEOM_INFO</code> is set
the return PickInfo.intersectionInfos contains all intersections of the
pickable node
in sorted order.<br>
If both <code>CLOSEST_GEOM_INFO</code>
and
<code>ALL_GEOM_INFO</code> are not set, PickInfo.intersectionInfos is
set to null.<br>
An<span style="font-style: italic;"> </span>IllegalArgumentException<span
style="font-style: italic;"></span>
is thrown if <span style="font-style: italic;"> </span>both<span
style="font-style: italic;"> </span><code>CLOSEST_GEOM_INFO</code>
and
<code>ALL_GEOM_INFO</code> are set.<br>
</div>
<p> <br>
<br>
<big style="font-weight: bold;">* New classes</big></p>
<big style="font-weight: bold;">public class PickInfo extends Object</big>
<p style="margin-left: 40px;"><span style="font-style: italic;"></span>
<span style="font-style: italic;">/** </span><span
style="font-style: italic;">Retrieves
the reference to the SceneGraphPath in this PickInfo object. */</span><br>
<span style="font-weight: bold;">public
SceneGraphPath getSceneGraphPath()<br>
</span></p>
<p style="margin-left: 40px;"><span style="font-style: italic;">/*</span><span
style="font-style: italic;">* Retrieves
the reference to the picked node, either a Shape3D or a Morph, in
this PickInfo object. */</span><span style="font-weight: bold;"><br>
</span><span style="font-style: italic;"></span><span
style="font-weight: bold;">public Node getNode()<br>
</span><span style="font-style: italic;"><br>
/** Retrieves
the reference to the LocalToVworld transform of the picked node in
this PickInfo object. */</span><span style="font-weight: bold;"><br>
</span><span style="font-style: italic;"></span><span
style="font-weight: bold;">public
Transform3D getLocalToVWorld()</span><span style="font-style: italic;"></span><br>
<span style="font-weight: bold;"></span></p>
<p style="margin-left: 40px;">/*<span style="font-style: italic;">*
Retrieves
the reference to the closest intersection point in this PickInfo
object. */</span><span style="font-weight: bold;"><br>
</span><span style="font-weight: bold;">public
Point3d getClosestIntersectionPoint()<br>
</span></p>
<p style="margin-left: 40px;">/*<span style="font-style: italic;">*
Retrieves
the distance between the start point of the pickShape and the
intersection point. */</span><span style="font-weight: bold;"><br>
</span><span style="font-style: italic;"></span><span
style="font-weight: bold;">public
double getDistance()<br>
</span></p>
<p style="margin-left: 40px;">/*<span style="font-style: italic;">*
Retrieves
the reference to the array of intersection results in this PickInfo
object. */</span><span style="font-weight: bold;"><br>
</span><span style="font-style: italic;"></span><span
style="font-weight: bold;">public
IntersectionInfo[] getIntersectionInfos()</span><br>
</p>
<p><big><span style="font-weight: bold;">public class
PickInfo.IntersectionInfo extends Object ( inner
class )</span><br style="font-weight: bold;">
</big><span style="font-style: italic;"></span></p>
<div style="margin-left: 40px;"><span style="font-style: italic;">/**
Retrieves
the index to the intersected geometry in the picked node, either a
Shape3D or Morph. */</span><br>
<span style="font-weight: bold;">public
int getGeometryIndex() <br>
<br>
</span>/*<span style="font-style: italic;">* Retrieves
the reference to the intersected geometry in the picked object,
either a Shape3D or Morph. */</span><span style="font-style: italic;"></span><br>
<span style="font-weight: bold;">public
Geometry getGeometry()</span> <span style="font-style: italic;"></span><br>
<br>
/*<span style="font-style: italic;">* Retrieves
the interpolation weights for each of the verticies of the
intersected primitive. */</span><br>
<span style="font-weight: bold;">public
float[] getWeights()</span><span style="font-style: italic;"></span><br>
<br>
/*<span style="font-style: italic;">* Retrieves
the reference to the intersection point of the picked geometry in this
IntersectionInfo object. */</span><br>
<span style="font-weight: bold;">public
Point3d getIntersectionPoint()<br>
</span><span style="font-style: italic;"></span><span
style="font-weight: bold;"></span><br>
<span style="font-style: italic;">/** Retrieves
the vertex indices of the intersected primitive in the geometry. */</span><br>
<span style="font-weight: bold;">public int[] getVertexIndices()</span><br>
</div>
<p>
</p>
<p></p>
<p></p>
<p><br>
<font color="gray">Page last updated —
$Date$
</font></p>
</body>
</html>
|