ROTOZOOMANIM Zoom BUG (again)

Previous topic - Next topic

Hark0

Hi! I just downloaded and test on GLBasic 11.414 Beta.

Using this function:

ROTOZOOMANIM num,anim,x,y,angle,factor_size_zoom

I set factor_size_zoom to 2. The anim are 20x20 px each tile...

You can show the bug in the attached png...

I mark in red the incorrect zoomed pixels... look at center of eye monster... I mark lines to show the incorrect aspect zoom...

:blink:

TIA!
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Marmor

What device ?
Maybe its a driver issue.
I think its better to make a little demo for,
so we can test it with your source.

Mfg

bigsofty

Yup, stick a little demo in please.   ;)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

spacefractal

if you dont use rotation, its better and more precision to use POLYVECTOR instead. Its property mightbeen a floating point error.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

Could it be because of the rotation part(even if it is not rotated) and the 20x20 sprite (no center pixel)?
Would zoomsprite do it correctly?

But hey, is that part of electric rpg?
I´m in hopes you get back to it as it is marvellous! :good:

I tried doing a couple levels here, it is all really slick!
Cheers Harck0!

Hark0

Quote from: Marmor on 2013-Aug-13
What device ?
Maybe its a driver issue.
I think its better to make a little demo for,
so we can test it with your source.

Mfg

Tried on:
-win 7 64 bits, raedon video card.
-win xp sp3, vmware macos.
-win xp, virtualbox macos.
-virtualbox win 7.
-macos on MBP.
-ipad 1.
-ipad 3.
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Hark0

Quote from: spacefractal on 2013-Aug-13
if you dont use rotation, its better and more precision to use POLYVECTOR instead. Its property mightbeen a floating point error.

Well... I use ROTOZOOMANIM but only the ZOOM function...

Anyway to make zoom for anims?

Can you post a small source for zoom anim tile to 2x or 4x zoom pixels, WITHOUT any kind of "halo/blur"...?
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Hark0

Quote from: bigsofty on 2013-Aug-13
Yup, stick a little demo in please.   ;)

Hi, the snapshot is the "demo"... I not have any video... :-[
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Hark0

#8
Quote from: erico on 2013-Aug-13
Could it be because of the rotation part(even if it is not rotated) and the 20x20 sprite (no center pixel)?
Would zoomsprite do it correctly?

But hey, is that part of electric rpg?
I´m in hopes you get back to it as it is marvellous! :good:

I tried doing a couple levels here, it is all really slick!
Cheers Harck0!

Well, I'm currently thinking about this, the correct size of the tile... 20x20px...

I no need any type of rotation just only zoom... initially I make the tiles of the program with draw rectangles of 2x2px (I have my own rotine for paint "megapixels")... and reading datas.

Due the changes that I make on my set of anims/tiles... I prefer to Load anims...

. . .

About the game... this title are called "Path_RPG", and are a "cousin" of Electric RPG (currently rewrited by zero with more optimized speed/code and.... frozed on my HDD)...

Path_RPG are a minimalist RPG style game... and use the the set graphics of his "uncle", Electric RPG...

The game are finished... just balancing enemy atk/def, make new items for hero... and design levels, levels, levels...


Post on my blog about Path_RPG (picture basically):

http://litiopixel.blogspot.com.es/2013/05/bocetos-para-un-gameplay.html
http://litiopixel.blogspot.com.es/2013/05/del-papel-la-pantalla.html
http://litiopixel.blogspot.com.es/2013/07/del-ordenador-al-ipad.html
http://litiopixel.blogspot.com.es/2013/07/a-por-la-rutina-de-combate.html

;)
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

erico

#9
Oh heck, I forgot there is no zoomanim command! ;/

But you could give a try on a very small example with zoomsprite only just to check if that aberration happens.
I did a bit of it a long time ago, no blur no effects, pure square pixels and IIRC it worked as expected.

You could also try rotozoomanim on a 21x21 tile just to check too.
If it works out, maybe adding a pure transparent line to the lower and right part of the sprites on your anim sheet?

Anyway, If what you reported is a constant, I think it is a bug, maybe a zoomanim command without the rotation part could come handy and not give much trouble to Gernot to implement.

Hark0

#10
Hi @erico, thanks for your anwers.

Yes! I think to add 1 or more pixels... maybe 32x32 are the size final for the tile. I just add some transparent color like 255,0,255 ;)


Same as you, I think a NEW function called ROTOANIM are very easy to add by Gernot ;)

About test with zoomsprite, I initially the app using one sprite of each category (enemy, hero, items...)... In these stage of the development I only have "cube" tiles, not the designed sprites.

I just make a test with zoomsprite and post results here :good:

Cheers from Cornella, Barcelona.


EDIT: Formal petition of the func... http://www.glbasic.com/forum/index.php?topic=9403.0
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

erico

Nice!

But while usign ROTOZOOMANIM, try it with an even number so you have a general central pixel, like 21x21 or 33x33.
Maybe (in my mind) the internal rotation code takes that into account and gets some garbage pixel when dealing with no-central picture image. Even if you are only using the zoom part. It is a theory, I will give a try later today as I finish work.

Hark0

#12
The curious think is  Im are using some anims with 13 or 14 tiles... Only happens in two tiles.

hmmm and thinking about sizes... I read the recomendation for divide by 2 image size in some docs...

Good sizes:
8x8, 16x16, 32x32, etc....
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

MrTAToad

Have you tried SMOOTHSHADING FALSE and made sure anti-aliasing in your graphics drivers are deactivated.

erico

IMHO
Don´t worry about the divided by 2, that I guess is only for heavy load games.

What I suspect, is that is an issue with the nearest neighbor routine when doing zoom and rotation.
We got that on Deluxe paint and we have it going on photoshop nowadays.
It is a fast routine, not perfect, so to feed it correctly there must be a central pixel, so it divides the image into 4 zones to produce the operation.
No central pixel, you get garbage or it kills some line.

I have that issue when working with photoshop, even when using x2 stuff.
Since it is open gl and GLB is open gl, I suspect it feeds on similar source.
It is a fast routine though. :)

My babling is not GLB related but a theory, I would have to test to figure it out, but my work programs respond the exact same way as your original post, hence the reason I correlate the facts. I could be deadly wrong. ;/

It is late today and I have seen to much computer work stuff :(
Will do some testings tomorrow.