Function Repository Resource:

DynamicViewPointSynchronize

Source Notebook

Allow several Graphics3D objects to be interactively rotated at the same time

Contributed by: Jon McLoone

ResourceFunction["DynamicViewPointSynchronize"][expr]

modifies all Graphics3D objects in expr so that interactive rotation of one changes the viewpoint on all of them.

Examples

Basic Examples (2) 

Synchronize a grid of two 3D plots:

In[1]:=
ResourceFunction["DynamicViewPointSynchronize"][Grid[{{
    Plot3D[Sin[x y], {x, 0, 4}, {y, 0, 4}],
    Plot3D[Sin[x + y], {x, 0, 4}, {y, 0, 4}]}}]]
Out[1]=

Rotating one with the mouse changes the viewpoint on both:

Scope (1) 

Using shift+mouse or alt+mouse to zoom or move a Graphics3D is also synchronized:

In[2]:=
ResourceFunction["DynamicViewPointSynchronize"][Grid[{{
    Plot3D[Sin[x y], {x, 0, 4}, {y, 0, 4}],
    Plot3D[Sin[x + y], {x, 0, 4}, {y, 0, 4}]}}]]
Out[2]=

Possible Issues (2) 

Any layout expression that evaluates its contents is supported:

In[3]:=
ResourceFunction["DynamicViewPointSynchronize"][TabView[{
   Plot3D[Sin[x y], {x, 0, 4}, {y, 0, 4}],
   Plot3D[Sin[x + y], {x, 0, 4}, {y, 0, 4}]}]]
Out[3]=

But if the contents are not evaluated, there will be no synchronization:

In[4]:=
ResourceFunction["DynamicViewPointSynchronize"][Grid[{{
    Dynamic@Plot3D[Sin[x y], {x, 0, 4}, {y, 0, 4}],
    Dynamic@Plot3D[Sin[x + y], {x, 0, 4}, {y, 0, 4}]}}]]
Out[4]=

Publisher

Jon McLoone

Version History

  • 1.0.0 – 18 October 2019

Related Resources

License Information