pre-rotate images

Monkey Forums/Monkey Programming/pre-rotate images

Tank(Posted 2014) [#1]
Hi,
Looking forward to trying Monkey.
I'm trying to convert a game I wrote in BlitzPlus.
Played around with most of the demos.
I can't find how to pre-rotate the images

This is the old BlitzPLus code to get 360 images of pre-rotated tanks.
num_rots=360
For k=0 To num_rots
TankImage(k)=CopyImage(gfxtank)
RotateImage TankImage(k),k
Next

Thanks
Dan


Gerry Quinn(Posted 2014) [#2]
I don't think you should generally be pre-rotating images these days. In most cases the graphics card will rotate them fine, and in some cases there will be memory issues. You'd only pre-rotate on a target with a ton of memory and no card support (Flash?).

If you must do it, look up ReadPixels() and WritePixels().


xlsior(Posted 2014) [#3]
since it's 2D-in-3D, rotating images is pretty much "free". the extra overhead of real-time rotation is insignificant.
(Unlike in Blitzplus)


consty(Posted 2014) [#4]
Yes, because in OpenGL you can do geometric transformations with matrices, for example since a sprite has 4 vertices it's easier to rotate the sprite ASAP rather than have lots of texture frames. Technically you can have these frames and do the work, but it's not that is the preferred way to do so.
:)