Rolling models become elongated

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Rolling models become elongated

Post by Ed the Bat »

This may possibly also apply to pitch, as well as roll, but the example I encountered best demonstrates roll. When a 3D model is rolled, it becomes longer than it should, depending on how vertical it is.

In the attached example, the player will begin in front of three SPAS-12 shotguns. The one on the left is flat on the floor, and looks normal by all accounts. The one in the middle is standing at a steep vertical angle. This was achieved with a second .md2 model that was re-positioned in a model editor, but is otherwise identical to the .md2 used by the first shotgun. This shotgun looks correct.

On the far right is a third shotgun. It begins flat on the floor, like the leftmost shotgun, and looks identical. If the player approaches it and presses 'use', it will stand vertical, like the middle shotgun. However, because this was done by rolling the model in-game, it will become noticeably longer. Pressing 'use' again will lay it flat on the floor again, where it will return to its correct length.
Attachments
modelrolltest.pk3
(25.54 KiB) Downloaded 137 times
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Rolling models become elongated

Post by Enjay »

I Can't test the file right now but, going in blind, this might be due to the 1:1.2 scaling of doom. Models are not affected by this scaling and so rotating models can have some weird looking changing shape effects when rotating in the vertical plane. However,giving the model a scale multiplier of 1.2 for height in modeldef it should look fine. It works for me on spinning rockets etc.
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Rolling models become elongated

Post by Rachael »

Rotating the model in a program seems to give the correct scaling, from what he told me.

What I suspect is at play here is actually a matrix transformation ordering error. I believe that the "correction" of the model to match its natural scale in a 1:1.2 world is causing this error - that the squashing of the model happens *after* its rotation - not before - which causes hugely unnatural scales when pitching the model up or down.

In order for GZDoom to properly render a 1:1.2 world while leaving the models unaffected, the models themselves must be modified to match the new scale - obviously this is being done incorrectly, here.

I have not personally tested this yet, but from the way he described the problem to me, this seems the most plausible explanation.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Rolling models become elongated

Post by Graf Zahl »

That's all easier said than done. The actual problem is that the world scale is part of the view matrix, i.e. it's the last step being done in the transformation. But changing this would mean to change the entire renderer from the ground up to scale world z coordinates when processing them - throughout the entire code! I don't think I want to do that.
User avatar
Rachael
Posts: 13531
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Rolling models become elongated

Post by Rachael »

No one's asking you to do that.

Would it be possible, maybe, in the code that is responsible for pitch-shifting the model, to first revert the model back to its natural scale and then squash it once more to fit into the world/viewmatrix scaling right after?
Post Reply

Return to “Closed Bugs [GZDoom]”