[vtkusers] Re: vtkusers digest, Vol 1 #1571 - 12 msgs

Mdl mdl78 at libero.it
Wed Feb 5 14:00:28 EST 2003


Hi everybody,

I am trying to display three orthogonal textured planes. I prepared 3
vtkImageActor, but I can see only the first, the one defined in the x-y
plane. In the help I read that the orientation of a vtkImageActor depends on
the input vtkImageData... but I don't understand how to orient it.


Here's some sample code:

// First image (XY)
legendaXY = vtkStructuredPoints::New();
legendaXY->SetNumberOfScalarComponents(3);    //RGB
legendaXY->SetScalarTypeToUnsignedChar();
legendaXY->SetExtent(0, 100, 0, 100, 0, 0);    // 100x100

for (i=0; i<100;  i++)
{
    for (j=0; j<100;  j++)
    {
        unsigned char *ijMapValueXY = (unsigned char*)
legendaXY->GetScalarPointer(i, j, 0);
        *ijMapValueXY = <some value>; // (R)
        ijMapValueXY++;
        *ijMapValueXY = <some value>; //  (G)
        ijMapValueXY++;
        *ijMapValueXY = <some value>; // (B)
    }
}

// Second plane (YZ)
legendaYZ = vtkStructuredPoints::New();
legendaYZ->SetNumberOfScalarComponents(3);    //RGB
legendaYZ->SetScalarTypeToUnsignedChar();
legendaYZ->SetExtent(0, 0, 0, 100, 0, 100);   //100x100
for (i=0; i<100;  i++)
{
    for (j=0; j<100;  j++)
    {
        unsigned char *ijMapValueYZ = (unsigned char*)
legendaYZ->GetScalarPointer(0, i, j);
        *ijMapValueYZ = <some value>; // (R)
        ijMapValueYZ++;
        *ijMapValueYZ = <some value>; //  (G)
        ijMapValueYZ++;
        *ijMapValueYZ = <some value>; // (B)
    }
}

// Prepare the actors
imageLegendaXY = vtkImageActor::New();
imageLegendaYZ = vtkImageActor::New();
imageLegendaXY->SetInput (legendaXY);
imageLegendaYZ->SetInput (legendaYZ);



Can anyone point me in the right direction?
Thanks in advance,

________________________________________

                            Marco Di Lorenzo
                    (dilorenzo.marco at inwind.it)
________________________________________

Tesista presso IAC-CNR di Roma
Istituto per le Applicazioni del Calcolo "M. Picone"
Viale del Policlinico, 137
00161, Roma
________________________________________





More information about the vtkusers mailing list