I've been looking at the recently uploaded files on Commons, and it seems a lot of files render very funny because they have backfaces that really should be visible.
Examples:
- Entire model is "inside out". Ideally, all of the polygons should have their normals inverted, so that they face opposite direction, but in many 3D editors this is apparently not a problem.
- https://commons.wikimedia.org/wiki/File:Icosahedron.stl (try rotating it in 3D viewer… freaky)
- https://commons.wikimedia.org/wiki/File:Tetrahedron.stl
- https://commons.wikimedia.org/wiki/File:Wicipedia_Cymraeg_2.stl (only the old, first version)
- The model is not really a closed model, but just a "surface". (Or alternatively, it has "holes" in it.)
These would display in a much more intuitive way if the viewer enabled backface visibility. With three.js, apparently you have to pass side: THREE.DoubleSide to the MeshPhongMaterial constructor. I tested this with this hack in JS console:
mw.mmv.ThreeD.prototype.geometryToObject = function ( geometry ) { var material = new THREE.MeshPhongMaterial( { color: 0xf0ebe8, shininess: 5, flatShading: true, side: THREE.DoubleSide } ); return new THREE.Mesh( geometry, material ); };
…but I'm not sure where else this would have to be changed to apply to server-generated thumbnails too.