printMatrix, but no getMatrix
in
Programming Questions
•
2 years ago
In summary: printMatrix() works fine with the P2D renderer, but I can't use getMatrix()
At the moment, I have a working version where I have a hashMap of screenX and screenY locations (with the index position in pixels[] for value) which I use to draw onto the sprite when needed. This hashMap gets updated every frame, or everytime the sprite changes positions. Unfortunately, this is too slow for me to put to good use.
So I'd like to do this a different way. Instead of storing the Sprite's real-world pixels in a hashMap, I'll just apply rotations/translations/scaling to the coordinates I'm using to edit the sprite. It'll be as simple as keeping track the applet's matrix at the time of the sprite's drawing, right?
I have one obstacle though. Processing (I'm using the P2D renderer) wont let me use the Matrix. Everytime I call getMatrix(), I get an error.
- getMatrix(), or this particular variation of it, is not available with this renderer.
This confuses me though, because printMatrix() works just fine! Is this an error in P2D? Is it like this for a reason?
Perhaps I'm doing this completely wrong. I'm happy to take an advice regarding this. Thank you for your time.
1