File: iicm.utils3d.Camera.html

package info (click to toggle)
vrwave 0.9-4
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 5,032 kB
  • ctags: 7,153
  • sloc: java: 15,050; ansic: 8,219; sh: 458; makefile: 181
file content (313 lines) | stat: -rw-r--r-- 12,294 bytes parent folder | download | duplicates (3)
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Thu Sep 25 20:23:36 MET DST 1997 -->
<a name="_top_"></a>
<title>
  Class iicm.utils3d.Camera
</title>
</head>
<body background="vrwavebg.gif">
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-iicm.utils3d.html">This Package</a>  <a href="Package-iicm.utils3d.html">Previous</a>  <a href="iicm.utils3d.Hitpoint.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class iicm.utils3d.Camera
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----iicm.utils3d.Camera
</pre>
<hr>
<dl>
  <dt> public class <b>Camera</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
Camera - camera control
Copyright (c) 1996,97 IICM
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#orientation_"><b>orientation_</b></a>
  <dd> 
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#position_"><b>position_</b></a>
  <dd> 
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Camera()"><b>Camera</b></a>()
  <dd> 
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#approachNormal(float[], float[], float)"><b>approachNormal</b></a>(float[], float[], float)
  <dd> approach a surface normal vector.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#approachPosition(float[], float, float)"><b>approachPosition</b></a>(float[], float, float)
  <dd> approach a target position.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#interpolateViews(iicm.utils3d.Camera, iicm.utils3d.Camera, float)"><b>interpolateViews</b></a>(Camera, Camera, float)
  <dd> calculates a new camera position and orientation between the two viewpoints, defined
by the Cameras cam1 & cam2.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#interpolateViews(float[], iicm.utils3d.Quaternion, float[], iicm.utils3d.Quaternion, float)"><b>interpolateViews</b></a>(float[], Quaternion, float[], Quaternion, float)
  <dd> calculates a new camera position and orientation between the two viewpoints, defined
by the two pairs of position and orientation.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#levelize()"><b>levelize</b></a>()
  <dd> make the Camera leveled with ground plane

  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#printValues(java.io.PrintStream)"><b>printValues</b></a>(PrintStream)
  <dd> print camera values

  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#reset()"><b>reset</b></a>()
  <dd> reset the Camera to its default position/orientation

  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#rotateXYcenter(float, float, float[])"><b>rotateXYcenter</b></a>(float, float, float[])
  <dd> rotate horizontally and vertically about arbitrary center.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#rotateXYposition(float, float)"><b>rotateXYposition</b></a>(float, float)
  <dd> rotate horizontally and vertical around camera position.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setCamera(float, float, float, float)"><b>setCamera</b></a>(float, float, float, float)
  <dd> set Camera via GE3D

  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#translateVec(float[])"><b>translateVec</b></a>(float[])
  <dd> translate camera along a given vector

  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#translateVP(float, float, float, float)"><b>translateVP</b></a>(float, float, float, float)
  <dd> translate camera parallel to viewing plane

  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#untilt()"><b>untilt</b></a>()
  <dd> untilt the Camera (up is (0, 1, 0))

  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#viewingRay(float, float, float, float, float, float)"><b>viewingRay</b></a>(float, float, float, float, float, float)
  <dd> get the viewing ray (for picking).
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#zoomOut(float)"><b>zoomOut</b></a>(float)
  <dd> zoom (dolly) camera (away from viewing plane)

</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="position_"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>position_</b>
<pre>
  protected float position_[]
</pre>
<a name="orientation_"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>orientation_</b>
<pre>
  protected <a href="iicm.utils3d.Quaternion.html#_top_">Quaternion</a> orientation_
</pre>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Camera"></a>
<a name="Camera()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Camera</b>
<pre>
  public Camera()
</pre>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="reset()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="reset"><b>reset</b></a>
<pre>
  public void reset()
</pre>
<dl>
  <dd> reset the Camera to its default position/orientation
</dl>
<a name="levelize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="levelize"><b>levelize</b></a>
<pre>
  public void levelize()
</pre>
<dl>
  <dd> make the Camera leveled with ground plane
</dl>
<a name="untilt()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="untilt"><b>untilt</b></a>
<pre>
  public void untilt()
</pre>
<dl>
  <dd> untilt the Camera (up is (0, 1, 0))
</dl>
<a name="setCamera(float, float, float, float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setCamera"><b>setCamera</b></a>
<pre>
  public void setCamera(float viewangle,
                        float winaspect,
                        float hither,
                        float yon)
</pre>
<dl>
  <dd> set Camera via GE3D
  <dl>
    <dt> <b>Parameters:</b>
    <dd> viewangle - vertical field of view
    <dd> winaspect - window aspect (width/height)
    <dd> hither - near clipping plane
    <dd> yon - far clipping plane
  </dl>
</dl>
<a name="zoomOut(float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="zoomOut"><b>zoomOut</b></a>
<pre>
  public void zoomOut(float f)
</pre>
<dl>
  <dd> zoom (dolly) camera (away from viewing plane)
</dl>
<a name="translateVP(float, float, float, float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="translateVP"><b>translateVP</b></a>
<pre>
  public void translateVP(float x,
                          float y,
                          float aspect,
                          float scale)
</pre>
<dl>
  <dd> translate camera parallel to viewing plane
</dl>
<a name="translateVec(float[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="translateVec"><b>translateVec</b></a>
<pre>
  public void translateVec(float tran[])
</pre>
<dl>
  <dd> translate camera along a given vector
</dl>
<a name="rotateXYposition(float, float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="rotateXYposition"><b>rotateXYposition</b></a>
<pre>
  public void rotateXYposition(float l2r,
                               float t2b)
</pre>
<dl>
  <dd> rotate horizontally and vertical around camera position.
(angles given in radians)
</dl>
<a name="rotateXYcenter(float, float, float[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="rotateXYcenter"><b>rotateXYcenter</b></a>
<pre>
  public void rotateXYcenter(float l2r,
                             float t2b,
                             float center[])
</pre>
<dl>
  <dd> rotate horizontally and vertically about arbitrary center.
(angles given in radians)
</dl>
<a name="approachPosition(float[], float, float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="approachPosition"><b>approachPosition</b></a>
<pre>
  public void approachPosition(float poi[],
                               float ktran,
                               float hither)
</pre>
<dl>
  <dd> approach a target position. move a fraction of k of the distance
between current position and target position towards the target
(away from target if k < 0). do not go nearer to target than near
clipping plane hither.
</dl>
<a name="approachNormal(float[], float[], float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="approachNormal"><b>approachNormal</b></a>
<pre>
  public void approachNormal(float poi[],
                             float normal[],
                             float krot)
</pre>
<dl>
  <dd> approach a surface normal vector. adjust line of sight by a
fraction of k to approach the negative surface normal vector
(away from it if k < 0). normal must be normalized.
does not change camera tilt.
  <dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#interpolateViews">interpolateViews</a>
  </dl>
</dl>
<a name="interpolateViews(iicm.utils3d.Camera, iicm.utils3d.Camera, float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="interpolateViews"><b>interpolateViews</b></a>
<pre>
  public void interpolateViews(<a href="#_top_">Camera</a> cam1,
                               <a href="#_top_">Camera</a> cam2,
                               float t)
</pre>
<dl>
  <dd> calculates a new camera position and orientation between the two viewpoints, defined
by the Cameras cam1 & cam2.
</dl>
<a name="interpolateViews(float[], iicm.utils3d.Quaternion, float[], iicm.utils3d.Quaternion, float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="interpolateViews"><b>interpolateViews</b></a>
<pre>
  public void interpolateViews(float pos1[],
                               <a href="iicm.utils3d.Quaternion.html#_top_">Quaternion</a> or1,
                               float pos2[],
                               <a href="iicm.utils3d.Quaternion.html#_top_">Quaternion</a> or2,
                               float t)
</pre>
<dl>
  <dd> calculates a new camera position and orientation between the two viewpoints, defined
by the two pairs of position and orientation.
</dl>
<a name="viewingRay(float, float, float, float, float, float)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="viewingRay"><b>viewingRay</b></a>
<pre>
  public <a href="iicm.utils3d.Ray.html#_top_">Ray</a> viewingRay(float fx,
                        float fy,
                        float viewangle,
                        float winaspect,
                        float near,
                        float far)
</pre>
<dl>
  <dd> get the viewing ray (for picking). direction is not normalized.
  <dl>
    <dt> <b>Parameters:</b>
    <dd> fx: - horicontal fraction (0 = left, 1 = right)
    <dd> fy: - vertical fraction (0 = bottom, 1 = top)
viewplane, winaspect, near, far clipping planes not managed by Camera itself (see #setCamera)
  </dl>
</dl>
<a name="printValues(java.io.PrintStream)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="printValues"><b>printValues</b></a>
<pre>
  public void printValues(<a href="java.io.PrintStream.html#_top_">PrintStream</a> os)
</pre>
<dl>
  <dd> print camera values
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-iicm.utils3d.html">This Package</a>  <a href="Package-iicm.utils3d.html">Previous</a>  <a href="iicm.utils3d.Hitpoint.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>