Spirals and warping a 32x32 grid

Previous topic - Next topic

r0ber7

Hi there.

During my quest to warp a 32x32 grid for my game, I figured out how to draw spirals. If I want to warp the grid, I'll have to stretch the polygons to a logarithmic spiral. Anyway, I haven't figured out the grid warp yet, but I had so much fun creating this spiral I wanted to share it with you anyway.



If you want to see it swirl around you can download the source here. Pressing the up arrow resets the spiral.

If I succeed, the example code for the grid warp will be posted in this thread too.

r0ber7

#1
Ok, I've got a grid warp now. It's not exactly what I had in mind, but it's a spiral warp of a grid anyway, so I'll post it here. Gotta test it out in the game to see if it looks right for a black hole spell.



Get source here.

Warp the grid by pressing the up and down arrows. Reset with left arrow.

No attempt has been made to clean up, or make readable, the sourcefile.

r0ber7

I've got it figured, the grid warp is now how I want it to be.



Code here.

Press up arrow to rotate the spiral.

Ian Price

I came. I saw. I played.

Hatonastick

Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Crivens

Nice! Download links seem to be broken though...

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

r0ber7

Quote from: Crivens on 2011-Nov-25
Nice! Download links seem to be broken though...

Cheers

Oops, sorry. Cleaned up the server. It's back on there.