本文整理汇总了C++中LightPtr::setCenter方法的典型用法代码示例。如果您正苦于以下问题:C++ LightPtr::setCenter方法的具体用法?C++ LightPtr::setCenter怎么用?C++ LightPtr::setCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LightPtr
的用法示例。
在下文中一共展示了LightPtr::setCenter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initGraphics
void initGraphics()
{
trackball(curquat, 0.0, 0.0, 0.0, 0.0);
#ifdef __APPLE__
// Seems to be needed on Apple platforms using Intel
// integrated graphics but not elsewhere
// If you're getting unexpected seg faults on Apple,
// comment this out and recompile
// If you're not seeing the mesh on a Windows box that
// uses Intel integrated graphics, try enabling this
// for your machine
glEnableClientState(GL_COLOR_ARRAY);
#endif
glEnableClientState(GL_VERTEX_ARRAY);
glEnable(GL_DEPTH_TEST);
glPixelStorei(GL_PACK_ALIGNMENT, 1); // avoid GL's dumb default of 4
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // avoid GL's dumb default of 4
glClearColor(0.1, 0.1, 0.2, 0.0);
scene = ScenePtr(new Scene(Camera(40, 1, 0.1, 100),
View(eye_vector,
at_vector,
up_vector)));
material = MaterialPtr(new Material());
// A little hacky - pick initial values from menu items
materialMenu(0);
bumpyMenu(0);
decalMenu(0);
envMapMenu(0);
Mesh2DPtr mesh2d = Mesh2DPtr(new Mesh2D(float2(0,0), float2(1,1), int2(4,4)));
TorusPtr torus = TorusPtr(new Torus(Transform(), material));
scene->addObject(torus);
light = LightPtr(new Light());
light->setCenter(float3(0,0,0));
light->setRadius(3.5);
light->setAngleInDegrees(60.0);
// A little hacky - pick initial value from menu item
lightMenu(1);
scene->addLight(light);
}