[Smtk-developers] Polygon model normals

David Thompson david.thompson at kitware.com
Tue Mar 15 13:26:42 EDT 2016


Hi all,

I've found what's causing the bad shading and small "holidays" when testing Yumin's shapefile importer (but not the other problem yet).

The problem is that the shapefile we are using doesn't have lat-long coordinates; instead it uses feet or meters in some datum plane. The values are quite large and the OpenGL library truncates point coordinates from doubles to floats before rendering. I hacked the polygon modeler to move the points near the origin and the dark/light triangles went away.

I can't commit the hack (it hardcoded a point coordinate in the polygon code), so how we handle this properly in SMTK and CMB is still an issue. Do you have any preferences? We could

1. Change the "import" operator to accept a "recenter model" item (maybe with an additional double-vector item specifying the new origin so that multiple models could be recentered to the same point?). This could require considerable knowledge on the user/app-developer to set up a processing pipeline.

2. Change the VTK source class to recenter points if the bounds are far from the origin relative to the box size. This would mean that things like the spreadsheet view will appear "off" with no real explanation. But SMTK would provide the correct coordinates.

3. Change VTK's mapper(s) to do recentering as in #2 above. This would be the least leaky abstraction.

4. Make our own CMB mapper. We probably need to do this anyway to handle things like glyphs, instances, and other special model geometry.

I like #3 the best, but it's a lot more work than #1 or #2 (and that work would be getting the change tested and approved, not coding the actual fix).

	David


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/smtk-developers/attachments/20160315/6a69f840/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-03-15 at 1.17.09 PM.png
Type: image/png
Size: 63381 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/smtk-developers/attachments/20160315/6a69f840/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-03-15 at 1.21.08 PM.png
Type: image/png
Size: 15941 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/smtk-developers/attachments/20160315/6a69f840/attachment-0003.png>


More information about the Smtk-developers mailing list