- Joined
- Oct 14, 2021
- Messages
- 25
- Reaction score
- 21
- First Language
- English
- Primarily Uses
- RMMZ
[DUCK] Animation Perspective Fix v1.0
GregorDuckman
GregorDuckman
Introduction
Adjusts the Projection Matrix and Camera Matrix used in Effekseer computations to eliminate the extreme Field of View (FOV) / fisheye effect, so that animations more closely match the top-down / diorama perspective used in stock RMMZ map view and side view battle scenes.
... I'm not sure if a similar fix has been published elsewhere yet, so I made my own!
All screenshots captured on WIN10 PC platform, the plugin is as yet untested on the Android/iOS platforms.
How to Use
The script is a plug-and-play plugin script for RMMZ v1.3.3, though its simplicity could allow it to work with past and future versions and other scripts/plugins, provided they do not alter the Sprite_Animation class or Sprite class hierarchy much. Paste the script below into a file named "[DUCK]AnimationPerspectiveFix.js" and drop it into your project's "plugins" folder, then install and activate using RMMZ's plugin manager.
To obtain the best results, you may need to rotate the stock animations by ~8 degrees in the positive X axis direction ([X:8, Y:0, Z:0] in the RMMZ animation editor). See the screenshots below.
This script contains no parameters or plugin commands.
Screenshots
Consider this screen capture of the "0051 Power up 1" animation in stock RMMZ:

[captured in-editor and stretched 2x]
As the magic circles in the power-up animation rise from the ground, the distortion caused by the stock perspective causes the ring to flatten, and then be visible from below. This is what you'd observe if, for example, you picked a circular object off a table at arms length and raised it above your eye-line. However, the distance on-screen over which this transition takes place only makes sense if the scene is unfolding within an inch or so of your eyes, causing dissonance with the perspective and depth implied by the battleback graphics and enemy/actor placement.

Immediately after installing the plugin, the same animation becomes axially aligned with the screen, so the magic circles only appear as thin lines in the horizontal direction.

By rotating the X axis by about 8 degrees, the magic circles are now in good agreement with the top-down / diorama perspective suggested by the stock graphics. Notice the magic circles and Reid's drop shadow (both of which should be perfect circles when viewed from above) appear as ellipses with roughly the same same eccentricity, as we'd expect of these shapes viewed in the same scene without the prior dissonance.
Terms and Credits
This script is provided "as is" without warranty of any kind. It is free to be copied and used with or without credit to GregorDuckman. The openness of these terms do not extend to any future releases unless specified.
Script
JavaScript:
//=============================================================================
// RPG Maker MZ - [DUCK]Animation Perspective Fix (v1.0)
//=============================================================================
/*:
* @target MZ
* @plugindesc Fixes the extreme FOV/fisheye effect on effekseer animations in
* stock RMMZ.
* @author GregorDuckman
*
* @help [DUCK]AnimationPerspectiveFix.js
*
* Fixes the extreme FOV/fisheye effect on effekseer animations by correcting
* the camera and projection matrices.
*
* No plugin commands are necessary.
*/
(() => {
Sprite_Animation.prototype.setProjectionMatrix = function (renderer) {
const x = this._mirror ? -1 : 1;
const y = -1;
// prettier-ignore
Graphics.effekseer.setProjectionMatrix([
x, 0, 0, 0,
0, -1, 0, 0,
0, 0, 1, -1,
0, 0, 0, 1,
]);
};
Sprite_Animation.prototype.setCameraMatrix = function (/*renderer*/) {
// prettier-ignore
Graphics.effekseer.setCameraMatrix([
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, -100, 1
]);
};
})();
Last edited: