Ok i want to rotate the image in the backbuffer around a center point. Is this possible? This is used for a game where they player does not move but the world must rotate.
rotating the entire screen.
BlitzMax Forums/BlitzMax Beginners Area/rotating the entire screen. Doesn't the rockout game in the samples\hitoro folder do just that?
I looked through that and couldn't find how he was rotating the background.
setRotation
Then Redraw the backbuffer
Or if you are already useing Setrotation then SetRotation Whatever other rotation you have+ScreenRotation
Then Redraw the backbuffer
Or if you are already useing Setrotation then SetRotation Whatever other rotation you have+ScreenRotation
Do you mean
My main problem is that all my images are being rotated and drawn wrong the screen appears to be rotated but the images are incorrectly positioned. They appear to retain their x and y positions but the images ARE rotated.
setrotation(angle) flip
My main problem is that all my images are being rotated and drawn wrong the screen appears to be rotated but the images are incorrectly positioned. They appear to retain their x and y positions but the images ARE rotated.
No, what I mean is
Setrotation Whatever
DrawDackground
Setrotation 0
Do your other drawing
Flip
(If thats what you have done then yes I mean that) it rotates it all round 0,0 though)
Setrotation Whatever
DrawDackground
Setrotation 0
Do your other drawing
Flip
(If thats what you have done then yes I mean that) it rotates it all round 0,0 though)
I don't have any external images or backgrounds. I'm only saving to the backbuffer. These images are rectangles and lines. I need to rotate the whole backbuffer after it contains all the image data. Sorry to be a burden...
You dont need to rotate the backbuffer after it contains all the image data. You could, as Ive suddjested Rotate all the drawing to the backbuffer.
If you really want to do it after, grab the whole backbuffer as a Image, cls, setrotation, then draw the image back to the backbuffer
If you really want to do it after, grab the whole backbuffer as a Image, cls, setrotation, then draw the image back to the backbuffer
If you really want to do it after, grab the whole backbuffer as a Image, cls, setrotation, then draw the image back to the backbuffer
This will be way to slow, some cards it takes 300ms to grab the backbuffer. Anyway will SetOrigin help you? or SetHandle?
Jupp, set origin to the middle of the screen if you want to rotate around the middle and then call setrotation to rotate the whole screen.
If you have lots of objects in your world drawn on top of this background and you want them all to rotate with the background, then you would do well to purchase my sprite system. It handles this sort of thing wonderfully through a robust parent-child system. You could even scale the background to zoom in on everything.
The only limitation with it is that you won't get the results you expect if you rotate a sprite and then scale the background non-uniformly, meaning more on the Y axis than the X axis for example. But as long as you scale the background uniformly you can still rotate and scale the sprites on it non-uniformly.
Of course there may be ways to do this in OpenGL directly, but then you're limited to using OpenGL. Copying the screen to a buffer is a bad idea because it is slow.
The only limitation with it is that you won't get the results you expect if you rotate a sprite and then scale the background non-uniformly, meaning more on the Y axis than the X axis for example. But as long as you scale the background uniformly you can still rotate and scale the sprites on it non-uniformly.
Of course there may be ways to do this in OpenGL directly, but then you're limited to using OpenGL. Copying the screen to a buffer is a bad idea because it is slow.
Use opengl + apply rotation to the projection matrix..
- you will need to restore it once your done rotating..
yes, you would be limited to gl doing it like this, although
you could probably write a dx equivalent..i cant remember
the specifics of matrix coding in dx..then again gl is cross
platform, and most cards/drivers support gl...
- you will need to restore it once your done rotating..
yes, you would be limited to gl doing it like this, although
you could probably write a dx equivalent..i cant remember
the specifics of matrix coding in dx..then again gl is cross
platform, and most cards/drivers support gl...