[vtkusers] Model and world coordinate transformations

Elvis Dowson elvis.dowson at mac.com
Fri Oct 10 15:57:55 EDT 2008


Hi,
        I am trying to understand what goes on behind the scenes and  
what to take care of, when importing data into VTK, displaying objects  
and measuring them using a distance widget.

I just need a second opinion to confirm that I am on the right track.  
I've done computer graphics as a subject in engineering, plus read the  
Computer Graphics Book by Van Damme and Foley, so I've read the theory  
ages ago, but I just need to check if I'm on the right track with what  
I'm assuming is happening in VTK.

This is because distance measurement and measurement accuracy is very  
important in the application prototype that I am trying to construct.

Suppose I model a triangle as follows:

vtkPoints trianglePoints
   trianglePoints SetNumberOfPoints 3
   trianglePoints InsertPoint 0 0 0 0
   trianglePoints InsertPoint 1 1 0 0
   trianglePoints InsertPoint 2 .5 .5 0

This would imply that the x axis distance between point 0 and point 1  
will be 1 unit.

Question 1: If I add this triangle actor to a renderer and render the  
scene, straight away, am I correct in saying that if no model to world  
transformations were applied, the triangle will retain all its  
original physical dimensions? When I attempted to use the  
vtkDistanceWidget to measure the distance between point 0 and point 1,  
it approximately showed 1.0.


Question 2: If I were to scale the triangle to half it's original  
size, at which point should I apply the model to world coordinate  
transformation?

In the above example, the triangle is represented as an unstructured  
grid.

Should I first pass it to a data set mapper, generate the polygonal  
data and then apply, say a scaling transformation, so that the  
distance between point 0 and point 1 is reduce to 0.5?

Best regards,

Elvis Dowson 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081010/b6553a0c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Triangle with distance measurement.jpg
Type: image/jpeg
Size: 41947 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081010/b6553a0c/attachment.jpg>


More information about the vtkusers mailing list