本文整理汇总了C++中Kinect::stopRecord方法的典型用法代码示例。如果您正苦于以下问题:C++ Kinect::stopRecord方法的具体用法?C++ Kinect::stopRecord怎么用?C++ Kinect::stopRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kinect
的用法示例。
在下文中一共展示了Kinect::stopRecord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
sf::ContextSettings Settings;
Settings.depthBits = 24; // Request a 24 bits depth buffer
Settings.stencilBits = 8; // Request a 8 bits stencil buffer
Settings.antialiasingLevel = 2; // Request 2 levels of antialiasing
sf::Window window(sf::VideoMode(WNDW_WIDTH, WNDW_HEIGHT, 32), APP_NAME, sf::Style::Close, Settings);
window.setKeyRepeatEnabled(false); // not count key holding press
if (!init()) exit(EXIT_FAILURE);
if (!K.init()) KinectOn = false;
M.init();
std::cout << "LOADING OK" << std::endl;
sf::Clock clock;
sf::Time elapsed;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::KeyPressed:
switch (event.key.code) {
case sf::Keyboard::Num1: M.increaseRotation(1, 0.0f, 0.0f); break;
case sf::Keyboard::Num2: M.increaseRotation(-1, 0.0f, 0.0f); break;
case sf::Keyboard::Num3: M.increaseRotation(0.0f, 1.0f, 0.0f); break;
case sf::Keyboard::Num4: M.increaseRotation(0.0f, -1.0f, 0.0f); break;
case sf::Keyboard::Num5: M.increaseRotation(0.0f, 0.0f, 1.0f); break;
case sf::Keyboard::Num6: M.increaseRotation(0.0f, 0.0f, -1.0f); break;
case sf::Keyboard::P: K.playRecord(); break;
case sf::Keyboard::R: K.record(); break;
case sf::Keyboard::S: K.stopRecord(); break;
case sf::Keyboard::Z: M.setShocked(); break;
case sf::Keyboard::X: M.undoShocked(); break;
case sf::Keyboard::Escape: window.close(); break;
default: break;
}
break;
default:
break;
}
}
elapsed = clock.getElapsedTime();
if (elapsed.asSeconds() > 1.0 / 30) { // 30 fps = 1.0/60
window.setActive();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (KinectOn) {
K.update();
if (K.IsTracked()) {
FLOAT* sc = K.GetScale();
FLOAT* rot = K.GetRotation();
FLOAT* trans = K.GetTranslation();
FLOAT* AU = K.GetAnimationUnits();
UINT* numAU = K.GetNumAU();
FLOAT* SU = K.GetShapeUnits();
UINT* numSU = K.GetNumSU();
M.registerResult(sc, rot, trans, AU, numAU, SU, numSU);
}
else M.stopAnimation();
}
M.update();
K.render();
M.render();
window.display();
}
}
return 0;
}