🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Help with 2D sprite rotation
I am currently programming a 2D over head race car game and I want the car to turn at corners of the road. However I do not know how to rotate my sprites. I am using a 16x16 sprite for the vehicles and wanted to what the fasted method was for rotating them without loosing quality. Will I need extra space rather than 256 bytes in the sprites will I need more for the rotated sprite.
Thanks in advance
Dark Star
You can rotate the sprites using Blt() if you use the
DDBLT_ROTATIONANGLE flag and specify the angle in the DDBLTFX struct.
DDBLT_ROTATIONANGLE flag and specify the angle in the DDBLTFX struct.
Why don''t you take your car image and use PSP or some other graphic program to rotate your car as separate graphics? You wouldn''t need too many files to get it to look good, and the speed you save by making more files will more than pay for the small increase in memory use.
DDBLT_ROTATIONANGLE only works if the hardware supports it.
Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Since most legacy hardware do not support bitmap sprite rotation in DirectDraw. You might want to try using Direct3D to fit the sprite in as a texture before rotating it - this had the advantage of software support.
Best regards,
Sherman
Best regards,
Sherman
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement