Difference in importing same size mesh

Hi there, Thanks everyone for my helping with my previou issue.

  1. I’m importing mesh from github.
  2. Mesh works fine with import and view in scene.
  3. I have one new model but even after adjusting camera radius, im not able to see it at center.(I do not know much about blender tool but I’m using mesh designed by designer and i feel it might be a mesh issue).

Here is pg link where mesh import and viewing in scene working fine : Babylon.js Playground

Here is a pg link for mesh having issue : Babylon.js Playground

Thanks in advnace

You can call scene.createDefaultCameraOrLight(true, true, true); after the meshes have been loaded. This way the camera will be created so that the scene is correctly centered:

Thanks @Evgeni_Popov, Is there any other way then calling camera after loading meshes?
And i have one query like, I have added texture image which is mapped on frame edges and i would like to have texture image at center material. How can i achive this?

You can do what createDefaultCamera is doing:

and set the properties of the camera accordingly, instead of creating it.

I’m not sure to understand that one, would you have a repro that would show the problem? Or maybe you want to use the texture properties, like uOffset / vOffset to move the texture over the mesh?

You could rescale your mesh to something reasonable. The issue comes from that this mesh is absolutely huge. Likely because of the scaling on export.
With these values, it will eventually fall out the maxZ radius of the camera defaults.
Here I scaled it down 200 times in this PG:

1 Like

There are still multiple issues here. First with your import declaration and the meshes you select from the import. Your root is called “root” (not “frame”). “frame” does not have any submeshes, so when you “const meshes = frame.meshes;”, the only mesh you get is the frame mesh. Look at the inspector to see the hierarchy. And I would kindly advise you would check back on this method of selecting children from the parent and also eventually unparent from this node and create a new parent that does not have an inverted z-axis.

The other problems for positioning your texture is that either your ‘printing area’ should be the size of your picture (without the frame) – or – the texture should match the size and ratio of your ‘printing area’, which is not the case here. So I did this quick fix in your PG by offseting and rescaling the texture so that it matches your ‘printing area’.
But then, I would rather advise to make the printing area mesh of the correct size and the ‘editable/printed image’ cropped to just the image (without the frame).

2 Likes