Page 1 of 1

Rotating a .md3 in GZdoom is skewed

Posted: Wed Nov 02, 2011 18:43
by chopkinsca
I've managed to get a simple model working in GZDoom, but when I try rotating it, it appears as an oval instead of a circle. It looks fine when it isn't set to rotate. I attached a small demo map showing the problem.

Re: Rotating a .md3 in GZdoom is skewed

Posted: Wed Nov 02, 2011 21:21
by Enjay
This could be a function of Doom's funny pixel shape ratio. Getting models to look right in Doom often involves them being taller than you might expect. eg I once made a square model that was simply an upright plane that had one of the marbface graphics on it - although it was square and looked fine in my model editor, it didn't look right in game and was shorter than 128 tall walls with the same texture applied to them. So I made the model taller (ie no longer square) and it matched the in-game textures perfectly.

You are probably aware that this pixel oddness is due to Doom originally running in 320x200 but on 4:3 monitors, effectively stretching the height of the screen to 240, making the pixels 1:1.2 in size rather than 1:1. Modern ports emulate/preserve the effects of this in order to make the game look right.

That's my best guess anyway.

I did ask a while back over on ZDoom if a feature to use square pixel ratios could be considered so that projects that needed this could use it. It certainly hasn't been implemented and I'm pretty sure that there is no real enthusiasm for doing it either - which is quite understandable as it would probably be quite a lot of work for little in the way of perceived gain.

[edit]

This looks a lot better on the rotating model:

Code: Select all

Model ElevatorGear_Up
{
	Path "models/Gear"
	Model 0 "gear.md3"
	Skin 0 "gear.png"
	Scale 10.0 24.0 12.0

	ROTATING
	Rotation-Vector 0 0 1.0
	Rotation-Speed 1.0

	FrameIndex EGER B 0 0
}
[/edit]

Re: Rotating a .md3 in GZdoom is skewed

Posted: Wed Nov 02, 2011 21:28
by chopkinsca
Changing the scale worked, thanks again.

Re: Rotating a .md3 in GZdoom is skewed

Posted: Sat Jan 07, 2012 16:52
by milasudril
Enjay wrote:I did ask a while back over on ZDoom if a feature to use square pixel ratios could be considered so that projects that needed this could use it. It certainly hasn't been implemented and I'm pretty sure that there is no real enthusiasm for doing it either - which is quite understandable as it would probably be quite a lot of work for little in the way of perceived gain.
If your graphics board supports it, use a resolution such as 1600x1000 and force 4:3 aspect ratio in GZDoom. On a 4:3 monitor, you will get a letterboxed picture. But hey, some modern monitors are actually 16:10 which will work well.

Re: Rotating a .md3 in GZdoom is skewed

Posted: Sat Jan 07, 2012 17:01
by milasudril
A probably related bug is that the FOV is to large. If I set FOV to 90 degrees I will actually get 110 or something. It seems like GZDoom handles the "Doom aspect ratio" by just stretching the viewport, which is wrong. Rather, when drawing a map it should multiply all heights by 1.2 . It should be quite easy to just

Code: Select all

glVertex(x,1.2*y,z);
instead of

Code: Select all

glVertex(x,y,z);
It is even better if this factor is read from the MAPINFO lump.

Re: Rotating a .md3 in GZdoom is skewed

Posted: Sat Jan 07, 2012 17:38
by Graf Zahl
The FOV is the same as ZDoom and won't be changed.
As for the aspect ratio issues, I would change it if I still understood how the projection matrix works. When I fiddle around with that nothing looks right anymore.

I also wouldn't do the 1.2 multiplication for each vertex. That'd be overkill. This should be part of the rotation matrix.

Re: Rotating a .md3 in GZdoom is skewed

Posted: Sat Jan 07, 2012 18:07
by milasudril
Graf Zahl wrote:I also wouldn't do the 1.2 multiplication for each vertex.
I forgot the power of OpenGL. Before tranlation and rotation, (we already have GL_MODELVIEW matrix stack)

Code: Select all

glScalef(1,1.2,1);
or am I wrong again?

Re: Rotating a .md3 in GZdoom is skewed

Posted: Sat Jan 07, 2012 21:52
by NeuralStunner
Enjay wrote:I did ask a while back over on ZDoom if a feature to use square pixel ratios could be considered so that projects that needed this could use it. It certainly hasn't been implemented and I'm pretty sure that there is no real enthusiasm for doing it either - which is quite understandable as it would probably be quite a lot of work for little in the way of perceived gain.
I see a lot of gain... Personally I'm uncomfortable with any view scaling that is not resolution-dependent. 1.2 is not some magic number. But modders seem to have have gotten this idea that it is.

Most stock in-game objects look fine to me, even at their "fat" ratios. To the point where they look very weird when squashed. I also design everything I make for the engine in a 1:1 ratio. Once artificial scaling is done on the graphic to compensate for an arbitrary ratio that I never see, it starts to look horrible. (Exceptions are rare.)

But we can't expect everyone to play in a letterbox. Most of them just don't care and will happily scale in their ignorance. :?

Re: Rotating a .md3 in GZdoom is skewed

Posted: Sun Jan 08, 2012 17:31
by milasudril
NeuralStunner wrote:
Enjay wrote:I did ask a while back over on ZDoom if a feature to use square pixel ratios could be considered so that projects that needed this could use it. It certainly hasn't been implemented and I'm pretty sure that there is no real enthusiasm for doing it either - which is quite understandable as it would probably be quite a lot of work for little in the way of perceived gain.
I see a lot of gain... Personally I'm uncomfortable with any view scaling that is not resolution-dependent. 1.2 is not some magic number. But modders seem to have have gotten this idea that it is.

Most stock in-game objects look fine to me, even at their "fat" ratios. To the point where they look very weird when squashed. I also design everything I make for the engine in a 1:1 ratio. Once artificial scaling is done on the graphic to compensate for an arbitrary ratio that I never see, it starts to look horrible. (Exceptions are rare.)

But we can't expect everyone to play in a letterbox. Most of them just don't care and will happily scale in their ignorance. :?
You're true!

Re: Rotating a .md3 in GZdoom is skewed

Posted: Sat Mar 31, 2012 10:07
by Graf Zahl
Same as this:

http://forum.drdteam.org/viewtopic.php?f=24&t=5328

Unfortunately I haven't found a good way yet to set up the rotation matrix to handle this.