MD2 vertex dance problem

Started by
8 comments, last by aker_jus 21 years, 6 months ago
I have a fully functioning MD2 renderer in my engine, but I have this problem: With some models, the vertices seem to jump around a little bit. I know this is a problem cause MD2 stores its vertices as unsigned chars and not as floats like all modern formats. Has anyone tackled this problem? Thanks
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
Advertisement
Make sure you are lerping between frames and not just switching frames (ie linearly interpolating between each vertex in one frame to the corresponding vertex in the next). I guess you could try doing some quadratic or more interpolation between more frames, but that might not work well.
Yup, of course i linear interpolate between current frame and next frame. This ''jumping'' is not noticable in all models, so it is not a problem of my code.

Maybe if I convert somehow the unsigned char to float? I dont know. Any ideas?
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
You need to multiply the xyz coords by the frame scale factor and translate by the frmae translation to get your floating point xyz values.


  float x = xyzs[index].v[0] * frames[0].scale[0] + frames[0].translate[0];float z = -(xyzs[index].v[1] * frames[0].scale[1] + frames[0].translate[1]);float y = xyzs[index].v[2] * frames[0].scale[2] + frames[0].translate[2];  


-dizzy

[edited by - yzzid on October 20, 2002 8:10:43 AM]
-dizzyGame Institute InternPlease rate me. :)
I do that. Maybe it is just the animation faulty, not the code...
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
Yeh, sounds like that is the case, try loading it into max or milkshape or something and see if tweaking it helps.
OK. If the source of your MD2 models is anything other than Quake 2 assets then I would question the validity of the model files.

-dizzy
-dizzyGame Institute InternPlease rate me. :)
It''s a problem with the md2 files, most likely. You can see it in quake2 as well (just watch the idle gun animations, the verts jiggle all over the place). I''ve heard it''s due to some kind of "compression" in the file format. I personally think it''s lack of precision. Either way, there''s nothing you can do about it.
___________________________________Digital Paint: Paintball 2.0jitspoe's joint
That is what I thought from the start.

Bah.. should I throw away MD2 support? Then my engine would have no 3D format and I would have to start over.
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
Its the compression in the md2 format that is the base of its lack of precision. The xyz floating point values are compressed into a 16bit (iirc) value for writing with just a simple division and rounding off of the decimal places.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack

This topic is closed to new replies.

Advertisement