本文整理汇总了C++中Sphere::Render方法的典型用法代码示例。如果您正苦于以下问题:C++ Sphere::Render方法的具体用法?C++ Sphere::Render怎么用?C++ Sphere::Render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sphere
的用法示例。
在下文中一共展示了Sphere::Render方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
void Render(double time)
{
gl.Clear().ColorBuffer().DepthBuffer();
//
// make the light position vector
auto light = Vec3f(8.0f, 8.0f, 8.0f);
// make the matrix for camera orbiting the origin
auto camera = CamMatrixf::Orbiting(
Vec3f(),
21.0,
Degrees(time * 15),
Degrees(SineWave(time*0.15) * 45)
);
auto nucl = ModelMatrixf::RotationA(
Vec3f(1.0f, 1.0f, 1.0f),
FullCircles(time)
);
proton.SetLightAndCamera(light, camera);
proton.Render(nucl * ModelMatrixf::Translation(+1.4f,0.0f,0.0f));
proton.Render(nucl * ModelMatrixf::Translation(-1.4f,0.0f,0.0f));
neutron.SetLightAndCamera(light, camera);
neutron.Render(nucl * ModelMatrixf::Translation(0.0f,0.0f,+1.0f));
neutron.Render(nucl * ModelMatrixf::Translation(0.0f,0.0f,-1.0f));
electron.SetLightAndCamera(light, camera);
electron.Render(
ModelMatrixf::RotationY(FullCircles(time * 0.7)) *
ModelMatrixf::Translation(10.0f, 0.0f, 0.0f)
);
electron.Render(
ModelMatrixf::RotationX(FullCircles(time * 0.7)) *
ModelMatrixf::Translation(0.0f, 0.0f, 10.0f)
);
}
示例2: DrawSphere
void DrawSphere(Vector3 const &pos, float radius)
{
static Sphere sphere;
sphere.Render(pos, radius);
}