# Is it possible to rotate an array?

### » Sat Jul 30, 2011 10:39 pm

[QUOTE=tulamide] [QUOTE=Arsonide] [QUOTE=newt]Btw I think "S" has a built in function to rotate its arrays as well.[/QUOTE]

I thought something did, but I couldn't remember what. I think it was S.[/QUOTE]

Again, I'm sorry, but this is not quite right. The function indeed is called rotate array, but it shifts a 1-dimensional array to the right or to the left (aka the equivalent to moving, not angular rotation), so

ABCD

rotated by 1 gets

DABC

or rotated by -1 gets

BCDA[/QUOTE]

Ahh well thats ok. Thats the only type of array I can do in S :P

[QUOTE=tulamide]Also, when using any free rotional functions, wether from 's' or just sin/cos, you can't make sure you will always keep all values on the grid (because of the rounding, that needs to be applied), leading to overwriting or doubling values.
[/QUOTE]
True, but once it gets to 90 degrees it should line back up, shouldn't it?
B
178
S
50
G
206
Posts: 8,688
Reputation: 127,719

### » Sat Jul 30, 2011 10:42 pm

[QUOTE=newt]
True, but once it gets to 90 degrees it should line back up, shouldn't it?[/QUOTE]
Yes, matrix rotation in 90 degree steps will work perfectly.

(as well as 180, 270, 360, etc.)tulamide2011-07-30 22:42:45
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,289

### » Sat Jul 30, 2011 10:55 pm

Well the idea was for extra effect showing it rotate, but I get the feeling this is for an editor, so the extra steps would be pointless.
B
178
S
50
G
206
Posts: 8,688
Reputation: 127,719

### » Sun Jul 31, 2011 12:21 am

You mean something like that?

http://www.mediafire.com/file/1lmfgk4sfqpuhj7/rotatingsprites.cap

(Was too lazy to do ccw and omitted the array, which is a simple task to add now)
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,289

### » Sun Jul 31, 2011 5:34 am

Yep, pretty much, the center around instance version.
B
178
S
50
G
206
Posts: 8,688
Reputation: 127,719

Previous