| |
Trap
Registered: Jul 2010 Posts: 223 |
2D Bitmap rotation with interpolation
Hi,
I need subject function. I've been doing some goosearching on the subject but so far I only found algorithms that do not use interpolation. So, can some kind soul please point me in the right direction?
So far I only found rotation by shearing to make interpolation but the algorithm i found is too sketchy for me to be able to convert it to something executable.
thanks
Trap |
|
... 11 posts hidden. Click here to view all posts.... |
| |
Axis/Oxyron Account closed
Registered: Apr 2007 Posts: 91 |
I guess, if quality is the most important goal, the intention was more about making PC-tools to generate animations or tables than realtime rendering. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
scripting a paint editor to rotate a picture can do that |
| |
Axis/Oxyron Account closed
Registered: Apr 2007 Posts: 91 |
Hehe, but scripting a paint editor is half the fun. ;o)
And true, 060 is not fast enough for this. Tried it back in the 90´s. The muls are not the problem. But 060 is slow on memory. So accessing 8 texels per pixel is not a good idea at all. When zooming out or your poly rotates 90° everything breaks down, due to bad cache coherence. |
| |
Shine
Registered: Jul 2012 Posts: 369 |
Maybe offtopic:
FU-Script / GIMP is most powerful! ;) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Quote: Hehe, but scripting a paint editor is half the fun. ;o)
And true, 060 is not fast enough for this. Tried it back in the 90´s. The muls are not the problem. But 060 is slow on memory. So accessing 8 texels per pixel is not a good idea at all. When zooming out or your poly rotates 90° everything breaks down, due to bad cache coherence.
Heh, improved cache coherence is half the reason the memory layout the PS2 uses for texture ram is such a bastard; they interleave the address bits to ensure that neighbouring texels are usually in the same set of cache lines regardless of orientation.
(of course, then they lightly scattered things a little to try and avoid multiple TMUs from trying to read the same word at the same time, but I digress.. Google ps2 texture swizzling if you want to melt your brain) |
| |
Trap
Registered: Jul 2010 Posts: 223 |
Sorry to take this back on to the original subject :)
I am not sure how I should read this. Mind you, I'm not particularly good at math and university was lightyears ago.
So, how exactly do I read this line:
texel = bitmap[(x-cx)*ux + (y-cy)*uy][(x-cx)*vx + (y-cy)*vy];
I believe [] means 'absolute', so unsigned right?
however, I'm not seeing an operator between the two sets of []. I'm guessing this implies something - just not sure what? My guess would be x and y coordinates respectively (of the source bitmap). On track? |
| |
Shine
Registered: Jul 2012 Posts: 369 |
Quoting Trap
So, how exactly do I read this line:
texel = bitmap[(x-cx)*ux + (y-cy)*uy][(x-cx)*vx + (y-cy)*vy];
I believe [] means 'absolute', so unsigned right?
I am unsure right now ... but [][] seems to me like the dimensions of an array (possibly list). |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
In this instance, [] means array access.
so texel[y][x] is like
peek(texture_address+y*texture_width+x)
(assuming one byte per pixel..)
I suspect it was also intended to be
[cy+(x-cx)*ux + (y-cy)*uy][cx+(x-cx)*vx + (y-cy)*vy]
to get a rotation around the centre of the texture. |
| |
Axis/Oxyron Account closed
Registered: Apr 2007 Posts: 91 |
@ChristopherJam: Yes, swizzling or tiling of the texture would have helped on the 060. I think all modern AGA demo-engines do that. I even heard of some S3-style texture compression mappers. |
| |
Trap
Registered: Jul 2010 Posts: 223 |
Thank you all for your help. I believe I have enough to keep me up for the next couple of evenings :)
/Trap |
Previous - 1 | 2 | 3 - Next |