Archived

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

faustmen

DirectX 7.0 Rotation !

Recommended Posts

faustmen    122
Hello ! I have some problem with DirectX 7.0 . Can I use DirectX 7.0 MSSDK to rotate some surface to different angle ? I try to use Blt with parameter ''dwRotateAngle'', but nothink was there. I say to you about programming rotate (If Video-card dont support rotate ). Pleese,help me with this problem ! If you can, with small excersise . Best reguards! Dmitry Nikolaev (sorry for Bad English) mailto:faustmen@tut.by

Share this post


Link to post
Share on other sites
IndirectX    122
From what I''ve heard, rotation isn''t supported in hardware nor is it emulated by software. Don''t take my word for it, however; check the appropriate caps to make sure of this.

Share this post


Link to post
Share on other sites
myme15    122
I wouldn't bother with rotation in DirectDraw. Software rotation is so slow that DirectDraw does not emulate it: if your hardware doesn't support it, it won't work. It seems like most hardware doesn't support 2D rotation (correct me if I'm wrong) so if you absolutely need rotation, you'll have to find some painfully slow algorithm somewhere or switch to Direct3D/OpenGL.




Things are not what they are.


[edited by - myme15 on June 8, 2002 8:09:32 PM]

Share this post


Link to post
Share on other sites
Jason Zelos    211
Rotation was left out of DirectDraw, its supported in hardware by Direct3D or you can do it in software by:


Translate P to origin

for destination Y
for destination X
{
srcX = (X cos(angle) + Y sin(angle)) //I may have got sin &
srcY = (Y cos(angle) - X sin(angle)) // cos mixed up
}

Translate P back from origin


The code only rotates about the origin, so thats why you need the translations. There is an article on this site that''s more in-depth including using bresham''s algorithm to generate rows from two end points.

,Jay

Share this post


Link to post
Share on other sites