Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbitrary Sprite Transformations #185

Open
avivbeeri opened this issue Mar 6, 2021 · 5 comments
Open

Arbitrary Sprite Transformations #185

avivbeeri opened this issue Mar 6, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@avivbeeri
Copy link
Collaborator

DOME supports rotation (in 90 degree increments) and integer scaling, but I'd like to allow for arbitrary transformations (including skews and full 360 degree rotations).

This will matter more to people operating at higher resolutions. It's also essential that it be as performant as possible.

@avivbeeri avivbeeri added the enhancement New feature or request label Mar 6, 2021
@benstigsen
Copy link
Contributor

I'm assuming that SDL2 has some function already available for this already?

@avivbeeri
Copy link
Collaborator Author

It does, but DOME doesn't use any of SDL's graphics routines so it doesn't directly help us.

@benstigsen
Copy link
Contributor

benstigsen commented Mar 6, 2021

Okay, I can take a look at this if you want me to (?), I can then write about it in more detail if I figure something out and perhaps open up a PR.

@avivbeeri
Copy link
Collaborator Author

You are certainly welcome to. Some fresh eyes are always appreciated.

I toyed with a few approaches to this before DOME hot 1.0, they are sitting on the "basis" and "rotate" branches, but it's definitely not in a workable state at the moment.

@benstigsen
Copy link
Contributor

Hmm, I've taken a look at it, and with the 90 degrees it seems simple enough. But not sure what the math would be to calculate the new position rotated n degrees. Perhaps this works: https://stackoverflow.com/questions/26007202/calculate-new-point-offset-based-on-angle-of-rotation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants