フィルターのクリア

Save 3D surface output of "rotate" to variable

10 ビュー (過去 30 日間)
Scott
Scott 2015 年 11 月 12 日
コメント済み: Mike Garrity 2015 年 11 月 12 日
Hey all,
I was thrilled to find the rotate function as I was coding up my own. However, I've come across a key issues I was hoping someone could help me with:
After applying the rotate function to a 3D surface, how do I save the output to a variable so that I can analyze it?
Any advice/comments are greatly appreciated. Basically, what I'm trying to do is alter topographic data so that the perspective above a certain point is normal to the surface and work with this perspective.
Many thanks.

採用された回答

Scott
Scott 2015 年 11 月 12 日
Disregard. Found the following as helpful:
  1 件のコメント
Mike Garrity
Mike Garrity 2015 年 11 月 12 日
That's right. The rotate function modifies the XData, YData, and ZData properties of the object you give it.
Just to be clear, you can skip all of the openfig and findall stuff on that page you linked to and simplify it down to something like this:
[x,y,z] = cylinder;
h = surf(x,y,z)
rotate(h,[0 1 0],30)
newx = h.XData;
newy = h.YData;
newz = h.ZData;
And if you'd ever like to go back to coding your own, you might find this post helpful. It gets into how you represent perspective when you do this type of transformation.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by