Rotating a .md3 in GZdoom is skewed

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Rotating a .md3 in GZdoom is skewed

Post 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.
Attachments
gear.zip
(125.26 KiB) Downloaded 99 times
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Re: Rotating a .md3 in GZdoom is skewed

Post 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]
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Re: Rotating a .md3 in GZdoom is skewed

Post by chopkinsca »

Changing the scale worked, thanks again.
milasudril
Posts: 64
Joined: Fri May 15, 2009 17:21

Re: Rotating a .md3 in GZdoom is skewed

Post 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.
milasudril
Posts: 64
Joined: Fri May 15, 2009 17:21

Re: Rotating a .md3 in GZdoom is skewed

Post 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.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Rotating a .md3 in GZdoom is skewed

Post 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.
milasudril
Posts: 64
Joined: Fri May 15, 2009 17:21

Re: Rotating a .md3 in GZdoom is skewed

Post 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?
User avatar
NeuralStunner
Posts: 253
Joined: Tue Dec 29, 2009 3:46
Location: IN SPACE
Contact:

Re: Rotating a .md3 in GZdoom is skewed

Post 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. :?
Dean Koontz wrote:Human beings can always be relied upon to exert, with vigor, their God-given right to be stupid.
Spoiler: System Specs
milasudril
Posts: 64
Joined: Fri May 15, 2009 17:21

Re: Rotating a .md3 in GZdoom is skewed

Post 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!
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Rotating a .md3 in GZdoom is skewed

Post 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.
Locked

Return to “Closed Bugs”