Path: chuka.playstation.co.uk!scea!valdes!cbrisebo From: Cary Brisebois Newsgroups: scee.yaroze.programming.3d_graphics,scea.yaroze.programming.3d_graphics Subject: Converting 3D Vector to rotation matrix. Date: Tue, 11 Aug 1998 23:32:27 -0700 Organization: SCEA News Server Lines: 26 Message-ID: NNTP-Posting-Host: valdes.csc.UVic.CA Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Sender: cbrisebo@valdes Xref: chuka.playstation.co.uk scee.yaroze.programming.3d_graphics:803 scea.yaroze.programming.3d_graphics:278 Here's a problem I am having: I obtain a normal vector from a polygon. I then want to place a cube tangent to this polygon with its z-axis (in its local coordinates) parallel to the normal vector. So as the first polygon moves in 3D, the cube will stay tangent and 'on top' of the polygon. I need to know an easy way to convert the normal vector into a rotation matrix for the cube. For example, if the normal vector was only lying in the x/y plane, then the rotation matrix would be around the Z axis. (I've seen a solution for this somewhere!!) This is easiest to think of if the polygon were situated at the origin of the world coordinates and the cube's bottom (sitting on the polygon) was also at the origin. Help! Cary. Technologicus Corruptus.