bodleian / archiox-mirador-plugin

An experimental plugin to display depth information captured with Lucida or Selene scanners from FactumARTE. However, the plug-in can present any normal map/albedo map combination produced from any technique.
MIT License
1 stars 0 forks source link

Image Tools Flip doesn't work #86

Closed BeebBenjamin closed 2 months ago

BeebBenjamin commented 9 months ago

The plug-in is incompatible with image tools flip.

BeebBenjamin commented 9 months ago

This isn't anything we're doing wrong. This is a bug in OSD.

https://github.com/openseadragon/openseadragon/issues/1614

BeebBenjamin commented 9 months ago

We can partially implement a flip of the threejs canvas, but we cannot keep the overlay in the correct position until OSD is fixed!

BeebBenjamin commented 9 months ago

We can add a double sided material as follows:

plane_material = new THREE.MeshPhongMaterial({
            map: albedoMap,
            normalMap: normalMap,
            flatShading: true,
            normalScale: new THREE.Vector3(1, 1),
            side: THREE.DoubleSide,
});

and then flip the x positions as follows:

mesh.position.set(-x, this.props.intersection.height - y, 0);
mesh.scale.x = -1;
BeebBenjamin commented 2 months ago

I have patched our build copy of OpenSeadragon, and put in a PR for the change to the main repo.

BeebBenjamin commented 2 months ago

The fix negates the need for us to have to flip our scales, we just need to make sure out normals are orientated correctly on rotate or flip.

BeebBenjamin commented 2 months ago

The above is fixed and the issue with lighting being updated is also addressed.