Rotations...?

BlitzPlus Forums/BlitzPlus Programming/Rotations...?

elseano(Posted 2004) [#1]
Is it possible to rotate a 2d image in Blitz in realtime without slowdown?


soja(Posted 2004) [#2]
Not without significant workarounds, like using an OpenGL library.


elseano(Posted 2004) [#3]
How would I do that?


Bremer(Posted 2004) [#4]
Its possible at decent framerate if you don't really do nothing else. I have done so in one of my tech demos.

The second last demo on this page: http://zac-interactive.com/page2.html have a 480x480 image rotating and zooming at the same time.

It involves using either arrays or banks and doing a lot of writepixelfast stuff.


elseano(Posted 2004) [#5]
Ok, thanks. Looks really good but a bit too complicated for me...=)
I suppose there's always the method of creating an image with different frames of rotation, and then using LoadAnimImage, etc, but this takes a long time to do by hand.
Does anyone know of a quick way to do this? Some sort of program that can create a bitmap image strip of the same image rotated at 360 different degress...?


Bremer(Posted 2004) [#6]
What do you need it for? And do which version of blitz are you using? If you are using B3D, you could create a sprite and have it rendered first and then your other 2d stuff drawn after that. That way you could easily rotate the image without problems. But that only works for B3D. If you are using B2D or B+, then your only option is either pre-done images rotated and that will take a lot of space, or realtime software rotations, which limits what can be done besides the rotation if its full screen.

Blitz have built in commands for rotating images, check with the manual under the image category. There is also an example of usage there. Its not really useful for realtime graphics, but you could use it to rotate the image when loaded and before you need it, so that you have a number of frames that can be used for animation.


elseano(Posted 2004) [#7]
Yeah, I know. I do have Blitz3d, but I hate a lot of the functions. Also, isn't 2d, in general, a lot faster?


Bremer(Posted 2004) [#8]
No not at all, not for things like rotating images, you could have a fullscreen image rotating on a sprite no problem together with 2D graphics, it all depends on how experienced with bliz3D you are I would think. If you are just starting out then perhaps it isn's something you want to get right into. There are something called spritemaster in the Blitzcoder showcase which is an easier way of doing 3d sprites but with 2d like commands that you might want to have a look at. Its a blitz code lib. that you just include in your code using the "include" command and then you don't have think about the creation of the 3d entities and all that, you can just use the commands that comes with it just like you would your 2d counterparts.