Jump to content

Everything of model is reversed after it is loaded into Babylon


Skybox
 Share

Recommended Posts


Can I ask you some questions about Babylon.js? 

I am in trouble with loading things into Babylon. First, I exported the model to obj. Then I load it to babylon but to find everything of model is reversed.

I used the software called 3dmax to export obj file directly. The result as shown in pictures appeared after using babylon.objFileLoader.js to load it. Everything in scene is reversed. But if I export babylon file directly using 3dmax, everything is right after loading.

I will really appreciate it if you can help solve my problem. Thx.

QQ图片20170315162812.png

QQ图片20170315160158.png

Link to comment
Share on other sites

4 hours ago, Deltakosh said:

Hey!

How do you produce your babylon file?

Hi. I used the software called 3dmax to export obj file directly. The result as shown in pictures appeared after using babylon.objFileLoader.js to load it. Everything in scene is reversed. But if I export babylon file directly using 3dmax, everything is right after loading.

Link to comment
Share on other sites

50 minutes ago, Skybox said:

Hi. I used the software called 3dmax to export obj file directly. The result as shown in pictures appeared after using babylon.objFileLoader.js to load it. Everything in scene is reversed. But if I export babylon file directly using 3dmax, everything is right after loading.

Then why dont you just use .babylon exporter and throw objLoader.

Link to comment
Share on other sites

@Skybox :  I think @Temechon is correct some normals are not correct.as well as the scene being flipped from left to right.

In the image below I have taken a snapshot of the two picture frames on the top shelf. A is from your max shot, B is from your object export/import into BJS. Note how you can see the frame at the back in B through the frame at the front. There are normals facing the wrong way.

There are other examples if you look carefully. Did you create the scene objects yourself or build it from imported meshes? The latter can lead to issues with normals - depending on the source files.:o

As @MasterK : says why not use the 3Dmax babylon exporter? The .obj format has been around a long time - but in my experience can produce odd results depending on who wrote the exporter. :wacko:

cheers, gryff :)

object_issue1.png

Link to comment
Share on other sites

1 hour ago, gryff said:

@Skybox :  I think @Temechon is correct some normals are not correct.as well as the scene being flipped from left to right.

In the image below I have taken a snapshot of the two picture frames on the top shelf. A is from your max shot, B is from your object export/import into BJS. Note how you can see the frame at the back in B through the frame at the front. There are normals facing the wrong way.

There are other examples if you look carefully. Did you create the scene objects yourself or build it from imported meshes? The latter can lead to issues with normals - depending on the source files.:o

As @MasterK : says why not use the 3Dmax babylon exporter? The .obj format has been around a long time - but in my experience can produce odd results depending on who wrote the exporter. :wacko:

cheers, gryff :)

object_issue1.png

Thx. I will consider your advice:)

Link to comment
Share on other sites

1 hour ago, gryff said:

@Skybox :  I think @Temechon is correct some normals are not correct.as well as the scene being flipped from left to right.

In the image below I have taken a snapshot of the two picture frames on the top shelf. A is from your max shot, B is from your object export/import into BJS. Note how you can see the frame at the back in B through the frame at the front. There are normals facing the wrong way.

There are other examples if you look carefully. Did you create the scene objects yourself or build it from imported meshes? The latter can lead to issues with normals - depending on the source files.:o

As @MasterK : says why not use the 3Dmax babylon exporter? The .obj format has been around a long time - but in my experience can produce odd results depending on who wrote the exporter. :wacko:

cheers, gryff :)

object_issue1.png

The reason that I do with obj is that I want to compatible with this format.Because some models only have obj format rather than 3Dmax.

The problem on the normals is acceptable but flipping is not. What I really want to solve is a matter of flipping.

Thx again.

Link to comment
Share on other sites

This looks like a coordinate system issue to me. By default BabylonJs uses a left handed system but modeling software usally uses a right handed sytem.
That means your obj is also right handed.
You can try to enabled the right handed system in BabylonJs before importing the model like this:
scene.useRightHandedSystem = true;

Link to comment
Share on other sites

1 hour ago, Kesshi said:

This looks like a coordinate system issue to me. By default BabylonJs uses a left handed system but modeling software usally uses a right handed sytem.
That means your obj is also right handed.
You can try to enabled the right handed system in BabylonJs before importing the model like this:
scene.useRightHandedSystem = true;

Thx so much. You have perfectly helped solve my problem.:D

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...