getting multiple intersection points through callback function
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
patch('Faces',T,'Vertices',V,'FaceColor','white','ButtonDownFcn',@MyCallback)
axis equal;
pointCo = getappdata(0, 'point');
function MyCallback(src,eventData)
p = eventData.IntersectionPoint;
setappdata(0, 'point', p);
end
The goal of the above code is to return the coordinates of the points I clicked on a 3d surface triangular mesh. I am very new callbacks so I hope this is not very hard.
Question 1: The code is functioning if I only care for a triplet of coordinates of one intersection point. How can I return the coordinates of multiple ones (by clicking many times on the mesh and coordinates not overriding each other)?
Question 2: If I want an intersection point that is currently not visible from the viewing angle in the figure created by patch, I need to add cameratoolbar to rotate the mesh. The moment I add cameratoolbar it seems like it stops working.
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Object Properties dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!