[vtkusers] pcl vtk line not drawing correctly
Tamim
tamim.boubou at gmail.com
Sun Mar 11 07:57:24 EDT 2018
Hello,
I want to draw a line with pcl which crosses a boxwidget from side to side
passing from the handles and the center point.....this is fairly simple and
I've done it like this :
pcl::PointXYZ first, last;
m_bounds = boxRep->GetBounds();
first.x = (m_bounds[1] + m_bounds[0]) / 2; // Beginning of the
line on the X axis.
first.y = m_bounds[2] ; // Beginning of the line on the Y
axis.
first.z = (m_bounds[5] + m_bounds[4]) / 2; // Beginning of the
line on the Z axis.
last.x = (m_bounds[1] + m_bounds[0]) / 2; // End of the line
on the X axis.
last.y = m_bounds[3] ; // End of the line on the Y axis.
last.z =(m_bounds[5] + m_bounds[4]) / 2; // End of the line on
the Z axis.
// Draw a line form first to last colored green with Id
"line1".
m_pclViewer->addLine(first, last, 0, 1, 0, "line1");
and there are a few statements to ensure that the bounds are always updated.
My problem is that when I rotate the box using my mouse and then drawing the
line ....it isn't drawn as supposed....instead ...it's always drawn parallel
to one of the axis (Y axis in this case...as displayed in the picture.)
<http://vtk.1045678.n5.nabble.com/file/t342290/Capture.png>
I printed the results on my output window and they are updated and displayed
correctly but the line is not.
Am I missing something here?
Any help please ?
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list