D3D Mesh Issues (indices + vertices != correct triangle count)

Started by
11 comments, last by unbird 10 years, 5 months ago
You're missing two thirds of your indices (a face == triangle has three each):


for(int x=0;x<pMesh->GetNumFaces()*3;x++)
{
IndicesList.push_back(pIndices[x]);
}


Just as an aside: Currently it looks like you draw each line individually. Using DrawIndexedPrimitive with D3DPT_LINELIST and setting up an appropriate index buffer you could do this with one call.
Advertisement

unbird,Paradigm Shifter, L. Spiro

Thank you for your time and patience!

unbird, my intent here is to access each line individually unless of course you could suggest another method for the following:

What i'm doing here is pushing each triangle into a vector and then preforming a triangle plane intersection to return the points at which each triangle intersects the plane...The only built-in function I found was D3DXPlaneIntersectLine so my thinking was I exclude the line parallel to the plane and preform the intersection on the remaining two line segments.. The intent here is to slice a model into layers.

It's ok, it was meant as an aside ;) . For intersection you need the vertex positions, of course.

...so my thinking was I exclude the line parallel to the plane and preform the intersection on the remaining two line segments


Emphasis mine. Careful: All three could be non-parallel, even for Mr. Teapot. And don't limit yourself to the D3DX library, it's quite rudimentary for intersections ( e.g. here some references)

This topic is closed to new replies.

Advertisement