| |
Luca
Registered: Apr 2002 Posts: 178 |
Twister's primer
How to obtain simple/cool/elaborate primer graphics (bitmap) for a general vertical twister effect (let's say simply 3 colours+background colour)? Should I draw'em on PC first, with a 3DMax or similars, then convert'em? Which height in pixels would be enough to smoothly describe and include the whole 360° rotation?
For a very basic one, I could simply draw a slice of column in two colours by drawing them with a sin(x) function, what with more complex stuff? |
|
| |
Luca
Registered: Apr 2002 Posts: 178 |
OMG I've just seen I got zero answers after almost a year, it's a world record, great! :D |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: How to obtain simple/cool/elaborate primer graphics (bitmap) for a general vertical twister effect (let's say simply 3 colours+background colour)? Should I draw'em on PC first, with a 3DMax or similars, then convert'em? Which height in pixels would be enough to smoothly describe and include the whole 360° rotation?
For a very basic one, I could simply draw a slice of column in two colours by drawing them with a sin(x) function, what with more complex stuff?
Depending on the shape of your twister you need different amount of angles to smoothly rotate it. F.e. a cube based needs to rotate 90 degrees before being symmetrical again. Typically u want as many angles as possible, so it's always a trade off between that and loading time / memory usage. One VIC bank can easily contain 256 angles, in three different twister shapes, which should be enough for most applications.
To render a twister, simply use your favorite raytracer or code one on your own.
/JackAsser
|
| |
Twoflower
Registered: Jan 2002 Posts: 434 |
Or pixel it. :-) |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Quoting JackasserOne VIC bank can easily contain 256 angles, in three different twister shapes
Hmm, sounds like a magic formula :), how's that obtained? Of course it depends on how much data each animation needs, easiest case (?) would be 8 stretched sprites, and then you have space for 2 * 256 angles. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Quoting JackasserOne VIC bank can easily contain 256 angles, in three different twister shapes
Hmm, sounds like a magic formula :), how's that obtained? Of course it depends on how much data each animation needs, easiest case (?) would be 8 stretched sprites, and then you have space for 2 * 256 angles.
In that magic lies the limitation that you only show one of the three shapes at any given frame and that you're only using 7 sprites in width (21 bytes).
Sprite offsets 0-20 for the first shape, 21-41 for the second shape and finally offsets 42-62 for the third shape.
But yes, using 8 sprites limits you to only two shapes per sprite. |
| |
Luca
Registered: Apr 2002 Posts: 178 |
Thanks guys, I'll try that.
I would admit I afforded the problem from the wrong side (my difficulties in rendering/converting a primer), instead of facing the code first.
I'm very interest in all the different approaches to twisters: one seems to be a sort of "special plasma", with sintables and all the rest; another one seems to be playing with DMA delay. A good example is the double-twister in Zenith of Puberty on Plus/4, which probably shows both. |
| |
Scout
Registered: Dec 2002 Posts: 1570 |
If you want to know how it is done on a DTV, check the sources of Twistro
There's also an exomized twister bitmap (256x256) which I made in Photoshop.
You can decompress it and load it back as RAW image in Photoshop/GIMP/Paintshop. |
| |
WVL
Registered: Mar 2002 Posts: 902 |
Quote: In that magic lies the limitation that you only show one of the three shapes at any given frame and that you're only using 7 sprites in width (21 bytes).
Sprite offsets 0-20 for the first shape, 21-41 for the second shape and finally offsets 42-62 for the third shape.
But yes, using 8 sprites limits you to only two shapes per sprite.
The all-border sprite zoomer in Pearls for Pigs uses this technique :)
There's 7 sprites on screen, the picture is 64 pixels high and there's 12 different x-sprite sizes for every sprite. These 12 different sizes are made using 256/64 = 4 and I can fit 3 sizes in each sprite (by offsetting in y with 0,7 or 14). 4*3 = 12.
Maybe to explain it better :
If I want to show the full width, i put my sprites at y-offsets of 0,1,2,3,4,5 and 6, and i use sprite-images 0-63 (changing each line) to show the picture. I can also chose 64-127, 128-191 or 192-255, to make all sprites 1,2 or 3 pixels smaller.
If i want to make them 4 pixels smaller, i use offsets 7,8,9,10,11,12 and 13 and sprite images 0-63 again.
Ofcourse the code allows for any combination of y-offsets :)
The fact that you can only have max 7 sprites with sprite-fpp and open border suddenly becomes an advantage, because you can use the memory 3x more efficiently :) |
| |
Mace
Registered: May 2002 Posts: 1799 |
@ WVL: please explain this to me again, on paper, at X-2010 (before we drink beer) ;-) |
| |
Luca
Registered: Apr 2002 Posts: 178 |
Quote: If you want to know how it is done on a DTV, check the sources of Twistro
There's also an exomized twister bitmap (256x256) which I made in Photoshop.
You can decompress it and load it back as RAW image in Photoshop/GIMP/Paintshop.
Thanks Scout, that would be a very good starting point, though I am still not able to understand how to use it (if color infos are not needed, if I have to read it as hires then assign some colours...). |
... 16 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 - Next |