Advertisement

Rotation

Started by January 15, 2000 03:01 PM
2 comments, last by Fresh 25 years, 1 month ago
I am designing a 2D game using directdraw. It is in an overhead view and therefore needs to show characters turning in all directions. In my previous games the animation was fairly simple, ie. 2-3 frames for walking. This meant that to let the character turn in 360 degrees I could manipulate the images myself and turn them in 9 degree increments which gave 360/9 * 3 = 120 frames. However, in this game I wanted to have better animation – now I have 10 frames for animation and individually rotating each frame by nine degrees would mean too many to do by hand. Therefore I was wondering whether I could just load the 000 degree into the game and rotate the rest on initialisation by the software. I first tried to use the rotationangle variable of the ddbltfx struct but it returned norotationhardware. Have I missed something here or is directx meant to emulate missing hardware features? So can somebody tell me what the best way to proceed would be and how to go about it? Thnx
Sorry but rotation with ddbltfx only works if the hardware supports it, it won''t emulate it.

The best way to solve the problem is to write your own code (or copy somebody elses) to rotate your graphics when the game loads and store them on a surface, this means you don''t have to rotate during the game which could cause a big speed drop.

You could also draw just the first 90 degrees and then flip the images horizontally and vertically to get the rest, this can be done fast so you could use it at run time without too much speed loss.
----------------
Black Edge Games
----------------
Advertisement
*Nod* - I can you point me to some place where I might find some rotational algorithms which will do the biz?

(and how to use em :?)

Edited by - Fresh on 1/16/00 4:55:52 AM

I have a rotation algarithem. I don''t know how good it is, but I believe that it''s fast enough to get the job done. Email me if you want it. Mike010@netZero.net

This topic is closed to new replies.

Advertisement