<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>
<DIV><FONT face=Arial size=2>Hi! I'm a beginer in VTK and I've been trying to 
draw the sinus func with vtkxyplotactor. The strange thing is that although I 
indicate which are&nbsp;the x-y components in the values&nbsp;array, the system 
draws the "arc sin" function. I don't know how to understand this;&nbsp;Am 
I&nbsp;wrong? or the system swap components?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Here's the code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#include "vtkPointData.h"<BR>#include 
"vtkPoints.h"<BR>#include "vtkCellArray.h"<BR>#include 
"vtkPolyData.h"<BR>#include "vtkRenderer.h"<BR>#include 
"vtkRenderWindow.h"<BR>#include "vtkRenderWindowInteractor.h"<BR>#include 
"vtkXYPlotActor.h"<BR>#include "vtkDataSetCollection.h"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>int main(){</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//&nbsp; CONSOLE:&nbsp;how many points entry to 
form the "line".</FONT></DIV>
<DIV><FONT face=Arial size=2>//&nbsp; CONSOLA: Ingreso de la cantidad de puntos 
que formarán la "curva".</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; int 
data_puntos;<BR>&nbsp;&nbsp;&nbsp; cout&lt;&lt;"Ingrese cantidad de puntos 
(1-50): ";<BR>&nbsp;&nbsp;&nbsp; cin&gt;&gt;data_puntos;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//&nbsp; Creación de una Celda - Definición 
topológica y geométrica</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//&nbsp; Definición Topológica<BR>//&nbsp; 
Inserción de 1(una) celda con 'n' puntos<BR>&nbsp;&nbsp;&nbsp; vtkCellArray 
*cellarray=vtkCellArray::New();<BR>&nbsp;&nbsp;&nbsp; 
cellarray-&gt;InsertNextCell(data_puntos);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//&nbsp; Definición Geométrica y relación con la 
topología</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; vtkPoints 
*puntos=vtkPoints::New();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; for(int 
j=0;j&lt;data_puntos;j++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
cellarray-&gt;InsertCellPoint(j); // ___ j = nºID de cada 
punto<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
puntos-&gt;InsertPoint(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
j, // _________________________ nº 
ID<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
j/5.0, // _____________________ valor de 
"x"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sin(j/5.0), // ________________ valor de 
"y"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
0.0 // _________________________valor de 
"z"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
);}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//&nbsp; Agregado de información topológica y 
geométrica al DataSet</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; vtkPolyData 
*polydata=vtkPolyData::New();<BR>&nbsp;&nbsp;&nbsp; 
polydata-&gt;SetPoints(puntos);&nbsp;&nbsp; // Puntos<BR>&nbsp;&nbsp;&nbsp; 
polydata-&gt;SetLines(cellarray); // Celdas - 1(una)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
polydata-&gt;GetPointData()-&gt;SetScalars(puntos-&gt;GetData());<BR>&nbsp;&nbsp;&nbsp; 
polydata-&gt;GetPointData()-&gt;Update();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//&nbsp; Creación de un Actor</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; vtkXYPlotActor 
*actor=vtkXYPlotActor::New();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetXValuesToValue();<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetDataObjectXComponent(0,1);<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;SetDataObjectYComponent(0,2);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
actor-&gt;AddInput(polydata);<BR>&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2>// The following&nbsp;didn't help me enough... : ( 
</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
cout&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetInputList()-&gt;GetNumberOfItems()="&lt;&lt;actor-&gt;GetInputList()-&gt;GetNumberOfItems()&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetDataObjectXComponent(0)="&lt;&lt;actor-&gt;GetDataObjectXComponent(0)&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetDataObjectYComponent(0)="&lt;&lt;actor-&gt;GetDataObjectYComponent(0)&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetXValues()="&lt;&lt;actor-&gt;GetXValues()&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetXValuesAsString()="&lt;&lt;actor-&gt;GetXValuesAsString()&lt;&lt;endl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;&lt;"GetPointComponent(0)="&lt;&lt;actor-&gt;GetPointComponent(0);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//&nbsp; Creación de objetos de 
renderización</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; vtkRenderer 
*renderer=vtkRenderer::New();<BR>&nbsp;&nbsp;&nbsp; 
renderer-&gt;AddActor2D(actor);<BR>&nbsp;&nbsp;&nbsp; 
renderer-&gt;SetBackground(0.0,0.0,0.0);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; vtkRenderWindow 
*ventana=vtkRenderWindow::New();<BR>&nbsp;&nbsp;&nbsp; 
ventana-&gt;AddRenderer(renderer);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor 
*interac=vtkRenderWindowInteractor::New();<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;SetRenderWindow(ventana);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; ventana-&gt;Render(); // Inicio 
de la renderización<BR>&nbsp;&nbsp;&nbsp; 
interac-&gt;Initialize();<BR>&nbsp;&nbsp;&nbsp; interac-&gt;Start();&nbsp; // 
Inicia el "looping"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
polydata-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
puntos-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
cellarray-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
actor-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
renderer-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
ventana-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; interac-&gt;Delete();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; return 0;}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks in advance! 
Isidro.</FONT></DIV></DIV></BODY></HTML>