#include "../Common/Common.h"
#define SAMPLE_FILENAME "Instances.fbx"
#define SAMPLE_INSTANCE_COUNT 10
int gNbCubes = -1;
int main(int argc, char** argv)
{
bool lResult;
InitializeSdkObjects(lSdkManager, lScene);
const char* lSampleFileName =
NULL;
for( int i = 1; i < argc; ++i )
{
if( FBXSDK_stricmp(argv[i], "-test") == 0 ) continue;
else
{
if( !lSampleFileName ) lSampleFileName = argv[i];
else if ( gNbCubes < 1 ) gNbCubes = atoi(argv[i]);
}
}
if( !lSampleFileName ) lSampleFileName = SAMPLE_FILENAME;
if( gNbCubes < 1 ) gNbCubes = SAMPLE_INSTANCE_COUNT;
lResult = CreateScene(lSdkManager, lScene);
if(lResult == false)
{
FBXSDK_printf("\n\nAn error occurred while creating the scene...\n");
DestroySdkObjects(lSdkManager, lResult);
return 0;
}
lResult = SaveScene(lSdkManager, lScene, lSampleFileName);
if(lResult == false)
{
FBXSDK_printf("\n\nAn error occurred while saving the scene...\n");
DestroySdkObjects(lSdkManager, lResult);
return 0;
}
DestroySdkObjects(lSdkManager, lResult);
return 0;
}
{
double lX = 0.0;
double lY = 20.0;
double lZ = 0.0;
gMatWhite = CreateMaterial(pScene, gWhite);
gMatGray = CreateMaterial(pScene, gGray);
gMatRed = CreateMaterial(pScene, gRed);
gMatGreen = CreateMaterial(pScene, gGreen);
gMatBlue = CreateMaterial(pScene, gBlue);
for (int i = 0; i < gNbCubes; i++)
{
lCubeName += (i+1);
if (i == 0)
{
lCubeNode = CreateCube(pScene, lCubeName.
Buffer());
}
else
{
lCubeNode = CreateCubeInstance(pScene, lCubeName.
Buffer(), lCubeMesh);
}
AnimateCube(lCubeNode, lAnimLayer, lAnimCurve, i%3);
if (lX >= 0)
{
lX += 50;
}
else
{
lX -= 50;
}
lX *= -1.0;
lY += 30.0;
}
return true;
}
{
if(pRotAxis == 0)
{
}
else if(pRotAxis == 1)
{
}
else if(pRotAxis == 2)
{
}
}
{
int i, j;
lControlPoints[0] = lControlPoint0;
lControlPoints[1] = lControlPoint1;
lControlPoints[2] = lControlPoint2;
lControlPoints[3] = lControlPoint3;
lControlPoints[4] = lControlPoint1;
lControlPoints[5] = lControlPoint5;
lControlPoints[6] = lControlPoint6;
lControlPoints[7] = lControlPoint2;
lControlPoints[8] = lControlPoint5;
lControlPoints[9] = lControlPoint4;
lControlPoints[10] = lControlPoint7;
lControlPoints[11] = lControlPoint6;
lControlPoints[12] = lControlPoint4;
lControlPoints[13] = lControlPoint0;
lControlPoints[14] = lControlPoint3;
lControlPoints[15] = lControlPoint7;
lControlPoints[16] = lControlPoint3;
lControlPoints[17] = lControlPoint2;
lControlPoints[18] = lControlPoint6;
lControlPoints[19] = lControlPoint7;
lControlPoints[20] = lControlPoint1;
lControlPoints[21] = lControlPoint0;
lControlPoints[22] = lControlPoint4;
lControlPoints[23] = lControlPoint5;
{
}
int lPolygonVertices[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
for(i = 0; i < 6; i++)
{
for(j = 0; j < 4; j++)
{
}
}
for (i = 0; i < 6; i++)
{
}
return lNode;
}
{
{
}
else
{
}
return lNode;
}
{
return lMaterial;
}
{
int lKeyIndex = 0;
lKeyIndex = lAnimCurve->
KeyAdd(lTime);
lKeyIndex = lAnimCurve->
KeyAdd(lTime);
return lAnimCurve;
}