Jump to content
  • Advertisement
Sign in to follow this  
Drognan

OpenGL Milkshape3D with Indexbuffers

This topic is 4807 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I had previously implemented MS3D skeletal animation using OpenGL and I am trying to do it again in DX. The triangles are index so I thought that it would be real easy to implement the indexbuffer and then just chagne the vertex buffer for animation. Turns out that the MS3D file stores the texture coords and normal info with the triangle and not with the vertex, this wasn't really an issue with GL doing GLVertex3f, then setting normals and texture coords. In DX I have to put the texture coords and normal into the VB, which involves searching through the triangle indexes for the right vertex and then adding the tex and normal, then searching again on the next vertex. Is there something I'm missing that will make this easier or should I just make my own format(probably should've just done that from the beginning. Here is the structure of the triangle and vertex:
public struct MS3DVertex
{
	public byte flags;
	public float[] vertex;
	public char boneID;
	public byte refCount;
}

public struct MS3DTriangle
{
	public short flags;
	public short[] vertexIndices;
	public float[] vertexNormals; //[3],[3]
	public float[] s;
	public float[] t;
	public byte smoothingGroup;
	public byte groupIndex;
}
Thanks, Drognan

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!