Correct Babylon to Blender camera transfering

Hello !
I’m having the following case,
I’ve exported a full scene into glb file ( without cameras)
and imported it in Blender . ( all works perfectly fine)

My goal is to convert a babylon Perspective Camera properties into a camera object in blender.

i already have the parameters from babylon camera ( radius , target, rotation, alpha and beta . but I don’t quite understand the coordinate system differences between babylonjs , and blender .

have anyone faced such case?

Sure. Happens all the time :grin:
You can see right-handed to left-handed conversion in the root node created when importing from i.e. blender to BJS.

Right to left is: Math.PI on the y.rotation and an inverted z-axis.

1 Like

my case is the opposite, i want to place a camera made in BJS to blender.

Well, opposite is the opposite :grin: Where -Z becomes +Z; where the rotation of Math.PI on the y-axis to translate from plus Z to minus Z is no longer applicable (should be removed).

Edit: sorry the rotation stands if you create your cam with -Z and convert it to+Z. It’s still Math.PI or -Math.PI which basically does the same.

Edit1: I haven’t tried it with an arc rotate camera, but if I follow the logic you should try simply invert the Z position of the camera. Since the target will always remain the target (unless it’s a vector in which case you should also invert the target z coordinates, I suppose). And if it looks at the target from behind, make a half revolution on the alpha.

Also Blender uses the Z axis as up while Babylon uses the Y axis :slight_smile:

1 Like