Rotation

BlitzMax Forums/BlitzMax Beginners Area/Rotation

Mordax_Praetorian(Posted 2006) [#1]
I have totaly failed at understanding how Rotation in BMax works

From what I could tell, using SetRotation would rotate all images drawn after that point, however, SetRotation appears to do absolutly nothing, I figured maybe I had to reload the images I wanted to rotate, like with SetMask, but this didnt work either


smilertoo(Posted 2006) [#2]
it does what it says, everything will be drawn rotated until another setrotation command is given.


GfK(Posted 2006) [#3]
It works fine here - maybe you're feeding it a float between 0 and 1, where you should be using an angle measured in degrees?


Dreamora(Posted 2006) [#4]
SetRotation changes the rotation of all following drawimage commands, thats correct. BUT: the angle you set is absolute, not relative to their previous angle, so if you want have a changing angle you need to have a variable that you raise.

SetRotation rotates the images around their handle which normally is the top left corner.

You don't need to reload or anything else.


Mordax_Praetorian(Posted 2006) [#5]
but it isnt, I've tested!

TestImage = LoadImage("TS/Arrow.png")
Graphics 800,600
DrawImage TestImage, 1,1
Flip
Delay 1000
SetRotation (90)
Cls
DrawImage TestImage, 1,1
Flip
Delay 1000


After 1 second the screen goes black

aparently, SetRotation is causing DrawImage to do nothing


Mordax_Praetorian(Posted 2006) [#6]
OMG I'm so stupid, the image was rotating off the screen

If I didnt beleive it would send me to hell, I would go and hang myself in stupidity right now


Dreamora(Posted 2006) [#7]
That code can't work.

You have to FIRST call graphics and load media afterwards. Graphics cleans all graphic data.


Mordax_Praetorian(Posted 2006) [#8]
Aparently Graphics doesnt clean all graphics data as the image still worked, but the problem is fixed at any rate


GfK(Posted 2006) [#9]
That code can't work.
Yes, it does work.

You have to FIRST call graphics and load media afterwards. Graphics cleans all graphic data.
Not the case with DX or GL - try it and see.


Jesse(Posted 2006) [#10]
I have done that in several ocations but I did noticed that on some graphics cards with certain resolution the image gets distorted. now to play it safe, first I call the graphics command. And maybe that got fixed with the newest version of BMAX.