本文整理汇总了C++中Primitive::SetIsLight方法的典型用法代码示例。如果您正苦于以下问题:C++ Primitive::SetIsLight方法的具体用法?C++ Primitive::SetIsLight怎么用?C++ Primitive::SetIsLight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Primitive
的用法示例。
在下文中一共展示了Primitive::SetIsLight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Setup
void Scene::Setup(params::InterfaceGlRef _params) {
Primitive* primitive;
float planeDist = 25;
//ground plane
primitive = new PlanePrimitive(ci::Vec3f(0, -planeDist, 0), ci::Vec3f(0, 1, 0));
primitive->SetName("GroundPlane");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(1.0f, 0.2f, 0.2f));
primitive->GetMaterial().SetSpecularColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetDiffuseCoefficient(1.0f);
primitive->GetMaterial().SetSpecularCoefficient(0.0f);
m_primitives.push_back(primitive);
//top plane
primitive = new PlanePrimitive(ci::Vec3f(0, planeDist, 0), ci::Vec3f(0, -1, 0));
primitive->SetName("TopPlane");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(0.2f, 1.0f, 0.2f));
primitive->GetMaterial().SetSpecularColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetDiffuseCoefficient(1.0f);
primitive->GetMaterial().SetSpecularCoefficient(0.0f);
m_primitives.push_back(primitive);
//side plane
primitive = new PlanePrimitive(ci::Vec3f(planeDist, 0, 0), ci::Vec3f(-1, 0, 0));
primitive->SetName("RightPlane");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(0.2f, 0.2f, 1.0f));
primitive->GetMaterial().SetSpecularColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetDiffuseCoefficient(1.0f);
primitive->GetMaterial().SetSpecularCoefficient(0.0f);
m_primitives.push_back(primitive);
//side plane
primitive = new PlanePrimitive(ci::Vec3f(-planeDist, 0, 0), ci::Vec3f(1, 0, 0));
primitive->SetName("LeftPlane");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(1.0f, 1.0f, 0.2f));
primitive->GetMaterial().SetSpecularColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetDiffuseCoefficient(1.0f);
primitive->GetMaterial().SetSpecularCoefficient(0.0f);
m_primitives.push_back(primitive);
//side plane
primitive = new PlanePrimitive(ci::Vec3f(0, 0, planeDist), ci::Vec3f(0, 0, -1));
primitive->SetName("FrontPlane");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(1.0f, 0.2f, 1.0f));
primitive->GetMaterial().SetSpecularColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetDiffuseCoefficient(1.0f);
primitive->GetMaterial().SetSpecularCoefficient(0.0f);
m_primitives.push_back(primitive);
//side plane
primitive = new PlanePrimitive(ci::Vec3f(0, 0, -planeDist), ci::Vec3f(0, 0, 1));
primitive->SetName("BackPlane");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(0.2f, 1.0f, 1.0f));
primitive->GetMaterial().SetSpecularColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetDiffuseCoefficient(1.0f);
primitive->GetMaterial().SetSpecularCoefficient(0.0f);
m_primitives.push_back(primitive);
//big sphere
primitive = new SpherePrimitive(ci::Vec3f(5, 7, 0), 7);
primitive->SetName("BigSphere");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetSpecularColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetDiffuseCoefficient(1.0f);
primitive->GetMaterial().SetSpecularCoefficient(0.0f);
primitive->GetMaterial().SetReflectionCoefficient(0.0f);
primitive->GetMaterial().SetRefractionCoefficient(1.1f);
m_primitives.push_back(primitive);
//small sphere
primitive = new SpherePrimitive(ci::Vec3f(-5, -5, -10), 5);
primitive->SetName("SmallSphere");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(0.5f, 0.5f, 0.1f));
primitive->GetMaterial().SetSpecularColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->GetMaterial().SetDiffuseCoefficient(1.0f);
primitive->GetMaterial().SetSpecularCoefficient(0.0f);
primitive->GetMaterial().SetReflectionCoefficient(0.1f);
primitive->GetMaterial().SetRefractionCoefficient(0.0f);
m_primitives.push_back(primitive);
//light1
primitive = new SpherePrimitive(ci::Vec3f(10, 24, 0), 2);
primitive->SetName("Light1");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(1.0f, 1.0f, 1.0f));
primitive->SetIsLight(true);
m_primitives.push_back(primitive);
////light2
/*primitive = new SpherePrimitive(ci::Vec3f(-10, 10, -10), 1);
primitive->SetName("Light 2");
primitive->GetMaterial().SetDiffuseColor(ci::ColorA(0.7f, 0.7f, 0.7f));
primitive->SetIsLight(true);
m_primitives.push_back(primitive);*/
for (int i=0; i<m_primitives.size(); i++)
m_primitives[i]->AddParams(_params);
}