Skip to content

Conversation

@munozco
Copy link
Contributor

@munozco munozco commented Feb 19, 2025

Context:
I want to make a trame-vtk widget to support WebXR in Trame.
Here's the trame-vtk PR: Kitware/trame-vtk#81

This PR:

This component is a wrapper for vtk.js' vtkWebXRRenderWindowHelper. It has two methods startXR and stopXR and can trigger enterXR and exitXR events. drawControllersRay can be set to true to draw rays to represent the controllers.

To make the WebXR view work with a VtkView, I had to comment a line in ClientView (last commit). I don't really understand what it does and I get the same results with and without it. @jourdain : do you know what's the purpose of the "Cube axes" section ? I don't understand why it's there since its visibility is always false and it makes the WebXR helper mess with the transform matrix...

@munozco munozco marked this pull request as ready for review February 19, 2025 14:31
@jourdain
Copy link
Collaborator

Thanks for doing that and I see the issue.

So the cubeAxes can be turned on by a property. Maybe you can delay the binding of the camera when that prop get turned on?

@munozco munozco force-pushed the webxr-helper-component branch from a25cfc9 to 5b6416a Compare February 20, 2025 13:10
@munozco
Copy link
Contributor Author

munozco commented Feb 20, 2025

I can't see anything related to this property, so I added a setCubeAxesVisibility function with a watch on props.showCubeAxes.
This way, we can properly enable or disable the cubeAxis with setCubeAxesVisibility. Should I also add a set_cubes_axis_visibility function in my trame-vtk PR ?

@jourdain
Copy link
Collaborator

I think that looks good to me. No need to worry about trame-vtk for now. Thanks for fixing that oversight.

@jourdain jourdain merged commit db131cd into Kitware:master Feb 20, 2025
@jourdain
Copy link
Collaborator

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

this.cubeAxes
.getActors()
.forEach(({ setVisibility }) => setVisibility(false));

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't you call setCubeAxesVisibility to avoid code duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants