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


C++ DisplaySkeleton::GetSkeleton方法代码示例

本文整理汇总了C++中DisplaySkeleton::GetSkeleton方法的典型用法代码示例。如果您正苦于以下问题:C++ DisplaySkeleton::GetSkeleton方法的具体用法?C++ DisplaySkeleton::GetSkeleton怎么用?C++ DisplaySkeleton::GetSkeleton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DisplaySkeleton的用法示例。


在下文中一共展示了DisplaySkeleton::GetSkeleton方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: skeletonID_callback

void skeletonID_callback(Fl_Value_Input *obj, void*)
{
  int subnum;
  subnum = (int)sub_input->value();

  if (subnum < 0) 
  {
    sub_input->value(0);
    subnum = 0;
  }
  else
    if (subnum >= displayer.GetNumSkeletons())
    {
      sub_input->value(displayer.GetNumSkeletons() - 1);
      subnum = displayer.GetNumSkeletons() - 1;
    }
    
  // Change values of other inputs to match sub-number
  double translation[3];
  displayer.GetSkeleton(subnum)->GetTranslation(translation);
  double rotationAngle[3];
  displayer.GetSkeleton(subnum)->GetRotationAngle(rotationAngle);
  tx_input->value(translation[0]);
  ty_input->value(translation[1]);
  tz_input->value(translation[2]);
  rx_input->value(rotationAngle[0]);
  ry_input->value(rotationAngle[1]);
  rz_input->value(rotationAngle[2]);
 
  glwindow->redraw();
}
开发者ID:JSleekXD,项目名称:ModifyMocapData,代码行数:31,代码来源:mocapPlayer.cpp

示例2: rz_callback

void rz_callback(Fl_Value_Input *obj, void*)
{
  int subnum = 0;
  subnum = (int)sub_input->value();
  if (subnum < displayer.GetNumSkeletons() && subnum >= 0)
    displayer.GetSkeleton(subnum)->SetRotationAngleZ(rz_input->value());
  glwindow->redraw();
}
开发者ID:JSleekXD,项目名称:ModifyMocapData,代码行数:8,代码来源:mocapPlayer.cpp

示例3: tx_callback

void tx_callback(Fl_Value_Input *obj, void*)
{
  int subnum = 0;
  subnum = (int)sub_input->value();
  if (subnum < displayer.GetNumSkeletons() && subnum >= 0)
    displayer.GetSkeleton(subnum)->SetTranslationX(tx_input->value());
  glwindow->redraw();
}
开发者ID:JSleekXD,项目名称:ModifyMocapData,代码行数:8,代码来源:mocapPlayer.cpp

示例4: SetSkeletonsToSpecifiedFrame

//////////////////////////////////////////////////////////////////////////////////
// Load up a new motion captured frame
//////////////////////////////////////////////////////////////////////////////////
void SetSkeletonsToSpecifiedFrame(int frameIndex)
{
  if (frameIndex < 0)
  {
    printf("Error in SetSkeletonsToSpecifiedFrame: frameIndex %d is illegal.\n", frameIndex);
    exit(0);
  }
  if (displayer.GetSkeletonMotion(0) != NULL)
  {
    int postureID;
    if (frameIndex >= displayer.GetSkeletonMotion(0)->GetNumFrames())
      postureID = displayer.GetSkeletonMotion(0)->GetNumFrames() - 1;
    else 
      postureID = frameIndex;
    displayer.GetSkeleton(0)->setPosture(* (displayer.GetSkeletonMotion(0)->GetPosture(postureID)));
  }
}
开发者ID:pcbennion,项目名称:ucsb-graphics-rayTrace03-final,代码行数:20,代码来源:skeletonViewer.cpp

示例5: resetPostureAccordingFrameSlider

void resetPostureAccordingFrameSlider(void)
{
  currentFrameIndex = (int)frame_slider->value() - 1;
  currentFrameIndexDoublePrecision = currentFrameIndex;

  // display
  for (int skeletonIndex = 0; skeletonIndex < displayer.GetNumSkeletons(); skeletonIndex++)
  {
    int postureID;
    if (currentFrameIndex >= displayer.GetSkeletonMotion(skeletonIndex)->GetNumFrames())
      postureID = displayer.GetSkeletonMotion(skeletonIndex)->GetNumFrames() - 1;
    else
      postureID = currentFrameIndex;
    // Set skeleton to the first posture
    Posture * currentPosture = displayer.GetSkeletonMotion(skeletonIndex)->GetPosture(postureID);
    displayer.GetSkeleton(skeletonIndex)->setPosture(*currentPosture);
  }
}
开发者ID:JSleekXD,项目名称:ModifyMocapData,代码行数:18,代码来源:mocapPlayer.cpp

