Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE3584546@probe-2.acclaim-euro.net> From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: HELP : Scaling Date: Tue, 23 Feb 1999 13:08:54 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain Reply-To: djgpp AT delorie DOT com Lee writes: > i've made a small modification to TransformObj(). when the object is > rotated, it seems as if the axis is located at screen coordinates 0, 0. > > how do i select my own axis to rotate the object? Do you mean an axis aligned somewhere other than along the x/y/z primaries, or located somewhere other than through the origin? If you want a rotation other than around x/y/z, use get_vector_rotation_matrix(). If you want to rotate about a point other than the origin, shift so that your pivot point will become the origin (ie. translate by -pivot), rotate, and then translate back to the original location. This is where matrix concatenation becomes really handy, because you can build up a single matrix that contains all three of these transforms, and then apply it to your vertices as just a single operation. Shawn Hargreaves.