setstereo

Create a rotatable stereoscopic view of 3D data with two side-by-side subplots.
30 Downloads
Updated 2 Apr 2019

View License

SETSTEREO yokes the camera positions in two axes to provide a rotatable stereoscopic view of points and surfaces plotted in 3 dimensions. The relationship between the axes is maintained with a callback, UPDATESTEREO.

For example, to plot a stereoscopic view of the Matlab logo surface:

% Create the surface
L = 160*membrane(1,100);

% Create a figure with two identical subplots
figure
ax1 = subplot(1,2,1);
s1 = surface(L);
view(3)
axis equal vis3d off
ax2 = subplot(1,2,2);
s2 = surface(L);
view(3)
axis equal vis3d off
set([s1 s2],'EdgeColor','none');
set([ax1 ax2],'clipping','off')

% Lock the position of the cameras to maintain a fixed separation; positive separation for divergent viewing and negative for crossed.
setstereo(ax1,ax2,.075)
rotate3d on

Now you can manipulate either axis while viewing the result in stereo by diverging your eyes or using a handheld stereoscope.

Cite As

Kovach, C.K. (2019). setstereo (https://www.mathworks.com/matlabcentral/fileexchange/71103), MATLAB Central File Exchange. Retrieved April 2, 2019.

MATLAB Release Compatibility
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.5

Provide a cooler demo in the description.

1.0.4

A better logo

1.0.3

Add a nifty logo

1.0.2

Update the citation text to something that makes more sense.

1.0.1

For some reason, only one file was uploaded in the previous attempt.

1.0.0