本文整理汇总了C++中point::getz方法的典型用法代码示例。如果您正苦于以下问题:C++ point::getz方法的具体用法?C++ point::getz怎么用?C++ point::getz使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类point
的用法示例。
在下文中一共展示了point::getz方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trackMouse
// Processes mouse movements for skeleton manipulation
void trackMouse(int x, int y)
{
if(mode == 2 && selected >= joints.size())
{
point *s = &xydpoints.at(selected - joints.size());
if(RM)
{
double shift = (clickpos.gety() - y)/50.;
*s = point(s->getx(), s->gety(), clickpos.getz()+shift);
}
else
{
*s = point(x, y, s->getz());
}
setTargets();
}
else if(mode == 1)
{
if(LM && selected >= 0 && selected <= joints.size())
{
double shift = clickpos.gety() - y;
joints.at(selected)->settheta(clickpos.getz() + shift);
}
}
}
示例2: mouseToObj
// Convert mouse coordinates + depth to world coordinates
point mouseToObj(point xyd)
{
int mx = xyd.getx();
int my = xyd.gety();
double depth = xyd.getz();
float clipx = 2.0*mx/win_width - 1;
float clipy = 2.0*(win_height - my)/win_height - 1;
glm::vec4 clip1 = projection*viewT*glm::vec4(0, 0, depth, 1);
glm::vec4 clip(clipx, clipy, clip1.z/clip1.w, 1);
glm::vec4 world = glm::inverse(projection*viewT*viewR)*clip;
return point(world.x/world.w, world.y/world.w, world.z/world.w);
}