Search code examples
imagewebglmeshxtkparaview

Different mesh visualization WebGL


I'm wondering why the mesh in lesson 10 looks more three-dimensional then mine. My meshes look like they have no surface and no depth. Here is an example picture:

enter image description here

Any suggestions? I don't see if there is a difference in loading the meshes (xtk's version compared to mine). I think it doesn't depend on the (type of) data because in ParaView it looks more three-dimensional.


Solution

  • It is because your mesh files have no normals. Paraview will create normals if you don't provide it - not XTK -

    You can generate normals for your meshes fairly easily with VTK: http://www.vtk.org/doc/nightly/html/classvtkPolyDataNormals.html

    1-vtkPolyDataReader 2-vtkPolyDataNormals 3-vtkPolyDataWriter

    Maybe you can export the meshes from Paraview or Slicer? Maybe the exported meshes will contain the normals...