Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums

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

Registered: Jul 2004
Posts: 131
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

Registered: Dec 2001
Posts: 8517
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

Registered: Jul 2004
Posts: 131
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 11:46

Registered: Apr 2002
Posts: 4233

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

Registered: Jul 2004
Posts: 131
@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
Knight Rider/Excess
Xiny6581/Dees Produc..
Guests online: 33
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 The Shores of Reflec..  (9.6)
5 Comaland 100%  (9.6)
6 We Come in Peace  (9.6)
7 Lunatico  (9.6)
8 Incoherent Nightmare  (9.5)
9 Wonderland XII  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.5)
2 Pandemoniac Part 2 o..  (9.5)
3 Daah, Those Acid Pil..  (9.5)
4 Dawnfall V1.1  (9.5)
5 Treu Love [reu]  (9.5)
6 In Memoriam BHF  (9.5)
7 Merry Xmas 2017  (9.4)
8 Dawnfall  (9.4)
9 SWiRL  (9.4)
10 Synthesis  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.4)
5 Crest  (9.3)
Top Hardware-Gurus
1 Soci  (9.9)
2 Wiesel  (9.9)
3 Grue  (9.8)
4 Zer0-X  (9.8)
5 Lemming  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.052 sec.