home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!news2me.ebay.sun.com!jethro.Corp.Sun.COM!marillion!dmeny
- From: dmeny@marillion.Corp.Sun.COM (David Meny)
- Newsgroups: comp.graphics
- Subject: Re: 3d rotation about an arbitrary axis: how?
- Date: 28 Aug 1992 23:10:49 GMT
- Organization: Sun Microsystems, Inc.
- Lines: 24
- Distribution: world
- Message-ID: <l9tcjpINNnqv@jethro.Corp.Sun.COM>
- References: <87331@netnews.upenn.edu>
- Reply-To: dmeny@marillion.Corp.Sun.COM
- NNTP-Posting-Host: marillion.corp.sun.com
- Keywords: 3D rotation matrix graphics gems
-
- Charlie:
-
- From "Graphics Gems" (the original), page 466:
-
- R = rotation_about_axis_by_angle(axis, theta) =
-
- | txx + c txy + sz txz - sy |
- = | txy - sz tyy + c tyz + sx |
- | txz + sy tyz - sx tzz + c |
-
- where:
- x, y, and z are the components of a unit vector along rotation axis;
- theta is the angular amount of rotation;
- s = sin theta;
- c = cos theta;
- t = 1 - c.
-
- This is a matrix. To use it, multiply a row vector [x y z 1] by this
- matrix to get your new vector [x' y' z' 1].
-
- I just used this reference in a program I'm writing where I needed to rotate about
- an arbitrary axis. This formula works great.
-
- >> David W. Meny <<
-