Log In  

Cart #rotatespritewip-0 | 2022-09-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


I'm trying to rotate a sprite from the sprite sheet, and I think I'm semi successful.
The problem I have been noticing is that when the sprite is turning it will have holes in the drawing, no matter which sprite it is. I think what is happening is that it's rounding of the coordinates to the closest, and this sometimes draws two pixels on top of each other. At least that's what I think is happening.
In what way do you typically solve this? Draw a color in the blanks that is a close match, or like a background color?
Can you cleverly ensure that pixels never get's drawn on top of each other?

P#116975 2022-09-06 17:51

sprite rotation is better done with tline than pset: https://www.lexaloffle.com/bbs/?tid=38548

P#116986 2022-09-06 18:36

@merwok ok I will have to try that out. Is there any way you could do it the way I am, changing the angle pixel by pixel?
This cart uses pset rather than tline and does not have the same issue as me: https://www.lexaloffle.com/bbs/?pid=52525
I'm understand that there might be good reasons to use tline, but this is really just a curiosity of what I'm doing wrong.

P#116988 2022-09-06 18:45

in theory your method could work.
on a real computer, numeric errors, the fact that a scren pixel has a surface will make it impossible to achieve without gaps.

the trick is to start from screen rows (or columns) and find out what color it should be (not from texture rows and trying to fit them on screen)

P#116990 2022-09-06 19:50

[Please log in to post a comment]