Jump to content

three.js to babylon.js


boris
 Share

Recommended Posts

Hi everyone,

first i just want to say that after more than a year working with three.js i have decided to migrate to babylonjs.

the frameworks looks great and this forum is a bog help.


background:

my scene is basiclly a house and furinture.

every mesh i load into my threejs scene has a position and rotation that its suppose to be in.

now, to migrate successfuly in need that the new scene (babylon) will look the same as the old scene (threejs).

i got two big problems:

1. the x-axis was inverted, so all my meshes was looking as if were mirroed (fixed it with mesh.scale.x = -1)

2. the position that i used in threejs for my meshes, is not the same as in babylon.js.

 

this is the original location of the sofa in three.js        Selection_004.jpg.f5c89d748ce2867d201d558dbc981c56.jpg

 

this is the location of the sofa in babylon.js (after i inverted the x-axis)

 Selection_005.jpg.b388321a6d7900383cfa63a6f306157f.jpg

 

 

can u please help me think of a way to migrate all the meshes to their right position?

Link to comment
Share on other sites

Hi and a warm welcome from me. Never worked with three.js so cannot answer your questions but may I make some suggestions that could help others answer your question.

1. Please tell us what you used to migrate from three to babylon.

2. The positions of the rooms and doors look to be in the right place. What is different about the sofa?

3. This is a simple playground http://www.babylonjs-playground.com/#1N8BHW. Would it be possible for you to set the position of the box to the position where you would expect the sofa to be. Then if possible add in the migrated sofa or if not create a new box and using the positions of the sofa as migrated show the new box.

Link to comment
Share on other sites

On 5/16/2017 at 7:00 PM, NasimiAsl said:

hi try enable scene.useRightHandedSystem = true; maybe that help

amazing!! 

saved the day. this fix it almost 100%.

the only thing left is to fix the x-axis and z-axis directions.

meaning,

foreach imported mesh, assign:

    mesh.position.x = originalLocation.z * (-1)

    mesh.position.z = originalLocation.x 

 

thanks a lot for ur help

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