Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
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: 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....
 
2015-07-30 06:49
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.
2015-07-30 06:59
Oswald

Registered: Apr 2002
Posts: 5094
scripting a paint editor to rotate a picture can do that
2015-07-30 07:18
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.
2015-07-30 07:34
Shine

Registered: Jul 2012
Posts: 369
Maybe offtopic:
FU-Script / GIMP is most powerful! ;)
2015-07-30 08:13
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)
2015-07-30 08:25
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?
2015-07-30 08:35
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).
2015-07-30 08:35
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.
2015-07-30 17:21
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.
2015-07-30 21:52
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
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
E$G/HF ⭐ 7
Mason/Unicess
Smasher/F4CG
algorithm
acrouzet/G★P
csabanw
Guests online: 103
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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