Здравствуйте, Lorenzo_LAMAS, Вы писали:
AR>>Смешно. Но зачем приводить то, что не имеет оотношения к делу. До этого и после этого нет ничего что так влияло бы на trInd
L_L>Ну так если ты напишешь такое
L_L>L_L>int main()
AR>>>>{
AR>>>>unsigned short* trInd = new unsigned short[2];
AR>>>>trInd[0] = (unsigned short)uCount;
AR>>>>trInd[1] = (unsigned short)vCount;
AR>>>>}
L_L>
L_L>У тебя что, тоже нули????
Нет, не нули. Вот полный кусок (ну почти полный)
int vertCount = 4;
float* vertCoo = new float[vertCount*3];
float* vertNorm = new float[vertCount*3];
MyVector center(0,0,5);
for(int ct = 0, index = 0; ct < vertCount; ct++, index += 3)
{
MyVector pos(ct,ct,index);
pos.subtract(center);
vertCoo[index ] = (float)pos.getX();
vertNorm[index ] = 0.0;
vertCoo[index+1] = (float)pos.getY();
vertNorm[index+1] = 0.0;
vertCoo[index+2] = (float)pos.getZ();
vertNorm[index+2] = 1.0;
}
float* vertMap = new float[vertCount*2];
int uCount = 4;
int vCount = 4;
float vStep = 1.0f/(vCount-1);
float uStep = 1.0f/(uCount-1);
int v;
for( v = 0, index = 0; v < vCount; v++)
{
float vConst = v*vStep;
for(int u = 0; u < uCount; u++, index += 2)
{
vertMap[index ] = u*uStep;
vertMap[index+1] = vConst;
}
}
/*******************************************/
unsigned short* trInd = new unsigned short[2];
trInd[0] = (unsigned short)uCount;
trInd[1] = (unsigned short)vCount;
/********************************************/
CShape* shp;
shp = new CShape(
vertCount,vertCoo,vertNorm,vertMap,0,trInd,true,true
);
msh = new CMesh(shp);
getWorld().addObject(msh);;
ПОМОГИТЕЕЕЕЕ