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 11:11
dano

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

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

Registered: Jul 2004
Posts: 108
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 12:46
Oswald

Registered: Apr 2002
Posts: 4065
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 16:57
dano

Registered: Jul 2004
Posts: 108
@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
Fred/Channel 4
Squad333
Guests online: 35
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 Lunatico  (9.6)
6 Comaland 100%  (9.5)
7 Incoherent Nightmare  (9.5)
8 Quad Core 100%  (9.5)
9 Wonderland XII  (9.5)
10 Comaland  (9.5)
Top onefile Demos
1 Pandemoniac Part 2 o..  (9.6)
2 Field Sort  (9.6)
3 Dawnfall V1.1  (9.5)
4 Daah, Those Acid Pil..  (9.5)
5 Treu Love [reu]  (9.4)
6 Dawnfall  (9.2)
7 Veterans of Style  (9.2)
8 KAOS 64  (9.2)
9 One-Der  (9.2)
10 Game of Thrones [2sid]  (9.2)
Top Groups
1 Blazon  (9.5)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Oxyron  (9.4)
5 Crest  (9.3)
Top Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Carrion  (9.7)
4 Veto  (9.7)
5 DocJM  (9.7)

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