.makeShear (x: Float, y: Float, z: Float): это
х - величина сдвига по оси X.
y - величина сдвига по оси Y.
z - величина сдвига по оси Z.
Устанавливает эту матрицу как преобразование сдвига:
1, y, z, 0,
х, 1, з, 0,
х, у, 1, 0,
0, 0, 0, 1
https://threejs.org/docs/#api/en/math/Matrix4
Я думаю, что .makeShear может быть решением.
------ ДОБАВЛЕНО -----
/
/
/
/
У кого-нибудь есть опыт отслеживания прямоугольного маркера в AR.js?
Я продолжаю мозговые штурмы по мере продвижения.
Если кто-то сможет внести свой вклад, я бы хотел услышать, что вы думаете.
Мне удалось заставить AR.js отследить прямоугольный маркер, что, впрочем, понятно, потому что маркер сообщает камере угол и перспективу для принятия, моя сцена three.js деформирована / перекошена
![enter image description here](https://i.stack.imgur.com/8KN2h.jpg)
Можно ли как-то отредактировать параметры камеры, чтобы противодействовать измененной перспективе?
Например, я искал в "../build/ar.js'
//
ARjs.MarkerControls.prototype.updateWithModelViewMatrix = function(modelViewMatrix){
var markerObject3D = this.object3d;
// mark object as visible
markerObject3D.visible = true
if( this.context.parameters.trackingBackend === 'artoolkit' ){
// apply context._axisTransformMatrix - change artoolkit axis to match usual webgl one
var tmpMatrix = new THREE.Matrix4().copy(this.context._artoolkitProjectionAxisTransformMatrix)
tmpMatrix.multiply(modelViewMatrix)
modelViewMatrix.copy(tmpMatrix)
}else if( this.context.parameters.trackingBackend === 'aruco' ){
// ...
}else if( this.context.parameters.trackingBackend === 'tango' ){
// ...
}else console.assert(false)
console.log('markerObject3D ',markerObject3D.matrix);
console.log('modelViewMatrix',modelViewMatrix);
if( this.context.parameters.trackingBackend !== 'tango' ){
// change axis orientation on marker - artoolkit say Z is normal to the marker - ar.js say Y is normal to the marker
var markerAxisTransformMatrix = new THREE.Matrix4().makeRotationX(Math.PI/2)
modelViewMatrix.multiply(markerAxisTransformMatrix)
}
// change markerObject3D.matrix based on parameters.changeMatrixMode
if( this.parameters.changeMatrixMode === 'modelViewMatrix' ){
markerObject3D.matrix.copy(modelViewMatrix)
}else if( this.parameters.changeMatrixMode === 'cameraTransformMatrix' ){
markerObject3D.matrix.getInverse( modelViewMatrix )
}else {
console.assert(false)
}
// decompose - the matrix into .position, .quaternion, .scale
markerObject3D.matrix.decompose(markerObject3D.position, markerObject3D.quaternion, markerObject3D.scale)
// dispatchEvent
this.dispatchEvent( { type: 'markerFound' } );
}