Me to want..
I got this C++ function
/* Prototyper for å lage egene vertices */
bool CreateNewObject ( int iID, LPSTR pName, int iFrame );
sObject* dbGetObject ( int iID );
bool SetupMeshFVFData ( sMesh* pMesh, DWORD dwFVF, DWORD dwVertexCount, DWORD dwIndexCount );
bool SetupStandardVertex ( DWORD dwFVF, BYTE* pVertex, int iOffset, float x, float y, float z, float nx, float ny, float nz, DWORD dwDiffuseColour, float tu, float tv );
bool SetNewObjectFinalProperties ( int iID, float fRadius );
void SetTexture ( int iID, int iImage );
/*
n0_CreateNewObject
int obj - Objekt nummer
int noVer - Antall vertices
int noInd - Antall indekser
n0_simpleVertex verList[] - Array med alle vertex data
int indList[] - Array med alle index data
*/
void n0_CreateNewObject( int obj, int noVer, int noInd, n0_simpleVertex verList[] , int indList[] )
{
CreateNewObject( obj , "" , 1 );
sObject* pObject = dbGetObject( obj );
sMesh* pMesh = pObject->pFrame->pMesh;
SetupMeshFVFData( pMesh , D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1, noVer , noInd);
for(int x=0; x < noVer + 0; x++)
{// Index
SetupStandardVertex ( pMesh->dwFVF , pMesh->pVertexData , x , verList[x].x , verList[x].y , verList[x].z , 0.0f , 0.0f , -1.0f , 0 , 0.0f , 0.0f );
}
// Skriver index-data
for(int x=0; x < noInd + 0; x++)
{
pMesh->pIndices[x] = indList[x];
}
pMesh->iPrimitiveType = D3DPT_TRIANGLELIST;
pMesh->iDrawVertexCount = noVer;
// pMesh->dwIndexCount = noInd;
pMesh->iDrawPrimitives = pMesh->dwIndexCount / 3;
// dbLoadImage("C:\gress.bmp" , 1);
SetNewObjectFinalProperties( obj , 0.0f );
// SetTexture( obj , 1 );
}
Which I need to convert to C#.Net