How to rotate square part of a pixmap 45 degrees?

BlitzMax Forums/BlitzMax Beginners Area/How to rotate square part of a pixmap 45 degrees?

Abomination(Posted 2008) [#1]
My question is (as the title may suggest); How does one rotate a square part of a pixmap 45 degrees?
I would also like to know how to rotate it 315 degrees. So The part can be turned back again.
The square would have a width and Height of 64 pixels.
I need something like this to create a seamless isometric tile from non tiling images.
[EDIT] oh yes; the square to rotate 45 stands on its tip, while the square to be rotated 315 stands on its side. [/EDIT]


Jesse(Posted 2008) [#2]
there is no build in instruction to rotate a Pixmap. you can do it through an image.
steps:
copy/convert pixmap to image
setrotation to 45
draw the image to screen:
grab rotated image from screen as pixmap

you need to use these commands:
loadimage - to convert pixmap to image
grabpixmap - to grab the pixmap from the screen


ImaginaryHuman(Posted 2008) [#3]
Also search the forums for the pixmap rotation code that I posted.


Yan(Posted 2008) [#4]
Here's some ancient B2D code, should be easy enough to adapt for your needs...


Abomination(Posted 2008) [#5]
@ Jesse
I Forgot to mention that I want to do this in MAxGui, so I suppose I can't do that?
@ ImaginaryHuman
I tried to follow what was going on in this thread: http://www.blitzbasic.com/Community/posts.php?topic=73042#816898
Don't know if this was the code You mentioned, but I was lost in so many ways, I just gave up.
@ Yan
Yes; that looks very adaptable. At least I think I can follow the flow.

Everybody: Grouphug!


ImaginaryHuman(Posted 2008) [#6]
Yes that's the one.


Jesse(Posted 2008) [#7]
Follow my signature link, I have an antialias pixmap rotating code you can try.


Abomination(Posted 2008) [#8]
Boy! am I out of my element!
I think I can understand about a third of all this pixel-juggling.
But perhaps that's enough to use some of it for my seamless isometric tile code.
Though I wish I could do without rotating the texture, because of the morphing I think will occur when I tilt the seamless tile back on its tip.
But I only know how to make a normal tile seamless, not one that's rotated 45 degrees.
_____________________________________________________________
"enough!" "let's work!" "where's my thinking cap!"
~it's in the well master~
"how did it get there Thar?"
~I dropped it master~
"did you wear the cap at that time Thar?"
~no master~
"AH!"
________from 'Thar's lonely quest' by Mark Hellmson_________


Jesse(Posted 2008) [#9]
save yourself some head aches and rotate all of your images in a paint program and save them rotated.


Abomination(Posted 2008) [#10]
heh; can't do that!
It would make it easier to make it seamless, but the isometric tiles I need,
will be not perfectly centered to the texture, but 1 pixel shifted to the right.
So I need to be in more control, than I would have to be if they were regular tiles.
But no sweat; I think I will get there, If I use the code you suggested as a guideline.
____________________________________________________________
"oh traveler, why are you so sad?"
~I am very tired, for I have walked for three days, without food nor water.~
"but cool water flows under the bridge you crossed and succulent fruit grows in this tree you sit under."
~ah, a tree you say.~
________from 'Thar's lonely quest' by Mark Hellmson_________