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 > FPP Howto: Scale/size/stretch image
2017-03-01 10:11
Dano

Registered: Jul 2004
Posts: 226
FPP Howto: Scale/size/stretch image

I'm currently coding something FPP'ish and i've come to a point where i would like to implement one of the typical FPP Effects - Stretching, turning, flipping, scaling the image like making it taller or small in height or even flipping it down with like "negative scaling".

In theory i would have something like "take like, leave next line, leave next line, take line, .." for squeezing or "take line, take line again, take line, take line again, .." for increasing the height.

Something you could use for f.e. displaying the two faces of a x-rotating cube. Or whatnot else you could use it for.

I've been puzzling, but i could not come up yet with a simple (& fast) approach that not uses different data-tables for different scale-factors and such.

How did you guys tackle this for you FPP-Effect-Stuff, or Zoomers, or....?

Edit: F.e. like so https://www.youtube.com/watch?v=RfZgCzJcyFY&t=682s
2017-03-01 10:20
chatGPZ

Registered: Dec 2001
Posts: 11088
simpliest approach imho: use 16 bit counter, high byte is offset into your texture line table. add small (less than 8 bit) value for each step to zoom, larger values to squeeze. for typical x-rotation thingy, do the same in both directions starting from the mid point.

edit: that said - in many cases its just braindead fiddling with sinus tables (wobbling stretchers etc). you probably want to play around with this too :)
2017-03-01 11:09
Dano

Registered: Jul 2004
Posts: 226
oh thanks. that counter thing reads nice. need to try that out!

as for sinustables i got this pseudocode" from lubber to try out:

*=$4000

:startsinus
				ldx #0
				ldy #0
				
:loop			        lda #0
				sta $d018
				tya
				clc
				adc sinus,x
				sta compare + 1
:compare		        cpy #0
				bne sameval
				inx
			 	inc loop + 1
:sameval
				iny
				bpl loop

				lda #0
				sta loop + 1
				inc startsinus + 1

				jmp startsinus 

*=$4100

:sinus
	.byte 0,1,2,4,8,...  512 values… or double a 256 sinus
2017-03-01 11:46
Oswald

Registered: Apr 2002
Posts: 5007
wobbler:

ldx #00

txa
clc
adc sinus1,x
adc sinus2,x
and #$3f
;got your texture pointer here

inx
cpx #maxlines
bne

could work without txa too, just experiment. good idea to make texture 2^n size so you can just AND it for wrapping.
2017-03-01 15:57
Dano

Registered: Jul 2004
Posts: 226
@Oswald: Such a routine i already had implemented. Plasmatic stuff always works it seems. :)
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
JackAsser/Booze Design
hedning/G★P
Mason/Unicess
Dano/Padua
Brittle/Dentifrice^(?)
kbs/Pht/Lxt
t0m3000/ibex-crew
Guests online: 325
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 No Bounds  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 Party Elk 2  (9.7)
2 Cubic Dream  (9.6)
3 Copper Booze  (9.5)
4 Rainbow Connection  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Onscreen 5k  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Nostalgia  (9.3)
3 Oxyron  (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.053 sec.