camera view angle function in Matlab

12 views (last 30 days)
sophia
sophia on 23 Jan 2013
Answered: Nathan Ellingson on 20 Feb 2019
I know that in matlab the camera view angle can be manipulated to be used as "zoom" function. The smaller the view angle, the more the image is magnified. Right now what I want to do is when the viewing angle is bigger, the image should be magnified. camva function could not be used as it is the opposite of what I want to do. Is there any way to do this in Matlab GUI?

Answers (1)

Nathan Ellingson
Nathan Ellingson on 20 Feb 2019
Not 100% sure I understand. The camera view angle will always "zoom" in when it is as you shrink it.
I think what you might be trying to do is when you resize your figure (and by extention expand your camera view angle) you want to zoom in instead of showing more.
This can be accomplished by setting the "SizeChangedFcn" of your figure the plot is in, to set the camera view angle to be the same as you zoom in or out.
Just a rough idea of what you may want to do, obviously this will only zoom in as you expand or contract, and once you set camva to be negitive it will go back to the default, but hope this is a good start:
f = figure;
surf(peaks)
f.SizeChangedFcn = @(~,~) camva(camva-0.1);

Community Treasure Hunt

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

Start Hunting!