[vtkusers] 3D Visualization of Map Data
Malcolm Drummond
malcolm at geode.co.za
Fri Feb 3 03:18:12 EST 2006
Hi Ron
One approach would be to run an elevation filter on your 3D map (to create scalar values) and then a transform with scale set to 1.0,1.0,0.0 which will set all your z values to 0.0. Then probe this dataset with your overlay features (which are at elevation 0.0) and run the output through vtkWarpScalars (to apply the sampled elevations to your overlay). The only problem is that sampling will only take place at points defined in your overlay dataset and the result may not look good due to non-sampled intersections with your 3D map. Adding some extra elevation to your overlay may fix this.
Ultimately, for a perfect fit, you need to find all intersections between your overlay features and edges of your 3D triangulation (in 2D projection) and insert these into your overlay features before the sampling process. I don't know if there is a filter to do this in vtk (I'm a bit rusty). If there isn't, this wouldn't be too hard to implement with a sweep algorithm - but the insertions would require a lot of book-keeping.
HTH
Malcolm Drummond
----- Original Message -----
From: Ron Chapman
To: vtkusers at vtk.org
Sent: Thursday, February 02, 2006 11:53 PM
Subject: [vtkusers] 3D Visualization of Map Data
I have been trying to get VTK to plot 3D map data, but am running into some problems.
Read x,y,z file into points
Manually create polygons from this and store cells in vtkPolyData
vtkPolyDataNormals
vtkPolyDataMapper
vtkActor
This works fine and I can see my map in 3D
I then need to overlay this 3D base map with roads, rivers, cut lines, etc. which are stored in ESRI shape files. I have been these shape files using vtkShapefileReader (this was created by Malcolm Drummond of this group). Essentially it creates a bunch of vtkPolyLines in 2D.
My problem occurrs when I try and map the 2D vtkPolyLine Data onto the 3D Surface and am not sure how to do this.
I've read numerous posts discussing texture mapping and originally was thinking of transforming the 2D data into an image, and then texture mapping onto my 3D surface. I'm not sure this is the correct approach and was wondering if there is a better way of doing this?
Ron
------------------------------------------------------------------------------
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060203/c6cd36a9/attachment.htm>
More information about the vtkusers
mailing list