本文整理汇总了C++中math::Vector::ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ Vector::ptr方法的具体用法?C++ Vector::ptr怎么用?C++ Vector::ptr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类math::Vector
的用法示例。
在下文中一共展示了Vector::ptr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_screen_capture
void ScreenCapture::on_screen_capture ()
{
if (isnan (rotation_axis_x->value()))
rotation_axis_x->setValue (0.0);
if (isnan (rotation_axis_y->value()))
rotation_axis_y->setValue (0.0);
if (isnan (rotation_axis_z->value()))
rotation_axis_z->setValue (0.0);
if (isnan (degrees_button->value()))
degrees_button->setValue (0.0);
if (isnan (translate_x->value()))
translate_x->setValue(0.0);
if (isnan (translate_y->value()))
translate_y->setValue(0.0);
if (isnan (translate_z->value()))
translate_z->setValue(0.0);
if (isnan (FOV_multipler->value()))
FOV_multipler->setValue(1.0);
if (window.snap_to_image () && degrees_button->value() > 0.0)
window.set_snap_to_image (false);
float radians = degrees_button->value() * (M_PI / 180.0) / frames->value();
std::string folder (directory->path().toUtf8().constData());
std::string prefix (prefix_textbox->text().toUtf8().constData());
int first_index = start_index->value();
int i = first_index;
for (; i < first_index + frames->value(); ++i) {
this->window.captureGL (folder + "/" + prefix + printf ("%04d.png", i));
// Rotation
Math::Versor<float> orientation (this->window.orientation());
Math::Vector<float> axis (3);
axis[0] = rotation_axis_x->value();
axis[1] = rotation_axis_y->value();
axis[2] = rotation_axis_z->value();
Math::Versor<float> rotation (radians, axis.ptr());
rotation *= orientation;
this->window.set_orientation (rotation);
// Translation
Point<float> focus (this->window.focus());
focus[0] += translate_x->value() / frames->value();
focus[1] += translate_y->value() / frames->value();
focus[2] += translate_z->value() / frames->value();
window.set_focus (focus);
Point<float> target (this->window.target());
target[0] += translate_x->value() / frames->value();
target[1] += translate_y->value() / frames->value();
target[2] += translate_z->value() / frames->value();
window.set_target (target);
// FOV
window.set_FOV (window.FOV() * (Math::pow (FOV_multipler->value(), (float) 1.0 / frames->value())));
start_index->setValue (i + 1);
this->window.updateGL();
}
}