How to turn (rotate) an entire viewport ?

BlitzMax Forums/BlitzMax Programming/How to turn (rotate) an entire viewport ?

semar(Posted 2010) [#1]
All,

so far I've not found such a command for a viewport. My goal is to rotate all the sprites (e.g. images) I have on a viewport, around the viewport center, like a rotating starfield.

I guess that the command "Origin" can be useful in this field.

Your thoughts ?

Sergio.


slenkar(Posted 2010) [#2]
http://www.blitzbasic.com/Community/posts.php?topic=90436


_Skully(Posted 2010) [#3]
Does that work with the new DrawSubImageRect commands?


semar(Posted 2010) [#4]
Thanks for the answers so far.

Cheers slenkar, I'll try the link you provided.

Sergio.


Oddball(Posted 2010) [#5]
_Skully wrote:
Does that work with the new DrawSubImageRect commands?
It should work seamlessly with DrawSubImageRect. If it doesn't it's a bug so let me know and I'll fix it pronto. Cheers.


semar(Posted 2010) [#6]
Hi Oddball, nice module, thanks.

A question. How does SetScreenRotation work together with SetRotation ?

I mean, why if I do SetScreenRotation rot+90, and then SetRotation rot+90, I get the text not rotated, while if I don't the SetRotation, it does rotate ?

Does the SetRotation eliminate the effect from SetScreenRotation ?

I don't get it really. Could you please elaborate ?

Anyway, great work as usual Oddball :)

Sergio.


Oddball(Posted 2010) [#7]
If you rotate the screen and an image, or text, at the same rate then they rotate in unison, meaning it will not appear, visually, to be rotating. Just imagine SetScreenRotation to be rotating the camera and SetRotation to be rotating the objects being filmed.