• Advertisement
Sign in to follow this  
  • entries
    557
  • comments
    1237
  • views
    422701

Untitled

Sign in to follow this  

63 views

Ok, MD2 animation is working. I haven't tried texturing, but I see no reason why that's not working too. Also, my GUI stuff is pretty nice for getting code up and running fast.

Another screenshot:

Engine screenie
Click to Enlarge


And the code for setting up that scene (GUI and mesh):

// Create mesh
m_pMesh = NEW SOMD2Mesh("Mesh");
m_pMesh->SetResource("Data/Test/test.md2");
m_pMesh->SetTransform(Matrix().SetToTranslation(0.0f, 0.0f, 150.0f));
m_pMesh->SetVisible(true);

// Create GUI window
size_t nAnims = m_pMesh->GetNumAnimations();
SOSprite::SP pBackground = NEW SOSprite("");
pBackground->SetWidth(256.0f);
pBackground->SetHeight((float)(nAnims*24 + 40));
pBackground->SetColour(0xff000000);
pBackground->SetVisible(true);
m_pWindow = NEW CGUIWindow(10, 50, pBackground);

// Add buttons
for(size_t i=0; i{
SOSprite::SP pBackground = NEW SOSprite("");
pBackground->SetWidth(200.0f);
pBackground->SetHeight(20);
pBackground->SetColour(0xff0000ff);
pBackground->SetVisible(true);
m_pWindow->Attach(NEW CButtonWidget(100+i, m_pWindow, 28, (i+1)*24,
pBackground, m_pMesh->GetAnimationName(i)));
}


So, what's next? Well, I still want to optimize the triangle stuff like I mentioned earlier, but that's not too important. MD2 is a pretty simple format, and has a hard limit of 4096 triangles (Imposed by the spec, not the file format though).
I really want to get texturing working, and lighting, and then bump mapping or something, and specular too. I also want to optimize my vertex and index buffer usage, by stuffing several similar VBs together. If I don't use FVF at all, then I belive I can just jam all the info together without too much difficulty.

Anyway, I'm bored. I'm going to watch a film and goto bed.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement