Click face of patch object
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I use patch(X, Y, Z, C) to view a 3D model and compute values for each face. I would like to click a face and get its value returned, thus I need the number of the face. I know there is the PickableParts property and ButtonDownFcn but I do not know how to implement this function. Ginput is not going to work either since it only captures mouse click coordinates. However I might be able to use these coordinates and the camera position to draw a line and work out which faces this line intersect, but this seems to be to much of an effort. Does anybody know a neat way to solve this problem?
Thank you for your answers
0 件のコメント
回答 (1 件)
Chad Greene
2015 年 5 月 14 日
Perhaps ginput to get the mouse click coordinates, then you could use inpolygon to determine if the user clicked in a given polygon defined by the outline of each patch object. The solution is clunky and probably computationally slow, but it should get the job done.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!