Java image rotation für animation?
Hallo ich arbeite zur zeit an einem kleinen 2D game und meine frage ist folgende…ich möchte gerne wenn ich angreife die waffen animation daraus besteht dass die waffe in gewählter richtung ( left, right) die waffe schwingt…also nur das bild der waffe die eben von aufrecht ca 90° in diese richtung rotiert dass dadurch quasi eine schlag bewegung erzeugt wird…wie mache ich das am besten?
1 Antwort
Am besten mit internen API-Funktionen.
Ansonsten kannst du aber eine Rotation durch zwei Shear-Operationen darstellen. Du stellst erst einmal sicher, dass das Output-Bild genügend Platz hat, dannach führst du die zwei Shear-Operationen aus.
Siehe z.B.:
https://www.ocf.berkeley.edu/~fricke/projects/israel/paeth/rotation_by_shearing.html
https://delta.cs.cinvestav.mx/~mcintosh/oldweb/camex/node37.html