Path: chuka.playstation.co.uk!news From: James Shaughnessy Newsgroups: scee.yaroze.programming.3d_graphics Subject: Rotating about an arbitrary axis? Date: Fri, 18 Sep 1998 17:30:05 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 44 Message-ID: <36028A8D.290E@manc.u-net.com> Reply-To: james@manc.u-net.com NNTP-Posting-Host: manc.u-net.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win95; I) OK I know this is a standard and accepted problem but I would really appreciate a quick pointer regarding object rotation: As you may or may not be aware of my latest project is a 3D 9-ball pool game. I currently have all the balls on the table rolling around (through each other :)) at constant speed bouncing "i=r" (*) off imaginary cushions. What I need is to know what matrix transformation I need to apply to a ball so it will rotate in the direction it is moving: eg. struct POOLBALL { long vx, vy, vz; 3DOBJECT *object; } Ball; Ball.vx = 10; Ball.vy = 0; // Y = vertical plane Ball.vz = 10; If I just rotate the object normally like this.. // X Y Z axis rotation RotateObject(&Ball->object, Ball.vz, 0, Ball.vx); ..clearly I run into the 'order of rotation' problem and this method is of no use. So, what is the matrix I need to rotate about an arbitrary axis? muchos gracias, Jim PS (*) "i=r" non-physics fans refers to the "angle of incidence = the angle of reflection" -- a WAAY oversimplified model for pool balls, but enough 'till I get the buggers rolling the right way..! PPS Sorry if this was a rediculously long-winded way to ask a very simple question but it shows how I am currently trying to do it. -- ----------------------------------------- James Shaughnessy james@manc.u-net.com http://www.netyaroze-europe.com/~shaughnj -----------------------------------------