<!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><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 the x-y components in the values array, the system 
draws the "arc sin" function. I don't know how to understand this; Am 
I wrong? or the system swap components?</FONT></DIV>
<DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here's the code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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> </DIV>
<DIV><FONT face=Arial size=2>int main(){</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>//  CONSOLE: how many points entry to 
form the "line".</FONT></DIV>
<DIV><FONT face=Arial size=2>//  CONSOLA: Ingreso de la cantidad de puntos 
que formarán la "curva".</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>    int 
data_puntos;<BR>    cout<<"Ingrese cantidad de puntos 
(1-50): ";<BR>    cin>>data_puntos;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>//  Creación de una Celda - Definición 
topológica y geométrica</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>//  Definición Topológica<BR>//  
Inserción de 1(una) celda con 'n' puntos<BR>    vtkCellArray 
*cellarray=vtkCellArray::New();<BR>    
cellarray->InsertNextCell(data_puntos);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>//  Definición Geométrica y relación con la 
topología</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    vtkPoints 
*puntos=vtkPoints::New();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    for(int 
j=0;j<data_puntos;j++){<BR>        
cellarray->InsertCellPoint(j); // ___ j = nºID de cada 
punto<BR>        
puntos->InsertPoint(<BR>              
j, // _________________________ nº 
ID<BR>              
j/5.0, // _____________________ valor de 
"x"<BR>              
sin(j/5.0), // ________________ valor de 
"y"<BR>              
0.0 // _________________________valor de 
"z"<BR>              
);}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>//  Agregado de información topológica y 
geométrica al DataSet</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    vtkPolyData 
*polydata=vtkPolyData::New();<BR>    
polydata->SetPoints(puntos);   // Puntos<BR>    
polydata->SetLines(cellarray); // Celdas - 1(una)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    
polydata->GetPointData()->SetScalars(puntos->GetData());<BR>    
polydata->GetPointData()->Update();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>//  Creación de un Actor</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    vtkXYPlotActor 
*actor=vtkXYPlotActor::New();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    
actor->SetXValuesToValue();<BR>    
actor->SetDataObjectXComponent(0,1);<BR>    
actor->SetDataObjectYComponent(0,2);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    
actor->AddInput(polydata);<BR>    </FONT></DIV>
<DIV><FONT face=Arial size=2>// The following didn't help me enough... : ( 
</FONT></DIV>
<DIV><FONT face=Arial size=2>    
cout<<endl<BR>        
<<"GetInputList()->GetNumberOfItems()="<<actor->GetInputList()->GetNumberOfItems()<<endl<BR>        
<<"GetDataObjectXComponent(0)="<<actor->GetDataObjectXComponent(0)<<endl<BR>        
<<"GetDataObjectYComponent(0)="<<actor->GetDataObjectYComponent(0)<<endl<BR>        
<<"GetXValues()="<<actor->GetXValues()<<endl<BR>        
<<"GetXValuesAsString()="<<actor->GetXValuesAsString()<<endl<BR>        
<<"GetPointComponent(0)="<<actor->GetPointComponent(0);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>//  Creación de objetos de 
renderización</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    vtkRenderer 
*renderer=vtkRenderer::New();<BR>    
renderer->AddActor2D(actor);<BR>    
renderer->SetBackground(0.0,0.0,0.0);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    vtkRenderWindow 
*ventana=vtkRenderWindow::New();<BR>    
ventana->AddRenderer(renderer);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    vtkRenderWindowInteractor 
*interac=vtkRenderWindowInteractor::New();<BR>    
interac->SetRenderWindow(ventana);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    ventana->Render(); // Inicio 
de la renderización<BR>    
interac->Initialize();<BR>    interac->Start();  // 
Inicia el "looping"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>    
polydata->Delete();<BR>    
puntos->Delete();<BR>    
cellarray->Delete();<BR>    
actor->Delete();<BR>    
renderer->Delete();<BR>    
ventana->Delete();<BR>    interac->Delete();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>    return 0;}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance! 
Isidro.</FONT></DIV></DIV></BODY></HTML>