Rolling models become elongated

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Rolling models become elongated

Re: Rolling models become elongated

by Rachael » Thu May 11, 2017 9: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?

Re: Rolling models become elongated

by Graf Zahl » Thu May 11, 2017 3: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.

Re: Rolling models become elongated

by Rachael » Thu May 11, 2017 3: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.

Re: Rolling models become elongated

by Enjay » Thu May 11, 2017 3: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.

Rolling models become elongated

by Ed the Bat » Wed May 10, 2017 10: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 141 times

Top