Jump to content

Question objfileloader Multimaterial


renjianfeng
 Share

Recommended Posts

I tried to import the obj file, and obj contained a number of posts, but in babylonjs, it seemed that each child's map was replaced with the last one.


I looked at the console, and the network window shows these stickers loaded.

QQ图片20180313160844.png


Here's the demo:http://www.babylonjs-playground.com/#E5KRAX

The correct effect should be:

blender:

D0D7B906-E0ED-44d9-A009-4FDDE0216291.png

 

threejs:

D10C1A6F-FEA3-4a49-BBC8-E17B9AB4EA4F.png

 

babylonjs:(The wrong)

 

asdasd.png

 

Link to comment
Share on other sites

hi @renjianfeng,

the OBJ file you pasted has no group or object definitions (keys 'o' and 'g'), which prevents babylon from knowing which mesh is which. Babylon will use the entire vertex data you provided and will convert it to a single mesh with one material. is it possible for you to export mesh names as well? if you use blender, it is the option to export "Objects as OBJ Objects", or "Groups", both should actually work.

 

Link to comment
Share on other sites

9 hours ago, Deltakosh said:

If you are in Blender, why not directly using the .babylonjs format? It will be far better than obj

Yes, but all the models currently are in.obj format, and the number is very large. I can only use a method that can be used in batches.:(

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