Re: [Algorithms] Lots of problems...
Brought to you by:
vexxed72
From: Kevin L. <lac...@in...> - 2000-08-26 16:33:01
|
On Sat, 26 Aug 2000, dga wrote: I'll tackle the first two because they are very simple. > 1) How to obtain the position of an object, based on it's transformation > matrix ? I'm using DirectX, so a vector is transformed like this: > I like to add a point p0 that contains the center coordinates of any given mesh object. Any time the object is translated just add the translation into p0. > 2) How do I rotate an object around an arbitrary axis ? More exactly, given > a matrix W that represents the objects current position, how do I built > the matrix A such as WA gives me the transformation matrix for the object > that rotates the object at it's current position around axis a=(ax,ay,az) First tranlate the object to the origin. Then perform the rotation. Then transform it back to where it was. And for a stab at number four. This will depend on how smart you want the missle to bvehave. You could at every refresh have the missle rotate itself toward the current position of its target. Find the position of the two and use a cross product to find the angle. Then move the missle by some value in that direction. This assume a very smart missle. Kevin |