本文整理汇总了C++中Cameras::addCameraFovX方法的典型用法代码示例。如果您正苦于以下问题:C++ Cameras::addCameraFovX方法的具体用法?C++ Cameras::addCameraFovX怎么用?C++ Cameras::addCameraFovX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cameras
的用法示例。
在下文中一共展示了Cameras::addCameraFovX方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST(CamerasTest, rotated) {
Cameras cameras;
size_t id = cameras.addCameraFovX(
"dummy",
vec3(0.0f, 0.0f, 0.0f),
vec3(1.0f, 0.0f, 0.0f),
vec3(0.0f, 1.0f, 0.0f),
half_pi<float>());
ASSERT_EQ(1, cameras.numCameras());
auto r0 = cameras.shoot(id, vec2(0.0f, 0.0f), 0.01f, 0.01f, 1, 0.0f, 0.0f);
EXPECT_VEC3_EQ(vec3(0.577f, -0.577f, -0.577f), r0.direction, 0.001f);
}
示例2: load_cameras
void load_cameras(const aiScene* scene, Materials& materials,
Cameras& cameras) {
for (size_t i = 0; i < scene->mNumCameras; ++i) {
auto camera = scene->mCameras[i];
cameras.addCameraFovX(toString(camera->mName), toVec3(camera->mPosition),
normalize(toVec3(camera->mLookAt)),
normalize(toVec3(camera->mUp)),
camera->mHorizontalFOV * 2.0f, camera->mClipPlaneNear,
camera->mClipPlaneFar);
materials.names.push_back("camera");
materials.bsdfs.push_back(unique<BSDF>(new CameraBSDF()));
}
}