<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><p class="MsoNormal">Hello Everyone, <span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">I want to use arrow keys to move an actor in a scene. The actor is created from an STL reader from the following code:<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSTLReader</span><span style="font-size:9.5pt;font-family:consolas;color:black">> reamer_reader =<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">              </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSTLReader</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       reamer_reader</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">SetFileName(inputFilename.c_str());<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       reamer_reader</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">Update();<span></span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">Then, I have the following transfer matrix and filter to make the translations:<span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkTransform</span><span style="font-size:9.5pt;font-family:consolas;color:black">> transform_matrix = </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkTransform</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       transform_matrix</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">Translate(0.0, 0.0, 0.0);<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkTransformPolyDataFilter</span><span style="font-size:9.5pt;font-family:consolas;color:black">> transformFilter =<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">              </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkTransformPolyDataFilter</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       transformFilter</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">SetInputConnection(reamer_reader</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">GetOutputPort());<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       transformFilter</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">SetTransform(transform_matrix);<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       transformFilter</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">Update();<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal">And of course, there are the mapper, actor and renderer as follows:<span></span></p><p class="MsoNormal"><br></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkRenderer</span><span style="font-size:9.5pt;font-family:consolas;color:black">> renderer = </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkRenderer</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       renderer</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">SetBackground(.3, .6, .3);<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkPolyDataMapper</span><span style="font-size:9.5pt;font-family:consolas;color:black">> reamer_mapper = </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkPolyDataMapper</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       reamer_mapper</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">SetInputConnection(reamer_reader</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">GetOutputPort());<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:rgb(43,145,175)">vtkActor</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">> reamer_actor = </span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:rgb(43,145,175)">vtkActor</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       renderer</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">AddActor(reamer_actor);</span><span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">I create a window interactor and then add an observer to look for key press events:<span></span></p><p class="MsoNormal"><br></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkRenderWindowInteractor</span><span style="font-size:9.5pt;font-family:consolas;color:black">> renderWindowInteractor =<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">              </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkRenderWindowInteractor</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkInteractorStyleTrackballCamera</span><span style="font-size:9.5pt;font-family:consolas;color:black">> camera_style =<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">              </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkInteractorStyleTrackballCamera</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       renderWindowInteractor</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">SetInteractorStyle(camera_style);<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkCallbackCommand</span><span style="font-size:9.5pt;font-family:consolas;color:black">> keypressCallback =<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">              </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkCallbackCommand</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       keypressCallback</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">SetCallback(KeypressCallbackFunction);<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       renderWindowInteractor</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">AddObserver(</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkCommand</span><span style="font-size:9.5pt;font-family:consolas;color:black">::</span><span style="font-size:9.5pt;font-family:consolas;color:darkslategray">KeyPressEvent</span><span style="font-size:9.5pt;font-family:consolas;color:black">, keypressCallback); <span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">KeyPressInteractorStyle</span><span style="font-size:9.5pt;font-family:consolas;color:black">> keyboard_style =<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">              </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">KeyPressInteractorStyle</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       renderWindowInteractor</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">SetInteractorStyle(keyboard_style);<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkRenderWindow</span><span style="font-size:9.5pt;font-family:consolas;color:black">> renderWindow = </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkRenderWindow</span><span style="font-size:9.5pt;font-family:consolas;color:black">>::New();<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       renderWindowInteractor</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">SetRenderWindow(renderWindow);<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       renderWindow</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">AddRenderer(renderer);<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       renderWindow</span><span style="font-size:9.5pt;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;font-family:consolas;color:black">Render();<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">       renderWindowInteractor</span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:teal">-></span><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">Start();<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black"><span> </span></span></p><p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black"><span><br></span></span></p>

<p class="MsoNormal"><span style="color:black">and here is the KeypressCallbackFunction itself:<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:blue">void</span><span style="font-size:9.5pt;font-family:consolas;color:black"> KeypressCallbackFunction(</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkObject</span><span style="font-size:9.5pt;font-family:consolas;color:black">* </span><span style="font-size:9.5pt;font-family:consolas;color:gray">caller</span><span style="font-size:9.5pt;font-family:consolas;color:black">,<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:blue">long</span><span style="font-size:9.5pt;font-family:consolas;color:black"> </span><span style="font-size:9.5pt;font-family:consolas;color:blue">unsigned</span><span style="font-size:9.5pt;font-family:consolas;color:black"> </span><span style="font-size:9.5pt;font-family:consolas;color:blue">int</span><span style="font-size:9.5pt;font-family:consolas;color:black"> </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(111,0,138)">vtkNotUsed</span><span style="font-size:9.5pt;font-family:consolas;color:black">(eventId),<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:blue">void</span><span style="font-size:9.5pt;font-family:consolas;color:black">* </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(111,0,138)">vtkNotUsed</span><span style="font-size:9.5pt;font-family:consolas;color:black">(clientData),<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:blue">void</span><span style="font-size:9.5pt;font-family:consolas;color:black">* </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(111,0,138)">vtkNotUsed</span><span style="font-size:9.5pt;font-family:consolas;color:black">(callData)){<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkRenderWindowInteractor</span><span style="font-size:9.5pt;font-family:consolas;color:black"> *iren = </span><span style="font-size:9.5pt;font-family:consolas;color:blue">static_cast</span><span style="font-size:9.5pt;font-family:consolas;color:black"><</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">vtkRenderWindowInteractor</span><span style="font-size:9.5pt;font-family:consolas;color:black">*>(</span><span style="font-size:9.5pt;font-family:consolas;color:gray">caller</span><span style="font-size:9.5pt;font-family:consolas;color:black">);<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       std::cout </span><span style="font-size:9.5pt;font-family:consolas;color:teal"><<</span><span style="font-size:9.5pt;font-family:consolas;color:black"> </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(163,21,21)">"Pressed: "</span><span style="font-size:9.5pt;font-family:consolas;color:black"> </span><span style="font-size:9.5pt;font-family:consolas;color:teal"><<</span><span style="font-size:9.5pt;font-family:consolas;color:black"> iren->GetKeySym() </span><span style="font-size:9.5pt;font-family:consolas;color:teal"><<</span><span style="font-size:9.5pt;font-family:consolas;color:black"> std::endl;<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       std::</span><span style="font-size:9.5pt;font-family:consolas;color:rgb(43,145,175)">string</span><span style="font-size:9.5pt;font-family:consolas;color:black"> key = iren->GetKeySym();<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       </span><span style="font-size:9.5pt;font-family:consolas;color:blue">if</span><span style="font-size:9.5pt;font-family:consolas;color:black"> (key </span><span style="font-size:9.5pt;font-family:consolas;color:teal">==</span><span style="font-size:9.5pt;font-family:consolas;color:black"> </span><span style="font-size:9.5pt;font-family:consolas;color:rgb(163,21,21)">"Up"</span><span style="font-size:9.5pt;font-family:consolas;color:black">) {<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">              <span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">              //??? What to do here ???<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black">       }<span></span></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:9.5pt;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black">}<span></span></span></p>

<p class="MsoNormal"><span style="font-size:9.5pt;line-height:107%;font-family:consolas;color:black"><span> </span></span></p>

<p class="MsoNormal"><span style="color:black">I can not figure out what commands should I write when the “Up” key is pressed. I am assuming that I only need to update the translation matrix here, but I don’t know where to apply the updated translation matrix to the actor and I think I need to call renderWindow</span><span style="color:teal">-></span><span style="color:black">Render(), too. I will really appreciate it if anyone helps me with<span></span></span></p>

<p class="gmail-MsoListParagraphCxSpFirst" style="margin-left:39pt"><span style="color:black">(1)<span style="font-variant-numeric:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"times new roman"">      </span></span><span dir="LTR"></span><span style="color:black">what to write within the if-block?<span></span></span></p>

<p class="gmail-MsoListParagraphCxSpMiddle" style="margin-left:39pt">(2)<span style="font-variant-numeric:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"times new roman"">      </span><span dir="LTR"></span><span style="color:black">how to pass variables such as translation matrix to KeypressCallbackFunction?</span><span></span></p>

<p class="gmail-MsoListParagraphCxSpLast" style="margin-left:39pt">(3)<span style="font-variant-numeric:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"times new roman"">      </span><span dir="LTR"></span>where to call  <span style="color:black">renderWindow</span><span style="color:teal">-></span><span style="color:black">Render()?</span><span></span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal">Many thanks!<span></span></p>

<p class="MsoNormal">Reza<span></span></p></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-size:12.8px">PhD Candidate,</div><div style="font-size:12.8px"><span style="font-size:12.8px">Spencer Engineering Building Room 37</span><br></div><div style="font-size:12.8px">University of Western Ontario</div><div style="font-size:12.8px">London, ON, Canada, N6A 5B9</div></div></div></div></div>
</div>