<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META content="MSHTML 5.50.4134.100" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=MingLiu size=2>Dear all VTK User:</FONT></DIV>
<DIV><FONT face=²Ó©úÅé size=2>I try to update the position of the image use scanf 
function but can not work! Can anyone give me some idea!! Please !</FONT></DIV>
<DIV><FONT face=²Ó©úÅé size=2>My code 
is:---------------------------------------</FONT></DIV>
<DIV><FONT face=MingLiu size=2>// vtk1.cpp : Defines the entry point for the 
console application.<BR>//</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=MingLiu size=2>#include "stdafx.h"<BR>#include 
"vtk.h"<BR>#include "stdio.h"</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=MingLiu size=2>
<DIV><BR>void main()</DIV>
<DIV>&nbsp;</DIV>
<DIV>{<BR>int x,y,z;<BR>&nbsp;//for (int i = 1; i &gt; 2000; i++)</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;<BR>&nbsp;vtkRenderWindow *renWin;<BR>&nbsp;vtkRenderer 
*ren1;<BR>&nbsp;vtkRenderWindowInteractor *iren;<BR>&nbsp;vtkSTLReader 
*hip;<BR>&nbsp;vtkPolyDataMapper *joinMapper;<BR>&nbsp;vtkActor 
*joinActor;<BR>&nbsp;vtkSTLReader *cut;<BR>&nbsp;vtkPolyDataMapper 
*cutterMapper;<BR>&nbsp;vtkActor *cutterActor;<BR>//create a window;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;renWin = vtkRenderWindow::New();<BR>&nbsp;ren1 = 
vtkRenderer::New();<BR>&nbsp;renWin-&gt;AddRenderer(ren1);<BR>&nbsp;iren=vtkRenderWindowInteractor::New();<BR>&nbsp;iren-&gt;SetRenderWindow(renWin);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;<BR>&nbsp;hip = 
vtkSTLReader::New();<BR>&nbsp;<BR>&nbsp;hip-&gt;SetFileName("ballJoint60.stl");<BR>&nbsp;//map 
to graphics lib<BR>&nbsp;<BR>&nbsp;joinMapper = 
vtkPolyDataMapper::New();<BR>&nbsp;<BR>&nbsp;joinMapper -&gt; SetInput 
(hip-&gt;GetOutput());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//input cutter<BR>&nbsp;cut = 
vtkSTLReader::New();<BR>&nbsp;cut-&gt;SetFileName("cutter3.stl");<BR>&nbsp;cutterMapper 
= vtkPolyDataMapper::New();<BR>&nbsp;cutterMapper -&gt; SetInput 
(cut-&gt;GetOutput());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//actor coordniates geometry<BR>&nbsp;joinActor = 
vtkActor::New();<BR>&nbsp;cutterActor = vtkActor::New();<BR>//for (int i = 1; i 
&gt; 10; i++)<BR>//{<BR>joinActor-&gt;SetPosition(0, 0, 
0);<BR>joinActor-&gt;RotateX(-90);<BR>joinActor-&gt;SetMapper(joinMapper);</DIV>
<DIV>&nbsp;</DIV>
<DIV>//printf("n\please enter x y z \n");<BR>scanf("%f %f 
%f",&amp;x,&amp;y,&amp;z);<BR>cutterActor-&gt;SetPosition(x, y 
,z);<BR>cutterActor-&gt;RotateX(-90);<BR>cutterActor-&gt;SetMapper(cutterMapper);<BR>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;<BR>&nbsp;ren1-&gt;AddActor(joinActor);<BR>&nbsp;ren1-&gt;AddActor(cutterActor);<BR>&nbsp;ren1-&gt;SetBackground(0.1,0.2,0.4);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;renWin-&gt;SetSize(700,700);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;renWin-&gt;Render();<BR>&nbsp;iren-&gt;Start(); </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//return 0;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>}<BR>-------------------------------</DIV>
<DIV>I just want to change the cutter postion according to my input from the 
keyboard!&nbsp; Because later I will use the encoder signal to control the 
position of the cutter position!!</DIV>
<DIV>Please sent me some advise!</DIV>
<DIV>I am really need that information!</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=MingLiu>Best Regards,</FONT></DIV>
<DIV>German</FONT></DIV></BODY></HTML>