Jump to content


DirectX .md2 Rendering (From GameTutorials.com Ope


4 replies to this topic

#1 SpreeTree

    Valued Member

  • Members
  • PipPipPip
  • 265 posts

Posted 30 March 2004 - 09:08 PM

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.sourcefo...mages/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

#2 Dia

    DevMaster Staff

  • Administrators
  • 1120 posts

Posted 30 March 2004 - 09:53 PM

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.

#3 SpreeTree

    Valued Member

  • Members
  • PipPipPip
  • 265 posts

Posted 30 March 2004 - 10:50 PM

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

#4 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 30 March 2004 - 11:39 PM

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...
If Prolog is the answer, what is the question ?

#5 ReNeR

    New Member

  • Members
  • Pip
  • 1 posts

Posted 20 July 2004 - 01:54 PM

TexCoords

in Drect3D:
| 1.0|
|
0.0 ____ 1.0

in OpenGL:
0.0 _____ 1.0
|
|
|
1.0





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users