[vtkusers] How to recalculate a matrix of parts of vtkAssembly?

Kacper Pluta kacper.pluta at gmail.com
Thu Aug 25 14:26:49 EDT 2011


I prepared a program(You can compile it right away.) that demonstrates my
problem. Main part looks like.


/*********Start of code describing the problem.***************************/
  //Send to the output the actual coordinates of last Item in vtkAssembly
  std::cout << "X min " <<  *root->GetLastProp3D()->GetXRange() << " X max "
<< *(root->GetLastProp3D()->GetXRange()+1) << " Y min " <<
*(root->GetLastProp3D()->GetYRange()) << " Y max " <<
*(root->GetLastProp3D()->GetYRange()+1) << std::endl;

  double *orientation = root->GetLastProp3D()->GetOrientation();

  //Send to the output the actual orientation of last Item in vtkAssembly
  std::cout << "Orientation " << *orientation << " " << *(orientation+1) <<
" " <<  *(orientation+2) << std::endl;

  //Change orientation of whole vtkAssembly structure
  Tree->SetOrientation(90,35,45);
  Tree->SetPosition(0,2,1);
  orientation = root->GetLastProp3D()->GetOrientation();

  //Send to the output the new coordinates of last Item in vtkAssembly
  std::cout << "X min " <<  *root->GetLastProp3D()->GetXRange() << " X max "
<< *(root->GetLastProp3D()->GetXRange()+1) << " Y min " <<
*(root->GetLastProp3D()->GetYRange()) << " Y max " <<
*(root->GetLastProp3D()->GetYRange()+1) << std::endl;
  //Send to the output  the new orientation of last Item in vtkAssembly
  std::cout << "Orientation " << *orientation << " " << *(orientation+1) <<
" " <<  *(orientation+2) << std::endl;
  //Why nothing has changed?

 /*********End of code describing the problem.***************************/



2011/8/24 Kacper Pluta <kacper.pluta at gmail.com>

> When a rotate vtkAssembly parts of it have old coordinate value. How can
> force recalculate it?
>
> --
> "If you build your empire on money, it'll fall like a house of cards, if
> you build it on love, you've built Taj Mahal!" - Mark Hartmaier
>
>


-- 
"If you build your empire on money, it'll fall like a house of cards, if you
build it on love, you've built Taj Mahal!" - Mark Hartmaier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110825/f4be1dbb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tree.zip
Type: application/zip
Size: 1846 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110825/f4be1dbb/attachment.zip>


More information about the vtkusers mailing list