<!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> </DIV>
<DIV><FONT face=MingLiu size=2>#include "stdafx.h"<BR>#include
"vtk.h"<BR>#include "stdio.h"</FONT></DIV>
<DIV> </DIV><FONT face=MingLiu size=2>
<DIV><BR>void main()</DIV>
<DIV> </DIV>
<DIV>{<BR>int x,y,z;<BR> //for (int i = 1; i > 2000; i++)</DIV>
<DIV> </DIV>
<DIV><BR> <BR> vtkRenderWindow *renWin;<BR> vtkRenderer
*ren1;<BR> vtkRenderWindowInteractor *iren;<BR> vtkSTLReader
*hip;<BR> vtkPolyDataMapper *joinMapper;<BR> vtkActor
*joinActor;<BR> vtkSTLReader *cut;<BR> vtkPolyDataMapper
*cutterMapper;<BR> vtkActor *cutterActor;<BR>//create a window;</DIV>
<DIV> </DIV>
<DIV> renWin = vtkRenderWindow::New();<BR> ren1 =
vtkRenderer::New();<BR> renWin->AddRenderer(ren1);<BR> iren=vtkRenderWindowInteractor::New();<BR> iren->SetRenderWindow(renWin);</DIV>
<DIV> </DIV>
<DIV> <BR> hip =
vtkSTLReader::New();<BR> <BR> hip->SetFileName("ballJoint60.stl");<BR> //map
to graphics lib<BR> <BR> joinMapper =
vtkPolyDataMapper::New();<BR> <BR> joinMapper -> SetInput
(hip->GetOutput());</DIV>
<DIV> </DIV>
<DIV> //input cutter<BR> cut =
vtkSTLReader::New();<BR> cut->SetFileName("cutter3.stl");<BR> cutterMapper
= vtkPolyDataMapper::New();<BR> cutterMapper -> SetInput
(cut->GetOutput());</DIV>
<DIV> </DIV>
<DIV> //actor coordniates geometry<BR> joinActor =
vtkActor::New();<BR> cutterActor = vtkActor::New();<BR>//for (int i = 1; i
> 10; i++)<BR>//{<BR>joinActor->SetPosition(0, 0,
0);<BR>joinActor->RotateX(-90);<BR>joinActor->SetMapper(joinMapper);</DIV>
<DIV> </DIV>
<DIV>//printf("n\please enter x y z \n");<BR>scanf("%f %f
%f",&x,&y,&z);<BR>cutterActor->SetPosition(x, y
,z);<BR>cutterActor->RotateX(-90);<BR>cutterActor->SetMapper(cutterMapper);<BR> </DIV>
<DIV> </DIV>
<DIV> <BR> ren1->AddActor(joinActor);<BR> ren1->AddActor(cutterActor);<BR> ren1->SetBackground(0.1,0.2,0.4);</DIV>
<DIV> </DIV>
<DIV> renWin->SetSize(700,700);</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> renWin->Render();<BR> iren->Start(); </DIV>
<DIV> </DIV>
<DIV> //return 0;</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR>}<BR>-------------------------------</DIV>
<DIV>I just want to change the cutter postion according to my input from the
keyboard! 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> </DIV>
<DIV><FONT face=MingLiu>Best Regards,</FONT></DIV>
<DIV>German</FONT></DIV></BODY></HTML>