Get current rotation of a surf plot
Show older comments
Is there a method to get/save the current rotation of a surf plot. We want to rotate a plot (3D), by hand using "rotate3d on", to our desired viewpoint, and then save that rotation to be applied exactly the same to all future plots. I can't seem to find any ".getRotation" type functions or attributes.
1 Comment
Dale Huffman
on 13 Feb 2017
Accepted Answer
More Answers (2)
John BG
on 11 Feb 2017
campos returns the camera position
for instance, these axes

campos
=
0.500000000000000 0.500000000000000 9.160254037844386
have the point of view on the z axis, at 9.1 above away from x y plane
Have you tried the MATLAB intro example for campos and rotate around a vibrating membrane
surf(peaks)
axis vis3d off
for x = -200:5:200
campos([x,5,100])
drawnow
end

to get right on target
campos([0 0 100])

.
if you find this answer useful would you please be so kind to mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John BG
Jan
on 12 Feb 2017
2 votes
The answer is not trivial: rotate3d can rotate an object using the view angle or the camera orbit, see the parameter 'RotateStyle'. The DataAspectRatio of the axes object can be skewed, such that the replied angle does not match the visible impression on the screen.
2 Comments
Star Strider
on 12 Feb 2017
Thank you, Jan!
Jan
on 12 Feb 2017
@Star Stride: You are welcome.
Categories
Find more on Graphics Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!