Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > 2D Bitmap rotation with interpolation
2015-07-28 10:27
Trap

Registered: Jul 2010
Posts: 222
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....
 
2015-07-30 06:49
Axis/Oxyron

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.
2015-07-30 06:59
Oswald

Registered: Apr 2002
Posts: 5017
scripting a paint editor to rotate a picture can do that
2015-07-30 07:18
Axis/Oxyron

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.
2015-07-30 07:34
Shine

Registered: Jul 2012
Posts: 327
Maybe offtopic:
FU-Script / GIMP is most powerful! ;)
2015-07-30 08:13
ChristopherJam

Registered: Aug 2004
Posts: 1370
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)
2015-07-30 08:25
Trap

Registered: Jul 2010
Posts: 222
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?
2015-07-30 08:35
Shine

Registered: Jul 2012
Posts: 327
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).
2015-07-30 08:35
ChristopherJam

Registered: Aug 2004
Posts: 1370
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.
2015-07-30 17:21
Axis/Oxyron

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.
2015-07-30 21:52
Trap

Registered: Jul 2010
Posts: 222
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
hedning/G★P
Mason/Unicess
kbs/Pht/Lxt
CA$H/TRiAD
megasoftargentina
sailor/Triad
goerp/F4CG
celticdesign/G★P/M..
Airwolf/F4CG
rexbeng
DKT/Samar
Guests online: 76
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 Wafer Demo  (9.5)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Onscreen 5k  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Graphicians
1 Sulevi  (10)
2 Mirage  (9.8)
3 Lobo  (9.7)
4 Mikael  (9.7)
5 Archmage  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.05 sec.