DirectX .md2 Rendering (From GameTutorials.com Ope

F3ff2088fe22d64396b949f149628107
0
SpreeTree 101 Mar 30, 2004 at 21:08

Ive been working on rendering md2 models, and so far everything is fine, except for one thing. The model draws, animates etc just fine, but I am having a probelm with one or two texture coordinates, and was wondering if anyone had expereinced this probelm themselves?

Have a look at the result so far

http://cull.sourceforge.net/images/image.jpg

As you can see, the model is rendered fine, and the majority of the texutring is fine too, apart from the odd ones. This happens on the majority of models I have tried (some worse than others, some not)

The code that I have been using is converted from the md2 model/animation tutorial from GameTutorials.com, which was originally in OpenGL.

Ive tried inverting the V coordinate, and tried clamping/mirroring/warpping the texture but to no avail.

Has anyone else had this problem, and how did you solve it?

Cheers
Spree

4 Replies

Please log in or register to post a reply.

Fdbdc4176840d77fe6a8deca457595ab
0
dk 158 Mar 30, 2004 at 21:53

I believe Quake uses a different coordinate system than DirectX. Try swaping the y and z coordinates of the vertices, and see if that works.

F3ff2088fe22d64396b949f149628107
0
SpreeTree 101 Mar 30, 2004 at 22:50

Thats already been taken into account. The model drawing is perfect, its just the odd random texture coord mess-up. Ive tried messing with the order of verts etc. but to no avail. Its strange, but I’m totally lost. Its wierd how most of the model is correct (in fact on some models, thsi problem doesnt appear)

Spree

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Mar 30, 2004 at 23:39

never had that problem myself. it’s very hard to say where this error is coming from. if it shows up in most models you load i would say that the most probable place is your loader code. just doublecheck if you are calculating the right buffersizes all the time, etc. just leaving out one coord or filling it with bogus data might cause this…

23039501e30155cb63fada445f998a1d
0
ReNeR 101 Jul 20, 2004 at 13:54

TexCoords

in Drect3D:
| 1.0|
|
0.0 ____ 1.0

in OpenGL:
0.0 _____ 1.0
|
|
|
1.0