pre-rotate images
Monkey Forums/Monkey Programming/pre-rotate images
| ||
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 |
| ||
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(). |
| ||
since it's 2D-in-3D, rotating images is pretty much "free". the extra overhead of real-time rotation is insignificant. (Unlike in Blitzplus) |
| ||
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. :) |