Update Z-up to Y-up conversion matrix in App.tsx to correct axis orientation. Remove default camera view rendering from Scene component to streamline camera setup.

This commit is contained in:
2025-03-26 10:19:35 +08:00
parent 6406dbd19f
commit d46b5ca3d6

View File

@ -24,8 +24,8 @@ const CV_TO_GL_MAT = new THREE.Matrix4().set(
// Z-up to Y-up conversion matrix // Z-up to Y-up conversion matrix
// Rotate -90 degrees around X axis to convert from Z-up to Y-up // Rotate -90 degrees around X axis to convert from Z-up to Y-up
const Z_UP_TO_Y_UP = new THREE.Matrix4().set( const Z_UP_TO_Y_UP = new THREE.Matrix4().set(
1, 0, 0, 0, -1, 0, 0, 0,
0, 0, 1, 0, 0, 0, -1, 0,
0, -1, 0, 0, 0, -1, 0, 0,
0, 0, 0, 1 0, 0, 0, 1
) )
@ -210,7 +210,6 @@ const Scene = () => {
const far = (1 / fov_x) * 20 const far = (1 / fov_x) * 20
return <CameraViewFromExtrinsic key={key} name={`${key}(${fov_x.toFixed(1)})`} extrinsic={preProcessExtrinsic(value)} fov={fov_x} aspect={IMAGE_WIDTH / IMAGE_HEIGHT} far={far} /> return <CameraViewFromExtrinsic key={key} name={`${key}(${fov_x.toFixed(1)})`} extrinsic={preProcessExtrinsic(value)} fov={fov_x} aspect={IMAGE_WIDTH / IMAGE_HEIGHT} far={far} />
})} })}
<CameraViewFromExtrinsic name="default" extrinsic={DEFAULT_TRANSFORMATION_MATRIX} fov={60} aspect={IMAGE_WIDTH / IMAGE_HEIGHT} far={0.4} />
<Axes /> <Axes />
</group>) </group>)
return ( return (