Orthographic Camera Passed from CatiaV5

Hi.

I have a problem that I don’t know if has solution or not.

I have a orthographic camera definiction passed from CatiaV5. The are the atributes of each camera:
cameraObject = {
“FOCUSDISTANCE”: 2906.27368164062,
“ORIGIN”: [33455.9375, -2037.81066894531, 851.877502441406],
“SIGHTDIRECTION”:[-0.934116881752021, 0.179355722148603, -0.308637613000156],
“UPDIRECTION”: [-0.30984654886689, 0.0219528933015584, 0.950533106541255]
}
My problem is that I am not able to match my THREE.OrthographicCamera.zoom with the view I see in Catia.
The point of view is equal but not the zoom applied.

This is what I do:
var sdir = new THREE.Vector3(
cameraObject.SIGHTDIRECTION[0],
cameraObject.SIGHTDIRECTION[1],
cameraObject.SIGHTDIRECTION[2],
);
var focusDistance = cameraObject.FOCUSDISTANCE
var deltaTarget = sdir.multiplyScalar(focusDistance);
var origin = new THREE.Vector3(
cameraObject.ORIGIN[0],
cameraObject.ORIGIN[1],
cameraObject.ORIGIN[2]
var target = origin.add(deltaTarget);
aCamera.lookAt(target);
oControls.target.copy(cameraObject.options.target);
oControls.update();
aCamera.position.set(origin.x, origin.y, origin.z);
aCamera.updateProjectionMatrix();
oControls.update();

If I use a THREE.PerspectiveCamera, even the point of view doesn’t match exactly because is a different projection, the zoom feeling is ok.

Best regards

A friendly suggestion: format your code :crocodile:

Also, I don’t know what “Catia” is or who V5 is, maybe give a give of context for that, I might not be alone :wink:

Hi.

Sorry about my post.

You are fully right, it is more human readable if it’s formatted.

About CATIA V5: CATIA - Wikipedia

Anyway finally I got how to addapt the camera proyection used from CATIa to THREEjs.

:slight_smile:

Best regards

1 Like