当前位置: 首页>>代码示例>>C++>>正文


C++ PointLight::drawDebug方法代码示例

本文整理汇总了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 );
}
开发者ID:jamessqr,项目名称:Cing,代码行数:35,代码来源:Advanced_SceneGraph.cpp

示例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();
}
开发者ID:sroske,项目名称:Cing,代码行数:39,代码来源:Advanced_Shadows.cpp


注:本文中的PointLight::drawDebug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。