Skip to content

fix cube winding order (face previously points inward)

Stephen McDowell requested to merge (removed):master into master

I think VTK does double sided rendering, you can see this outside of VTK (at least how I caught it) by exporting it and importing it. Quick export code:

diff --git a/src/Cxx/GeometricObjects/Cube.cxx b/src/Cxx/GeometricObjects/Cube.cxx
index bb227d16eaa..37c2f7cc026 100644
--- a/src/Cxx/GeometricObjects/Cube.cxx
+++ b/src/Cxx/GeometricObjects/Cube.cxx
@@ -11,6 +11,7 @@
 #include <vtkRenderWindow.h>
 #include <vtkRenderWindowInteractor.h>
 #include <vtkRenderer.h>
+#include <vtkGLTFExporter.h>
 
 #include <array>
 
@@ -85,6 +86,13 @@ int main(int, char*[])
 
   // interact with data
   renWin->Render();
+
+  vtkNew<vtkGLTFExporter> gltf_exporter;
+  gltf_exporter->InlineDataOn();
+  gltf_exporter->SetRenderWindow(renderWindow);
+  gltf_exporter->SetFileName("output.gltf");
+  gltf_exporter->Write();
+
   iren->Start();
 
   return EXIT_SUCCESS;

And then load up output.gltf to e.g., https://gltf-viewer.donmccurdy.com/

Updated Cxx and Python, did not run Python, did not see this example in the other language sets. Hope I didn't miss anything!

Merge request reports

Loading