vendor/ar.js
function updateUvs(modelViewMatrix, cameraProjectionMatrix){
		var transformedUv = new THREE.Vector3()
                originalsFaceVertexUvs[0].forEach(function(faceVertexUvs, faceIndex){
                        faceVertexUvs.forEach(function(originalUv, uvIndex){
                                // set transformedUv - from UV coord to clip coord
                                transformedUv.x = originalUv.x * 2.0 - 1.0;
                                transformedUv.y = originalUv.y * 2.0 - 1.0;
                                transformedUv.z = 0
        			// apply modelViewMatrix and projectionMatrix
        			transformedUv.applyMatrix4( modelViewMatrix )
        			transformedUv.applyMatrix4( cameraProjectionMatrix )
        			// apply perspective
        			transformedUv.x /= transformedUv.z
        			transformedUv.y /= transformedUv.z
                                // set back from clip coord to Uv coord
                                transformedUv.x = transformedUv.x / 2.0 + 0.5;
                                transformedUv.y = transformedUv.y / 2.0 + 0.5;
                                // copy the trasnformedUv into the geometry
                                cloakMesh.geometry.faceVertexUvs[0][faceIndex][uvIndex].set(transformedUv.x, transformedUv.y)
                        })
                })
        
                // cloakMesh.geometry.faceVertexUvs = faceVertexUvs
                cloakMesh.geometry.uvsNeedUpdate = true
        }
function updateUvs(modelViewMatrix, cameraProjectionMatrix){
		var transformedUv = new THREE.Vector3()
                originalsFaceVertexUvs[0].forEach(function(faceVertexUvs, faceIndex){
                        faceVertexUvs.forEach(function(originalUv, uvIndex){
                                // set transformedUv - from UV coord to clip coord
                                transformedUv.x = originalUv.x * 2.0 - 1.0;
                                transformedUv.y = originalUv.y * 2.0 - 1.0;
                                transformedUv.z = 0
        			// apply modelViewMatrix and projectionMatrix
        			transformedUv.applyMatrix4( modelViewMatrix )
        			transformedUv.applyMatrix4( cameraProjectionMatrix )
        			// apply perspective
        			transformedUv.x /= transformedUv.z
        			transformedUv.y /= transformedUv.z
                                // set back from clip coord to Uv coord
                                transformedUv.x = transformedUv.x / 2.0 + 0.5;
                                transformedUv.y = transformedUv.y / 2.0 + 0.5;
                                // copy the trasnformedUv into the geometry
                                cloakMesh.geometry.faceVertexUvs[0][faceIndex][uvIndex].set(transformedUv.x, transformedUv.y)
                        })
                })
        
                // cloakMesh.geometry.faceVertexUvs = faceVertexUvs
                cloakMesh.geometry.uvsNeedUpdate = true
        }
function updateUvs ( modelViewMatrix , cameraProjectionMatrix ) { var transformedUv = new THREE . Vector3 ( ) originalsFaceVertexUvs [ 0 ] . forEach ( function ( faceVertexUvs , faceIndex ) { faceVertexUvs . forEach ( function ( originalUv , uvIndex ) { // set transformedUv - from UV coord to clip coord transformedUv . x = originalUv . x * 2.0 - 1.0 ; transformedUv . y = originalUv . y * 2.0 - 1.0 ; transformedUv . z = 0 // apply modelViewMatrix and projectionMatrix transformedUv . applyMatrix4 ( modelViewMatrix ) transformedUv . applyMatrix4 ( cameraProjectionMatrix ) // apply perspective transformedUv . x /= transformedUv . z transformedUv . y /= transformedUv . z // set back from clip coord to Uv coord transformedUv . x = transformedUv . x / 2.0 + 0.5 ; transformedUv . y = transformedUv . y / 2.0 + 0.5 ; // copy the trasnformedUv into the geometry cloakMesh . geometry . faceVertexUvs [ 0 ] [ faceIndex ] [ uvIndex ] . set ( transformedUv . x , transformedUv . y ) } ) } ) // cloakMesh.geometry.faceVertexUvs = faceVertexUvs cloakMesh . geometry . uvsNeedUpdate = true }
update cloakMesh
update cloakMesh