本文整理汇总了C++中PointLight::drawDebug方法的典型用法代码示例。如果您正苦于以下问题:C++ PointLight::drawDebug方法的具体用法?C++ PointLight::drawDebug怎么用?C++ PointLight::drawDebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointLight
的用法示例。
在下文中一共展示了PointLight::drawDebug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void setup()
{
size(1024, 768);
background(0);
setFrameRate(60);
// Setup lighting
ambientLight(30);
light.init(200, 200, 200, 0, 3, 0);
// Uncomment this line to see the position of the light
light.drawDebug(true);
// Init 3d object's properties
box.init(50, 25, 75);
box.setPosition(width/2.0f, height/2.0f);
sphere1.init(30);
sphere2.init(60);
sphere3.init(100);
// Now, we make the spheres children of the box's (scene node)
box.addChild( sphere1 );
box.addChild( sphere2 );
box.addChild( sphere3 );
// Translate the sphere (relative to its parent, the box)
// This way, when we rotate the box (parent object), the spheres will orbitate around it
sphere1.setPosition( 2, 0, 0 );
sphere2.setPosition( 5, 0, 0 );
sphere3.setPosition( 7, 0, 0 );
// Add the second light as child of one of the spheres
sphere1.addChild( light );
}
示例2: setup
void setup()
{
size(1024, 768);
background(0);
enableShadows( STENCIL_MODULATIVE );
applyCoordinateSystemTransform(OPENGL3D);
// Setup lighting
ambientLight(10);
light.init(255, 255, 255, width/2 + 100, height/2 + 100, 100);
// Uncomment this line to see the position of the light
light.drawDebug();
// Init 3d object's properties
box.init(10, 4, 14);
box.setPosition(width/2.0f, 100);
sphere1.init(6);
sphere2.init(12);
sphere3.init(20);
// Now, we make the spheres children of the box's (scene node)
box.addChild( sphere1 );
box.addChild( sphere2 );
box.addChild( sphere3 );
// Translate the sphere (relative to its parent, the box)
// This way, when we rotate the box (parent object), the spheres will orbitate around it
sphere1.setPosition( 2, -2, 0 );
sphere2.setPosition( 5, -7, 0 );
sphere3.setPosition( 7, -12, 0 );
// Ground
ground.init(5000, 25, 5000 );
ground.setPosition( width/2, -200 );
// Camera control
enableDefault3DCameraControl();
}