diff --git a/src/libs/ascent/runtimes/flow_filters/ascent_runtime_rendering_filters.cpp b/src/libs/ascent/runtimes/flow_filters/ascent_runtime_rendering_filters.cpp index 239d5ecbe..55108311d 100644 --- a/src/libs/ascent/runtimes/flow_filters/ascent_runtime_rendering_filters.cpp +++ b/src/libs/ascent/runtimes/flow_filters/ascent_runtime_rendering_filters.cpp @@ -1922,8 +1922,8 @@ void generate_camera_meshes(conduit::Node &image_data){ vtkm::Vec forward(0,0,-1); double angle_between = vtkm::ACos(vtkm::Dot(forward, vtkm_look)) / vtkm::Pi() * 180; - // If the look vector has been rotated by a certain angle, ajust the camera up vector to match - if (angle_between != 0.0) { + // If the look vector has been rotated by a certain angle, adjust the camera up vector to match + if (vtkm::Abs(angle_between) >= 0.001) { vtkm::Vec axisOfRotation = vtkm::Cross(vtkm_look, forward); vtkm_up = vtkm::Transform3DVector(vtkm::Transform3DRotate(-angle_between, axisOfRotation), vtkm_up); diff --git a/src/tests/_baseline_images/tout_render_3d_frust_camera_image_4_frustum_front_image_100.png b/src/tests/_baseline_images/tout_render_3d_frust_camera_image_4_frustum_front_image_100.png new file mode 100644 index 000000000..bae74f236 Binary files /dev/null and b/src/tests/_baseline_images/tout_render_3d_frust_camera_image_4_frustum_front_image_100.png differ diff --git a/src/tests/_baseline_images/tout_render_3d_frust_camera_image_4_frustum_side_image_100.png b/src/tests/_baseline_images/tout_render_3d_frust_camera_image_4_frustum_side_image_100.png new file mode 100644 index 000000000..b4776a053 Binary files /dev/null and b/src/tests/_baseline_images/tout_render_3d_frust_camera_image_4_frustum_side_image_100.png differ diff --git a/src/tests/ascent/t_ascent_render_3d.cpp b/src/tests/ascent/t_ascent_render_3d.cpp index 417788d5f..daaa7bd8f 100644 --- a/src/tests/ascent/t_ascent_render_3d.cpp +++ b/src/tests/ascent/t_ascent_render_3d.cpp @@ -3004,7 +3004,7 @@ TEST(ascent_render_3d, test_render_3d_camera_frustum_meshes) EXPECT_TRUE(conduit::blueprint::mesh::verify(data,verify_info)); - ASCENT_INFO("Testing 3D rendering of camera frustum meshes"); + ASCENT_INFO("Testing 3D rendering of camera frustum meshes\n"); // // Create the actions. @@ -3048,6 +3048,13 @@ TEST(ascent_render_3d, test_render_3d_camera_frustum_meshes) add_plots["scenes/s1/renders/r4/camera/azimuth"] = 20.0; add_plots["scenes/s1/renders/r4/camera/elevation"] = -45.0; + // Test that if the look_at location and the position location are quite similar that the frustum + // is still generated without errors. + add_plots["scenes/s1/renders/r5/image_prefix"] = + conduit::utils::join_file_path(output_path, "tout_render_3d_frust_image_nan"); + add_plots["scenes/s1/renders/r5/camera/position"] = {0.0, 0.0, 0.0581200011074543}; + add_plots["scenes/s1/renders/r5/camera/look_at"] = {0.0, 0.0, 0.0}; + // // Run Ascent to generate images // @@ -3065,7 +3072,7 @@ TEST(ascent_render_3d, test_render_3d_camera_frustum_meshes) // // For each image that was generated, run ascent to visualize the camera frustum // - for (int image_index = 0; image_index<4; image_index++) { + for (int image_index = 0; image_index<5; image_index++) { conduit::Node &image_node = ascent_info["images"][image_index]; conduit::Node camera_data = image_node["camera/camera_frustum_mesh"];