Jump to content

BABYLON.SceneLoader.ImportMesh & setting camera.maxZ and camera.minZ


Visam
 Share

Recommended Posts

Hi

I am importing a scene from .babylon file usung the method BABYLON.SceneLoader.ImportMesh

What is the best way to calculate camera.maxZ and camera.minZ for the loaded mesh?

What is the best way to recalculate camera.maxZ and camera.minZ during zoomin in/out to avoid clipping the mesh?

Brg

Mikhail

Link to comment
Share on other sites

Hi iTekVR, (is the "i" coming from the apple i, or the "me" i? or maybe from high-tech? Just wodnering)

 It depends on many many factors.

The size of your mesh, it's scaling, the distance of the camera from the object, how many other objects are there, would you actually like to have some clipping?

The way I see it - if you just loaded your mesh, you look at it, and it is clipped, something is wrong. Your units might be wrong. Before playing around with z clipping, try scaling your mesh down a bit, try positioning your camera somewhere else, see if that helps. 

But! without seeing what you are actually seeing, it will be very hard to give a proper answer.

 

Link to comment
Share on other sites

3 minutes ago, RaananW said:

Hi iTekVR, (is the "i" coming from the apple i, or the "me" i? or maybe from high-tech? Just wodnering)

 It depends on many many factors.

The size of your mesh, it's scaling, the distance of the camera from the object, how many other objects are there, would you actually like to have some clipping?

The way I see it - if you just loaded your mesh, you look at it, and it is clipped, something is wrong. Your units might be wrong. Before playing around with z clipping, try scaling your mesh down a bit, try positioning your camera somewhere else, see if that helps. 

But! without seeing what you are actually seeing, it will be very hard to give a proper answer.

 

Hi RaananW

Thank you for you answer.

I am using FbxExporter.exe to convert FBX file ( https://www.dropbox.com/s/rr8k9brbgdv1e9x/M20.fbx?dl=0 ) to Babylon file ( https://www.dropbox.com/s/381modoxlyivrx2/M20.babylon?dl=0 ). Trying to load the babylon file to the SandBox http://www.babylonjs.com/sandbox/
One problem is clipping the model when I am starting to use arrow buttons. Another one is orientation of the model. If I am opening the original (FBX) file using NavisWorks, I can see the correct orientation.

 

brg

Mikhail

Link to comment
Share on other sites

12 minutes ago, RaananW said:

I find it odd that the orientation is wrong. About the clipping, the model is probably really big. Which is relative, of course. Try scaling it down, it'll look the same but will avoid the clipping

If I will scale the model, probably measurements between two points will give me wrong result. We are in the engineering (CAD) area that is why we have to have real coordinates. Accuracy is very important for us. Any other ideas to avoid the clipping?

It seems that orientations in NavisWorks and Babylon are different.

Link to comment
Share on other sites

27 minutes ago, RaananW said:

I find it odd that the orientation is wrong. About the clipping, the model is probably really big. Which is relative, of course. Try scaling it down, it'll look the same but will avoid the clipping

RaananW

if I am loading the same FBX model (before conversion to Babylon format) to Autodesk A360 Viewer ( https://a360.autodesk.com/viewer/ , "Upload your design" button), I can see the correct clipping and orientation. I am just trying to set correct clipping and orientation in Babylon to have the same result in Babylon:):):)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...