<div>Hi folks,</div><div><br></div><div>I&#39;m trying to test the synchronization of two renderwindows.</div><div>I first made two renderwindow using vtkRenderWindow.</div><div>Then, below callback funcion is used when left mouse button is clicked.</div>
<div><br></div><div><br></div><div>---</div><div>in Main():</div><div>renderWindowInteractor-&gt;AddObserver(vtkCommand::LeftButtonPressEvent, callback, 1.0);</div><div>---</div><div><br></div><div>---</div><div>callback function:</div>
<div><br></div><div>static void interaction_test(vtkObject* obj, unsigned long, void*, void*)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::SafeDownCast(obj);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>if(iren &amp;&amp; iren-&gt;GetRepeatCount()) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>cout &lt;&lt; &quot;Double Click&quot;;</div>
<div>    }</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>cout&lt;&lt; &quot;----&quot; &lt;&lt; endl;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkCollectionSimpleIterator si;</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkRendererCollection&gt; renc = vtkSmartPointer&lt;vtkRendererCollection&gt;::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>renc = renderWindowInteractor2-&gt;GetRenderWindow()-&gt;GetRenderers();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>renc-&gt;InitTraversal(si);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkRenderer&gt; ren1 = vtkSmartPointer&lt;vtkRenderer&gt;::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ren1 = ren-&gt;GetFirstRenderer();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkRenderer&gt; ren2 = vtkSmartPointer&lt;vtkRenderer&gt;::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>ren2 = ren-&gt;GetNextRenderer(si);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkMatrix4x4 *trmat1 = firstren-&gt;GetActiveCamera()-&gt;GetViewTransformMatrix();</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; trmat1-&gt;GetElement(0,0) &lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(0,1)&lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(0,2)&lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(0,3) &lt;&lt; endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; trmat1-&gt;GetElement(1,0) &lt;&lt; &quot; &quot;&lt;&lt; trmat1-&gt;GetElement(1,1)&lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(1,2)&lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(1,3) &lt;&lt; endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; trmat1-&gt;GetElement(2,0) &lt;&lt; &quot; &quot;&lt;&lt; trmat1-&gt;GetElement(2,1)&lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(2,2)&lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(2,3) &lt;&lt; endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; trmat1-&gt;GetElement(3,0) &lt;&lt; &quot; &quot;&lt;&lt; trmat1-&gt;GetElement(3,1)&lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(3,2)&lt;&lt; &quot; &quot; &lt;&lt; trmat1-&gt;GetElement(3,3) &lt;&lt; endl;</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkMatrix4x4 *trmat2 = secondren-&gt;GetActiveCamera()-&gt;GetViewTransformMatrix();</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; trmat2-&gt;GetElement(0,0) &lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(0,1)&lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(0,2)&lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(0,3) &lt;&lt; endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; trmat2-&gt;GetElement(1,0) &lt;&lt; &quot; &quot;&lt;&lt; trmat2-&gt;GetElement(1,1)&lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(1,2)&lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(1,3) &lt;&lt; endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; trmat2-&gt;GetElement(2,0) &lt;&lt; &quot; &quot;&lt;&lt; trmat2-&gt;GetElement(2,1)&lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(2,2)&lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(2,3) &lt;&lt; endl;</div>
<div> <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; trmat2-&gt;GetElement(3,0) &lt;&lt; &quot; &quot;&lt;&lt; trmat2-&gt;GetElement(3,1)&lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(3,2)&lt;&lt; &quot; &quot; &lt;&lt; trmat2-&gt;GetElement(3,3) &lt;&lt; endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>}</div><div><div><br></div><div>At this code, when I control the mouse in renderwindow A, I can obtain the information of renderwindow B.</div><div>
However, I cannot get the information of renderwindow A.</div><div>Two vtkMatrix4x4 instances showed same results.</div><div>How to get trmat1 of renderwindow A and trmat2 of renderwindow B?</div><div><br></div><div>regards,</div>
<div><br></div><div>JY</div></div>