本文整理汇总了C++中Surface::SetDiffuseColor方法的典型用法代码示例。如果您正苦于以下问题:C++ Surface::SetDiffuseColor方法的具体用法?C++ Surface::SetDiffuseColor怎么用?C++ Surface::SetDiffuseColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Surface
的用法示例。
在下文中一共展示了Surface::SetDiffuseColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleMenuCommand
// Handle menu commands
void HandleMenuCommand(int option)
{
switch(option)
{
case 'de':
mDesign = !mDesign;
if (mDesign)
{
mPS.StartConstructingSystem();
}
else
{
mPS.FinishConstructingSystem();
}
break;
case 'cs':
if (!mDesign)
{
mDesign = true;
mPS.StartConstructingSystem();
}
mPS.ClearSystem();
break;
case 'mp':
mMode = designMode_Particle;
break;
case 'mn':
mMode = designMode_Nail;
break;
case 'ms':
mMode = designMode_Spring;
break;
case 'd':
mSurfaceConditionsName = "Default";
mSurface.SetAmbientColor( 0.0, 0.0, 1.0, 1.0 );
mSurface.SetDiffuseColor( 0.0, 0.0, 1.0, 1.0 );
mSurface.SetSpecularColor( 0.5, 0.5, 0.5, 0.5 );
mSurface.SetShininess( 10.0 );
mPS.gravity = 9.8;
mPS.drag = 0.01;
mPS.SetSpringConstant(5);
mPS.SetSpringDampingConstant(1);
mSurface.SetMassProportion(1); // proportional to numer of particles in x
break;
case 't':
mSurfaceConditionsName = "Trampoline";
mSurface.SetAmbientColor( 0.1, 0.1, 0.3, 1.0 );
mSurface.SetDiffuseColor( 0.0, 0.0, 0.6, 1.0 );
mSurface.SetSpecularColor( 0.5, 1.0, 1.0, 1.0 );
mSurface.SetShininess( 70.0 );
mPS.gravity = 9.8;
mPS.drag = 0.001;
mPS.SetSpringConstant(10);
mPS.SetSpringDampingConstant(1);
mSurface.SetMassProportion(0.5); // proportional to numer of particles in x
break;
case 'f':
mSurfaceConditionsName = "Foam";
mSurface.SetAmbientColor( 1.0, 1.0, 1.0, 1.0 );
mSurface.SetDiffuseColor( 0.8, 0.8, 1.0, 1.0 );
mSurface.SetShininess( 10.0 );
mPS.gravity = 0.5;
mPS.drag = 1.0;
mPS.SetSpringConstant(1);
mPS.SetSpringDampingConstant(1);
mSurface.SetMassProportion(1); // proportional to numer of particles in x
break;
case 'c':
mSurfaceConditionsName = "Clay";
mSurface.SetAmbientColor( 0.6, 0.6, 0.4, 1.0 );
mSurface.SetDiffuseColor( 0.3, 0.3, 0.2, 1.0 );
mSurface.SetSpecularColor( 0.2, 0.2, 0.2, 1.0 );
mSurface.SetShininess( 10.0 );
mPS.gravity = 1.0;
mPS.drag = 2.0;
mPS.SetSpringConstant(0.5);
mPS.SetSpringDampingConstant(1);
mSurface.SetMassProportion(1); // proportional to numer of particles in x
break;
case 'j':
mSurfaceConditionsName = "Jello";
mSurface.SetAmbientColor( 1.0, 0.0, 0.0, 1.0 );
mSurface.SetDiffuseColor( 1.0, 0.0, 0.0, 1.0 );
mSurface.SetSpecularColor( 1.0, 1.0, 1.0, 1.0 );
mSurface.SetShininess( 100.0 );
mPS.gravity = 0;
mPS.drag = 0.1;
mPS.SetSpringConstant(10);
mPS.SetSpringDampingConstant(2);
//.........这里部分代码省略.........