-
Notifications
You must be signed in to change notification settings - Fork 66
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
Surface+ arrows: how to avoid transparency of the surface ? #84
Comments
PS: I can see a first solution, only if the camera axis is fixed, by using the option select in VectorObj and removing vertices that are not directly visible from the viewpoint... |
Yes, this is a known issue of vispy. It's called "tri sorting" where the triangles are z-sorted according to rotations. Unfortunately it's not supported by vispy. The best workaround could be to add multiple subplots where you mask the vectors that should be hidden. Other than that I don't have a solution |
Thanks Etienne. I will do something like this. In a first attempt, the vectors to be hidden can be detected based on the angle (>pi/2) between the normal at the point and the vector between the point and the camera. |
Yes it could be interesting to have this feature, maybe something like a |
I have started to look at but unfortunately, it does not change the viewpoint. I have tried several different azimuth/elevation values in (It is important also to note that the property _camera_state is empty... ). |
Hi Julien, Did you tried to set the input parameter Normally it should work, but if it doesn't, you should have access in the class to the camera object (turntable camera for 3d objects) |
Hi Etienne, Thanks a lot ! The first solution works perfectly. Good weekend |
So, It has been a bit long but I am now able to obtain exactly the location of the camera (which is not
Based on that it is possible to hide points. The first version with criterion on normals works well for convex surfaces, a bit less for brains. My code is not adapted for a pull request because it uses also slam and a vector_field class. But I can work on it. The two next steps are a bit challenging:
|
Hi again :-)
So, I have succeeded in displaying surfaces and vectors, thank you again Etienne.
Now I have a little issue regarding the way the surface and the vectors are superimposed. It turns out that all the arrows are displayed, even those that are supposed to be masked (on the picture, points that are on the mesial face of the brain).
Picture
Here is how I create and add the objects:
The scene:
visb_sc = SceneObj(bgcolor='white', size=(1000, 1000))
the surface (which is opaque)
b_obj = BrainObj('Mesh', vertices=np.array(mesh.vertices), faces=np.array(mesh.faces), translucent=False)
the vectors
v_obj = VectorObj('VectorField', arrows, color='black',arrow_norm=(1.,1.),line_width=1.,arrow_size=3.)
and the sequence to add the objects (I skip the texture part at the end, it did not change anything)
visb_sc.add_to_subplot(b_obj, row=0, col=0) visb_sc.add_to_subplot(v_obj)
I have tried to reverse the order of add_subplot, but I obtain a completely black picture. Is it a low-level (GL ?) behavior or did I miss something in the parameters of the functions (and sorry in advance if there's a trivial answer !) ?
The text was updated successfully, but these errors were encountered: