Graphics Reference
In-Depth Information
The discussion in this chapter emphasized a mathematical view of transforma-
tions. Let us add a few comments about efficiency because there are times when effi-
ciency is more important than clarity. Transformations get used a lot in geometric
modeling and generating them in a systematic way, which usually involves repre-
senting them as a composite of primitive ones, involves more arithmetic operations
than necessary. The papers [Gold90] and [Mill99] describe a more efficient approach.
For example, suppose we express an arbitrary affine transformation T of R 3
in the
form
TM T
() =
ppv
+
,
where M is a 3 ¥ 3 matrix and v is a fixed translation vector. If T is a rotation through
an angle q about a line L through a point q with direction vector w , then it is shown
that
(
)
M
=
cos
q
I
+
1
-
cos
q
ww
ƒ+
sin
q
A
and
(4.31a)
w
T ,
vqMq
=-
(4.31b)
where I is the 3 ¥ 3 identity matrix,
ab
ab
ab
a
a
a
Ê
ˆ
Ê
ˆ
11
12
1 3
1
Á
Á
˜
˜
Á
Á
˜
˜ (
)
a ƒ=
ab
ab
ab
=
bbb
123 ,
21
22
2 3
2
Ë
¯
Ë
¯
ab
ab
ab
31
32
3 3
3
and
ww
w w
ww
0
-
Ê
ˆ
3
2
Á
Á
˜
˜
A
w =
-
0
.
3
1
Ë
¯
-
0
2
1
With this representation, an optimized computation takes 15 multiplications and 10
additions to compute M and 9 multiplications and 9 additions to compute v . The
number of operations to compute the matrix M and vector v with the “composite-of-
transformations” approach would be much greater. See [Gold90] for efficient formu-
las for other transformations.
Finally, one topic not discussed much in this topic (other than in the documen-
tation for the GM and SPACE program) is the user interface of a modeling program,
even though this takes up a large percentage of the time needed to develop such a
program in general. Certain aspects of such a discussion, if we had the space or time,
would probably be most appropriate in the context of the topic of this chapter. There
are lots of interesting issues here as to how one can make it easier for the user to
define the desired view of the world. How to best look at the world is often a major
concern to a user. How does a user specify a view? How does one control panning
and zooming? How does one specify a user's or the camera's arbitrary movement
through the world? In a three-dimensional world this is not always easy if all one has
is a keyboard and a mouse.
Search WWH ::




Custom Search