home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / graphics / 9256 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.2 KB

  1. Path: sparky!uunet!sun-barr!news2me.ebay.sun.com!jethro.Corp.Sun.COM!marillion!dmeny
  2. From: dmeny@marillion.Corp.Sun.COM (David Meny)
  3. Newsgroups: comp.graphics
  4. Subject: Re: 3d rotation about an arbitrary axis: how?
  5. Date: 28 Aug 1992 23:10:49 GMT
  6. Organization: Sun Microsystems, Inc.
  7. Lines: 24
  8. Distribution: world
  9. Message-ID: <l9tcjpINNnqv@jethro.Corp.Sun.COM>
  10. References: <87331@netnews.upenn.edu>
  11. Reply-To: dmeny@marillion.Corp.Sun.COM
  12. NNTP-Posting-Host: marillion.corp.sun.com
  13. Keywords: 3D rotation matrix graphics gems
  14.  
  15. Charlie:
  16.  
  17. From "Graphics Gems" (the original), page 466:
  18.  
  19. R = rotation_about_axis_by_angle(axis, theta) =
  20.  
  21.    | txx + c     txy + sz     txz - sy  |
  22.  = | txy - sz    tyy + c      tyz + sx  |
  23.    | txz + sy    tyz - sx     tzz + c   |
  24.  
  25. where:
  26.     x, y, and z are the components of a unit vector along rotation axis;
  27.     theta is the angular amount of rotation;
  28.     s = sin theta;
  29.     c = cos theta;
  30.     t = 1 - c.
  31.  
  32. This is a matrix.  To use it, multiply a row vector [x y z 1] by this 
  33. matrix to get your new vector [x' y' z' 1].
  34.  
  35. I just used this reference in a program I'm writing where I needed to rotate about
  36. an arbitrary axis.  This formula works great.
  37.  
  38. >> David W. Meny <<
  39.