Archived

This topic is now archived and is closed to further replies.

Goodlife

Independent translation

Recommended Posts

Hello all, I wonder if anyone could help me with this. I have a point in 3d space... let''s say 3.0,3.0,3.0. If I want to rotate this point around, say, 6.0,6.0,6.0 at yaw 35, pitch 25, and roll 359, what would I do? I understand the math involved, so please don''t send me an explanation of matrices, etc. I have implemented a routine that works for me-- I do some mucking about with sin and cosine, but the computation is expensive. What I really want is a nice self-contained function, using the DirectX api, along the lines of: RotatePoint(x,y,z, aroundx,aroundy,aroundz, anglex,angley,anglez,*finalx,*finaly,*finalz); Does DirectX have any method of doing this without setting up a whole view matrix, etc? Does anyone have, or can quickly scribe, a similar function to this one above, that uses the directx api? I''m looking for a quick and dirty fix, here-- I don''t want to understand why it works until later, when I go in and customize the routine. I just want to make sure some of my code conceptuals work, and make sure that I can count on directx acceleration for the operation. Note that when I optimize it, I won''t be passing the center to it all the time-- I''m just going to be setting the center, and the rotations, and then doing lots of rotating in one big chunk. So it''s actually okay if it''s a ''little slow'' to set up a matrix that will subsequently be used to adjust 200+ vertices. The reason I wonder if directx has the capability is because I want to use MMX, etc, to do the computations. When I do raw computations using sin/cos it runs at about 80% of the speed of when I let directx do the computing. Thanks in advance!!! -- Goodlife ----------------------------- Think of your mind as a door on a house. Leave the door always closed, and it's not a house, it's a prison. Leave the door always open, and it's not a house, it's a wilderness-- all the vermin creep in.

Share this post


Link to post
Share on other sites