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: 234
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: 11386
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: 234
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: 5094
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: 234
@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
wacek/arise
t0m3000/hf^boom!^ibx
Guests online: 94
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 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (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 NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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