I'm trying to implement the Rolling Ball Algorithm
for viewing objects, and I'm having a problem getting
it right.
If I have a view camera represented as a three
axis coordinate system <X,Y,Z> at location <P>.
I construct the matrix ,M, as described in the GemsIII
article.
If I want to apply the matrix to my coordinate
system,
1) Does that make sense? I want to apply above rotation
to a coordinate system.
Translate coordinate system to the origin
Apply M to the <X,Y,Z>. This involves inverting
M.
X' = INV(M) * X
Y' = INV(M) * Y
Z' = INV(M) * Z
Translate back to coordinate system location, <P>.
2) Is the M in the algorithm supposed to be orthogonal?
Since it's a pure rotation, I would hope so. (Right?)
(ie. So that it would be nice for INV(M) = Transpose(M))
Are there other types of algorithms similar to this
for viewing objects in 3D that involve the camera being
focused on an object and the mouse motions rotating
about that object. I've done some crude things in this
area but would like to find a better one, similar to
what most CAD tools use.
Thanks for any help,
-DaveS
|