示例6: idle

void idle(void*)
{
  if (previousPlayButtonStatus == ON)  
  {
    // it means we should measure the interval between two frames
    // if it is too tiny, we should slow down the motion
    performanceCounter.StopCounter();
    double actualTimeCostOneFrame = performanceCounter.GetElapsedTime(); // in seconds

    // time spent on saving the screen in previous time-step should be excluded
    if (saveFileTimeCost > 0.0)   
      actualTimeCostOneFrame -= saveFileTimeCost;

    framesIncrementDoublePrecision = actualTimeCostOneFrame * expectedFPS;
  }
  // start counter at the beginning of the new round
  if (playButton == ON)
    performanceCounter.StartCounter();

  if(rewindButton == ON)
  {
    currentFrameIndex = 0;
    currentFrameIndexDoublePrecision = 0.0;
    for (int i = 0; i < displayer.GetNumSkeletons(); i++)
    {
      if (displayer.GetSkeletonMotion(i) != NULL)
      {
        Posture * initSkeleton = displayer.GetSkeletonMotion(i)->GetPosture(0);
        displayer.GetSkeleton(i)->setPosture(*initSkeleton);
      }
    }
    rewindButton = OFF;
  }

  // Initialization
  saveFileTimeCost = -1.0;

  if(playButton == ON) 
  {
    if (saveScreenToFile == SAVE_CONTINUOUS)
    {
      saveFileTimeCounter.StartCounter();
      CreateScreenFilename(SAVE_CONTINUOUS, saveScreenToFileContinuousCount, saveScreenToFileContinuousFilename);
      saveScreenshot(640, 480, saveScreenToFileContinuousFilename);
      printf("%s is saved to disk.\n", saveScreenToFileContinuousFilename);
      saveScreenToFileContinuousCount++;
      saveFileTimeCounter.StopCounter();
      saveFileTimeCost = saveFileTimeCounter.GetElapsedTime();
    }

    if (saveScreenToFile == SAVE_CONTINUOUS)
    {
      currentFrameIndexDoublePrecision += 1.0;
    }
    else
    {
      currentFrameIndexDoublePrecision += framesIncrementDoublePrecision;
    }

    currentFrameIndex = (int)currentFrameIndexDoublePrecision;

    if(currentFrameIndex >= maxFrames)
    {
      if (repeatButton == ON)
      {
        currentFrameIndex = 0;
        currentFrameIndexDoublePrecision = 0.0;
      }
      else  // repeat button is OFF
      {
        currentFrameIndex = maxFrames - 1;
        currentFrameIndexDoublePrecision = currentFrameIndex;
        playButton = OFF;  // important, especially in "recording" mode
      }
    }

    if (currentFrameIndex < 0)
    {
      currentFrameIndex = 0;
      currentFrameIndexDoublePrecision = 0.0;
    }

    SetSkeletonsToSpecifiedFrame(currentFrameIndex);

    frame_slider->value((double) currentFrameIndex + 1);
  }  // if(playButton == ON)

  if (minusOneButton == ON)
    if (displayer.GetNumSkeletons() != 0)
    {
      currentFrameIndex--;
      if (currentFrameIndex < 0)
        currentFrameIndex = 0;
      frame_slider->value((double) currentFrameIndex + 1);

      SetSkeletonsToSpecifiedFrame(currentFrameIndex);    
      if (saveScreenToFile == SAVE_CONTINUOUS)
      {
        CreateScreenFilename(SAVE_CONTINUOUS, saveScreenToFileContinuousCount, saveScreenToFileContinuousFilename);
        saveScreenshot(640, 480, saveScreenToFileContinuousFilename);
//.........这里部分代码省略.........
开发者ID:JSleekXD,项目名称:ModifyMocapData,代码行数:101,代码来源:mocapPlayer.cpp


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