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

Forums > C64 Coding > FPP Howto: Scale/size/stretch image
2017-03-01 11:11

Registered: Jul 2004
Posts: 105
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 11:20

Registered: Dec 2001
Posts: 8096
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 12:09

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

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


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

				lda #0
				sta loop + 1
				inc startsinus + 1

				jmp startsinus 


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

Registered: Apr 2002
Posts: 4053

ldx #00

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

cpx #maxlines

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 16:57

Registered: Jul 2004
Posts: 105
@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
Users Online
Perff/No Name
Dipswitch/Up Rough
Guests online: 48
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 The Shores of Reflec..  (9.6)
4 Coma Light 13  (9.6)
5 Lunatico  (9.6)
6 Comaland 100%  (9.5)
7 Incoherent Nightmare  (9.5)
8 Wonderland XII  (9.5)
9 Comaland  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.5)
2 Daah, Those Acid Pil..  (9.5)
3 Treu Love [reu]  (9.4)
4 Dawnfall  (9.3)
5 SidRok  (9.3)
6 Achtung 5 Years Mayd..  (9.2)
7 One-Der  (9.2)
8 Tunnel Vision  (9.2)
9 Globe 2016 [reu]  (9.1)
10 Safe VSP  (9.1)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.4)
3 Oxyron  (9.4)
4 Crest  (9.3)
5 Arsenic  (9.3)
Top Cover Designers
1 Duce  (9.8)
2 Electric  (9.8)
3 Junkie  (9.7)
4 The Elegance  (9.4)
5 Cuc  (9.2)

Home - Disclaimer
Copyright © No Name 2001-2017
Page generated in: 0.277 sec.