Rolling models become elongated

These bugs do plan to be resolved, when they can be.

Moderator: Developers

Rolling models become elongated

Postby Ed the Bat » Wed May 10, 2017 11:25 pm

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 30 times
User avatar
Ed the Bat
I'm tired. I want to go home.
 
Joined: 03 May 2012
Location: Maryland, US

Re: Rolling models become elongated

Postby Enjay » Thu May 11, 2017 4:06 am

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Rolling models become elongated

Postby Rachael » Thu May 11, 2017 4:15 am

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
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: Rolling models become elongated

Postby Graf Zahl » Thu May 11, 2017 4:30 am

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Rolling models become elongated

Postby Rachael » Thu May 11, 2017 10:06 am

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?
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004


Return to On Hold Bugs

Who is online

Users browsing this forum: No registered users and 1 guest