本文整理汇总了C++中vcg::Trackball::SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Trackball::SetPosition方法的具体用法?C++ Trackball::SetPosition怎么用?C++ Trackball::SetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vcg::Trackball
的用法示例。
在下文中一共展示了Trackball::SetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mode
/* Sets the trackball in a new mode:
standard mode (rotate object in front of camera)
or Navigation mode (navigate around/inside object)
*/
void SetTrackball(int mode){
// we define all possible trackModes that we could be using (static)
static vcg::PolarMode polarMode;
static vcg::SphereMode sphereMode;
static vcg::NavigatorWasdMode navigatorMode;
static vcg::InactiveMode inactiveMode;
static vcg::ScaleMode scaleMode;
static vcg::PanMode panMode;
static vcg::ZMode zMode;
// customize navigation mode...
navigatorMode.SetTopSpeedsAndAcc(1.2f,0.6f,6);
// this adds a neat human stepping effect
navigatorMode.SetStepOnWalk(0.5f,0.015f);
track.modes.clear();
track.Reset();
switch (mode) {
case 1:
// switch to navigator mode
track.modes[vcg::Trackball::BUTTON_NONE] = NULL;
track.modes[vcg::Trackball::WHEEL] =
track.modes[vcg::Trackball::BUTTON_LEFT] =
track.idle_and_keys_mode = &navigatorMode;
track.inactive_mode = NULL; // nothing to draw when inactive
track.SetPosition( observerPos );
break;
default:
// sweitch to default trackmode -- this is equivalent to a call to track->SetDefault()
track.modes[vcg::Trackball::BUTTON_NONE] = NULL;
track.modes[vcg::Trackball::BUTTON_LEFT] = &sphereMode;
track.modes[vcg::Trackball::BUTTON_LEFT | vcg::Trackball::KEY_CTRL] =
track.modes[vcg::Trackball::BUTTON_MIDDLE] = &panMode;
track.modes[vcg::Trackball::WHEEL] =
track.modes[vcg::Trackball::BUTTON_LEFT | vcg::Trackball::KEY_SHIFT] = &scaleMode;
track.modes[vcg::Trackball::BUTTON_LEFT | vcg::Trackball::KEY_ALT] = &zMode;
track.modes[vcg::Trackball::BUTTON_MIDDLE | vcg::Trackball::KEY_ALT] =
track.idle_and_keys_mode = &sphereMode;
track.inactive_mode = &inactiveMode; // draw a sphere when inactive
track.SetPosition( objectPos );
}
}