Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some of the camera parameters behave in a strange manner. #1467

Open
brugger1 opened this issue Mar 4, 2025 · 3 comments
Open

Some of the camera parameters behave in a strange manner. #1467

brugger1 opened this issue Mar 4, 2025 · 3 comments
Labels

Comments

@brugger1
Copy link
Contributor

brugger1 commented Mar 4, 2025

I modified src/examples/tutorial/ascent_intro/cpp/ascent_scene_example1.cpp to add the following camera properties. Note that I added viewport and roll.

    scenes["s1/renders/r1/image_width"] = "512";
    scenes["s1/renders/r1/image_height"] = "512";
    float64 viewport_vals[4] = {-1.0, 1.0, -1.0, 1.0:};
    Node viewport;
    viewport.set(viewport_vals, 4);
    float64 look_at_vals[3] = {0.0, 0.0, 0.0};
    Node look_at;
    look_at.set(look_at_vals, 3);
    float64 position_vals[3] = {0.0, 0.0, 4.0};
    Node position;
    position.set(position_vals, 3);
    float64 up_vals[3] = {0.0, 1.0, 0.0};
    Node up;
    up.set(up_vals, 3);
    scenes["s1/renders/r1/camera/viewport"] = viewport;
    scenes["s1/renders/r1/camera/look_at"] = look_at;
    scenes["s1/renders/r1/camera/position"] = position;
    scenes["s1/renders/r1/camera/up"] = up;
    scenes["s1/renders/r1/camera/fov"] = "60.";
    scenes["s1/renders/r1/camera/xpan"] = "0.0";
    scenes["s1/renders/r1/camera/ypan"] = "0.0";
    scenes["s1/renders/r1/camera/zoom"] = "1.0";
    scenes["s1/renders/r1/camera/azimuth"] = "0.";
    scenes["s1/renders/r1/camera/elevation"] = "0.";
    scenes["s1/renders/r1/camera/roll"] = "0.";
    scenes["s1/renders/r1/camera/near_plane"] = "0.1";
    scenes["s1/renders/r1/camera/far_plane"] = "100.1";
    scenes["s1/renders/r1/image_prefix"] = "ascent_output_render_var1_zoom";

This gives the following image.
Image

If I change xpan to 0.5 I get the following image.
Image
Notice that the object stayed in the same location and the bounding box moved to the right and it is clipping to the bounding box. This seems bizarre. The object and bounding box should move and the object shouldn't be clipped against the bounding box. I actually think the clipping is 2D in nature.

If I change ypan to 0.5 I get the following image.
Image
Same thing. The bounding box moved up and it is clipping to the bounding box.

If I change viewport to 0, 1, 0, 1 I get the following image.
Image
Notice that the image stays the same and the text on the bounding box is roughly twice as large. I believe the full image should be shrunk and moved to the upper right hand quadrant.

The camera parameters aren't described anywhere and since they are the VTKm parameters I looked at them for descriptions. Zoom is described as negative making the object smaller, positive making the object larger and zero doing nothing. Actually, 1 does nothing, less than 1 makes the object smaller and larger than 1 makes the object larger. 0 actually crashes VTKm.

@cyrush
Copy link
Member

cyrush commented Mar 7, 2025

I hit the zero case before, here is the related ticket: #1413

@cyrush cyrush added the bug label Mar 7, 2025
@cyrush
Copy link
Member

cyrush commented Mar 14, 2025

related to #1479

@brugger1
Copy link
Contributor Author

It looks to me like the zoom behavior in Ascent is different from VTKm. There must be a logic in Ascent that converts the Ascent behavior to VTKm behavior. I believe the VTKm documentation is actually correct. I also think that the VTKm zoom is cumulative, so doing a zoom of 1 twice (VTKm zoom behavior) results in zooming in more the second time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants