A freecamera serialized and then loaded with inconsistent camera viewpoints

I need help ,
How to go about overcoming this problem?
Thanks!
Different perspectives before and after a free camera serialization
PG:

GLB file:
装载机_相机_1_1340.zip (35.6 KB)

step 1: load glb file


select glb file,load glb file

step 2: change camera and set view
change camera at line 60.


view is

step 3: serialize camera, load serialized camera, set activeCamera, view is not the same

serialize camera3, load serialized camera, set activeCamera

view is below. the view of step 2 is not the same,

Let me check what is happening :wink:

Ok this is because the camera has a parent but you are not restoring the parent of the serialized camera

Here is the fix:
A camera serialized and then loaded with inconsistent camera viewpoints | Babylon.js Playground

The address is for a local project(http://localhost:1338/#M9VRYX#1).
I need an online address.

If you change http://localhost:1338/ to https://playground.babylonjs.com/ you will get the online address https://playground.babylonjs.com/#M9VRYX#1

1 Like

The viewpoints of step2 and step3 are different, you need to look at them again.
Thanks!

I’m not seeing a difference:)

Added an alert before switching cameras to see the perspective change in comparison
Added an alert at line 57 in step 2 and at line 68 in step 3.
You can see the change in perspective by comparing
I need your help to overcome this problem.

Is there anything I can do to help me get over this?
Thanks!

Nope I’ll have a look right now

I found it! Thanks a lot for your patience @lxq100
Fix camera serialization by deltakosh · Pull Request #15965 · BabylonJS/Babylon.js

2 Likes