本文整理汇总了C++中Pyramid::Transform方法的典型用法代码示例。如果您正苦于以下问题:C++ Pyramid::Transform方法的具体用法?C++ Pyramid::Transform怎么用?C++ Pyramid::Transform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pyramid
的用法示例。
在下文中一共展示了Pyramid::Transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Triangulate
void Microphone::Triangulate() {
vertices.clear();
edges.clear();
polygons.clear();
ExCone base(bH, bR, bR, bR * 0.824f, precision);
Pyramid buttonL(bH * 0.6f, bW * 0.575f, bW, bW * 0.3f, bW, -bW * 0.1375f),
buttonR(bH * 0.6f, bW * 0.575f, bW, bW * 0.3f, bW, -bW * 0.1375f);
Cone shroudLow(uH * 0.21127f, uR, uR, precision),
bridge (uH * 0.084537f, uR * 0.66667f, uR * 0.41667f, precision),
shroudHi (uH - uG - shroudLow.getHeight() - uH * .04f - bridge.getHeight(), uR, uR, precision),
upright (uH - bridge.getHeight(), uR * 0.66667f, uR * 0.66667f, precision);
Pyramid handleBridgeUp (uH * 0.09155f, uR * 0.653f, hI, uR * 0.653f, hI),
handleBridgeDown(uH * 0.077f, uR * 0.653f, hI, uR * 0.653f, hI),
handle (uH * 0.7598f, uR * 0.792f, uR * 0.5418f, uR * 0.5418f, uR * 0.5418f, uR * 0.125f),
handleTop (uH * 0.05647f, uR * 0.792f, uR * 0.5418f, uR * 0.792f, uR * 0.5418f,-uR * 0.3542f);
Hole head (hD, hR, cR, hR, cR, precision),
headFront(hD / 10.f, hR * 1.075f, cR * 0.9f, hR * 1.075f, cR * 0.9f, precision),
headBack (hD / 10.f, hR * 1.075f, cR * 0.9f, hR * 1.075f, cR * 0.9f, precision);
Cone core (hD * 1.43333f, cR, cR, precision);
base.Yaw(-(FLOAT)M_PI_2);
base.Transform();
buttonL.Translate(-bR * 0.2588f, bR * 0.824f, bH * 1.1f);
buttonL.Pitch((FLOAT)M_PI);
buttonL.Transform();
buttonR.Translate(bR * 0.2588f, bR * 0.824f, bH * 1.1f);
buttonR.Pitch((FLOAT)M_PI);
buttonR.Transform();
upright.Fly(bH);
upright.Transform();
shroudLow.Fly(base.getHeight() + uH * .04f);
shroudLow.Transform();
shroudHi.Fly(shroudLow.getPosition().z + shroudLow.getHeight() + uG);
shroudHi.Transform();
bridge.Fly(shroudHi.getPosition().z + shroudHi.getHeight());
bridge.Transform();
handleBridgeUp.Fly(uH * 0.8f);
handleBridgeUp.Follow(uR + hI / 2);
handleBridgeUp.Transform();
handleBridgeDown.Fly(bH + uH * 0.15f);
handleBridgeDown.Follow(handleBridgeUp.getPosition().x);
handleBridgeDown.Transform();
handle.Translate(uR * 1.5f + hI, bR * 0.0059f, uH * .95f);
handle.Pitch((FLOAT)M_PI);
handle.Yaw((FLOAT)M_PI_2);
handle.Transform();
handleTop.Translate(handle.getPosition().x, handle.getPosition().y, handle.getPosition().z);
handleTop.Yaw((FLOAT)M_PI_2);
handleTop.Transform();
head.Fly(bridge.getPosition().z + bridge.getHeight() + hR);
head.Strafe(-hD/2);
head.Pitch((FLOAT)M_PI_2);
head.Roll((FLOAT)M_PI_2);
head.Transform();
headFront.Fly(head.getPosition().z);
headFront.Strafe(-head.getPosition().y);
headFront.Pitch((FLOAT)M_PI_2);
headFront.Roll((FLOAT)M_PI_2);
headFront.Transform();
headBack.Translate(head.getPosition());
headBack.Pitch((FLOAT)M_PI_2);
headBack.Roll((FLOAT)M_PI_2);
headBack.Transform();
core.Fly(head.getPosition().z);
core.Strafe(-core.getHeight() / 2.1f);
core.Pitch((FLOAT)M_PI_2);
core.Roll((FLOAT)M_PI_2);
core.Transform();
addMesh(MIC_BASE, base);
addMesh(MIC_BUTTON_L, buttonL);
addMesh(MIC_BUTTON_R, buttonR);
addMesh(MIC_UPRIGHT, upright);
addMesh(MIC_SHROUD_LOW, shroudLow);
addMesh(MIC_SHROUD_HI, shroudHi);
addMesh(MIC_BRIDGE, bridge);
addMesh(MIC_HANDLE_BU, handleBridgeUp);
addMesh(MIC_HANDLE_BD, handleBridgeDown);
addMesh(MIC_HANDLE, handle);
addMesh(MIC_HANDLE_TOP, handleTop);
addMesh(MIC_HEAD, head);
addMesh(MIC_HEAD_FRONT, headFront);
//.........这里部分代码省略.........