[vtkusers] transformation matrix

Naim naim at electromagneticworks.com
Mon Nov 20 16:02:10 EST 2006


Hi vtkUsers,

I have a transformation matrix (m_OpenGLmatrix) from software (I) and I
apply it to software (II) using the vtk library like this:

vtkTransform* transform = vtkTransform::New();
transform->Identity();
transform->PostMultiply();
transform->SetMatrix(m_OpenGLmatrix);

pCamera->ApplyTransform(transform);

Just the rotation is correct, but the position and the scale are wrong.
Any idea?

Thanks,

Naim Himrane
Electromagneticworks Inc.


-----Original Message-----
From: vtkusers-bounces+naim=electromagneticworks.com at vtk.org
[mailto:vtkusers-bounces+naim=electromagneticworks.com at vtk.org] On Behalf Of
Tina Dong
Sent: November 20, 2006 1:40 PM
To: vtkusers at vtk.org
Subject: [vtkusers] vtkCutter with vtkStructuredGrid result 0 points

Hi,

I'm relatively new to vtk, and I'm trying to cut an structured grid  
with vtkCutter to get a plane. With the following code, I get 0  
points in the planeCut output. Any idea what I'm doing wrong?

Thanks,
Tina


vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
vtkIntArray *vectors = vtkIntArray::New();
vectors->SetNumberOfComponents(3);
points->Allocate(64*64);

// inserting points and tuples

vtkPlane *plane = vtkPlane::New();
plane->SetOrigin(sgrid->GetCenter());
plane->SetNormal(1,0,0);
cout << "sgrid number " << sgrid->GetNumberOfPoints() << endl;

vtkCutter  *planeCut = vtkCutter::New();
planeCut->SetInput(sgrid);
planeCut->SetCutFunction(plane);
planeCut->Update();

cout << "number" << planeCut->GetOutput()->GetNumberOfPoints() << endl;

_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list