本文整理汇总了C++中Object3D::SetColor方法的典型用法代码示例。如果您正苦于以下问题:C++ Object3D::SetColor方法的具体用法?C++ Object3D::SetColor怎么用?C++ Object3D::SetColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object3D
的用法示例。
在下文中一共展示了Object3D::SetColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
// functie de initializare
void init(void)
{
// initialize vector arrays
Vector3D::arr = new float[3];
Vector4D::arr = new float[4];
// initializam camera principala
camera = new Camera();
camera->type=CameraTypeFREECAM;
camera->SetPosition(Vector3D(0,10,20));
//initializam camera secundara
cameraSide = new Camera();
cameraSide->SetPosition(Vector3D(0,40,33));
cameraSide->RotateX(0.94);
cameraSide->type=CameraTypeFIXED;
//numarul de obiecte
objectCount = 35;
// initializam vectorii de obiecte
objects = new Object3D*[objectCount];
collidableObjects = new Object3D*[objectCount];
lights = new Light*[objectCount];
//Pentru numararea obiectelor
objectCount=0;
lightCount=0;
collidableObjectCount=0;
/***********PLANUL DE JOC****************/
// initializam un plan de latura 5.0f
ground = new Plane(20.4f);
// culoare
ground->SetColor(new Vector3D(0.8,0,0.0));
// setam o grila de 5
ground->SetLevelOfDetail(2);
// sub nivelul obiectelor
ground->SetPosition(new Vector3D(0,0,0));
// si wireframe
ground->Wireframe = false;
/********MARGINILE TERENULUI DE JOC********/
//Cream marginile terenului jocului
createTrack();
/*********STALPI DE LUMINA****************/
LightPole *lightPole;
//Stalp 1
lightPole=new LightPole(10);
lightPole->SetColor(new Vector3D(0.4,0.4,0));
lightPole->setDiffuseColor(Vector4D(0.4,0.4,0,1));
lightPole->SetScale(new Vector3D(0.5,0.5,0.5));
lightPole->setLightDirection(Vector3D(-0.5,-1,0));
lightPole->SetPosition(new Vector3D(-16,0,0));
lightPole->setBoundingBoxMargin(0.01,6,0.01,-0.01,-6,-0.01);
lightPole->CollisionEnabled=false;
objects[objectCount++]=lightPole;
lights[lightCount++]=lightPole->getLight();
//Stalp 2
lightPole=new LightPole(6);
lightPole->SetColor(new Vector3D(0.4,0.7,0));
lightPole->setDiffuseColor(Vector4D(0.4,0.7,0,1));
lightPole->SetScale(new Vector3D(0.5,0.5,0.5));
lightPole->setLightDirection(Vector3D(-0.5,-1,0.5));
lightPole->SetPosition(new Vector3D(10,0,-8));
lightPole->setBoundingBoxMargin(0.01,6,0.01,-0.01,-6,-0.01);
lightPole->CollisionEnabled=false;
objects[objectCount++]=lightPole;
lights[lightCount++]=lightPole->getLight();
//Stalp 3
lightPole=new LightPole(12);
lightPole->SetColor(new Vector3D(0,0.4,0.4));
lightPole->setDiffuseColor(Vector4D(0,0.4,0.4,1));
lightPole->SetScale(new Vector3D(0.5,0.5,0.5));
lightPole->setLightDirection(Vector3D(0.5,-1.3,0.3));
lightPole->SetPosition(new Vector3D(16,0,16));
lightPole->setBoundingBoxMargin(0.01,6,0.01,-0.01,-6,-0.01);
lightPole->CollisionEnabled=false;
objects[objectCount++]=lightPole;
lights[lightCount++]=lightPole->getLight();
/*************OBSTACOLE*************/
Object3D *obstacol;
//Obstacol 1 - Sfera portocalie - sus
obstacol=new Object3D(Sphere);
obstacol->setDiffuseColor(Vector4D(0.5,0.2,0,1));
obstacol->SetColor(new Vector3D(0.5,0.2,0));
obstacol->SetScale(new Vector3D(0.5,0.5,0.5));
obstacol->SetPosition(new Vector3D(-4,1,-19));
obstacol->setBoundingBoxMargin(0.5,0.5,0.5,-0.5,-0.5,-0.5);
objects[objectCount++]=obstacol;
//Obstacol 2 - Paralelipiped mov - dreapta
obstacol=new Object3D(Cube);
obstacol->setDiffuseColor(Vector4D(0.4,0.1,0.4,1));
obstacol->SetColor(new Vector3D(0.4,0.1,0.4));
//.........这里部分代码省略.........