Using drawpoint in 3d axes
Hello,
I have a program that plots the electrostatic potential created by electrons confined to a sphere. What I’d like to be able to do is grab one of those electrons and move it in the figure to see how the potential changes. What I’ve been able to do is project everything from the surface of the sphere onto 2D axes and use drawpoint to get the interactivity I want. However, I’m a little annoyed by the distortions inherent in the projection so before I go and add a bunch of other functionality I have in mind I want to see if I can get the interactivity while having everything remain on the sphere.
One strange thing is that while drawpoint will still create a Point object in 3D axes (constrained to z=0), it’s motion is distorted: upon clicking the point, it jumps away and will move as if constrained to a line parallel to the x- or y-axes. Once the cursor gets far enough away, however, its motion does follow the cursor, just with a constant offset. The magnitude of that offset is a function of the viewing angle: when looking straight down or up the point moves as expected, but a low angle makes the point get very confused.
The fact that the point is always on the xy-plane isn’t necessarily a deal-breaker, though I can already think of several issues. The bigger issue is of course the strange distorted motion. I assume there’s nothing I can really do to fix that, so my question is whether there might be a different way to achieve the same end – some sort of callback on a scatterplot that would update the coordinates based on the mouse position?
If not, I do have an idea for a compromise, but I figured this was interesting enough to ask.
Thanks!Hello,
I have a program that plots the electrostatic potential created by electrons confined to a sphere. What I’d like to be able to do is grab one of those electrons and move it in the figure to see how the potential changes. What I’ve been able to do is project everything from the surface of the sphere onto 2D axes and use drawpoint to get the interactivity I want. However, I’m a little annoyed by the distortions inherent in the projection so before I go and add a bunch of other functionality I have in mind I want to see if I can get the interactivity while having everything remain on the sphere.
One strange thing is that while drawpoint will still create a Point object in 3D axes (constrained to z=0), it’s motion is distorted: upon clicking the point, it jumps away and will move as if constrained to a line parallel to the x- or y-axes. Once the cursor gets far enough away, however, its motion does follow the cursor, just with a constant offset. The magnitude of that offset is a function of the viewing angle: when looking straight down or up the point moves as expected, but a low angle makes the point get very confused.
The fact that the point is always on the xy-plane isn’t necessarily a deal-breaker, though I can already think of several issues. The bigger issue is of course the strange distorted motion. I assume there’s nothing I can really do to fix that, so my question is whether there might be a different way to achieve the same end – some sort of callback on a scatterplot that would update the coordinates based on the mouse position?
If not, I do have an idea for a compromise, but I figured this was interesting enough to ask.
Thanks! Hello,
I have a program that plots the electrostatic potential created by electrons confined to a sphere. What I’d like to be able to do is grab one of those electrons and move it in the figure to see how the potential changes. What I’ve been able to do is project everything from the surface of the sphere onto 2D axes and use drawpoint to get the interactivity I want. However, I’m a little annoyed by the distortions inherent in the projection so before I go and add a bunch of other functionality I have in mind I want to see if I can get the interactivity while having everything remain on the sphere.
One strange thing is that while drawpoint will still create a Point object in 3D axes (constrained to z=0), it’s motion is distorted: upon clicking the point, it jumps away and will move as if constrained to a line parallel to the x- or y-axes. Once the cursor gets far enough away, however, its motion does follow the cursor, just with a constant offset. The magnitude of that offset is a function of the viewing angle: when looking straight down or up the point moves as expected, but a low angle makes the point get very confused.
The fact that the point is always on the xy-plane isn’t necessarily a deal-breaker, though I can already think of several issues. The bigger issue is of course the strange distorted motion. I assume there’s nothing I can really do to fix that, so my question is whether there might be a different way to achieve the same end – some sort of callback on a scatterplot that would update the coordinates based on the mouse position?
If not, I do have an idea for a compromise, but I figured this was interesting enough to ask.
Thanks! callback, 3d plots MATLAB Answers — New Questions