GregorDuckman

Villager
Member
Joined
Oct 14, 2021
Messages
22
Reaction score
18
First Language
English
Primarily Uses
RMMZ
[DUCK] Animation Perspective Fix v1.0
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:

ani_1stock.png
[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.

ani_2direct.png

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.

ani_3tiltedX.png

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:

LuLight

Veteran
Veteran
Joined
Oct 20, 2015
Messages
35
Reaction score
4
First Language
Thai
Primarily Uses
RMMZ
Good job, keep going.
 

GregorDuckman

Villager
Member
Joined
Oct 14, 2021
Messages
22
Reaction score
18
First Language
English
Primarily Uses
RMMZ
Good job, keep going.
Thanks! I'm thinking of making a more full-featured plugin that can load the camera settings files produced by the effekseer program so animations will look exactly as they do (or as close as possible to) in the effekseer editor.
 

Latest Threads

Latest Profile Posts

Well turns out I'm not going to the fair... COVID cases way too high in my state. Instead I'll just go to Chuck E Cheese's and transfer all my tickets from Orlando to my normal PlayPass wristband.
NV4LMYs.gif

New UIs

The Sinners who Never Sinned thread has been approved by the moderators! Thank you so much!
:ewat:

index.php
I oughta set up my itch.io, but I'm like, uugghhh I DON'T WANNA. :kaocry: Why does errything feel like such a chore right now? I don't wanna just complain tho, so y'all got any hot tips for how to make a really pretty, sexy, sweaty, flowery itch.io page? BEST TIP WINS. :kaoluv:

Also here's a beautiful nymph to liven up the day for y'all! (No it's not me.)

alice_nymph(old).png
Hello again, guys! Today, I come to you with not one, not two, but THREE new emotion busts for Ramona!
RAng2FPS.gifRAng5FPS.gif
Anger

RWin2FPS.gifRWin5FPS.gif
Wink

RCry2FPS.gifRCry5FPS.gif
Crying

Forum statistics

Threads
118,757
Messages
1,118,472
Members
155,907
Latest member
valdemar
Top