Jump to content

Combining Meshes / SubMeshes


Hazardus
 Share

Recommended Posts

I'm trying to wrap my head around submeshes so that I can built something similar to BABYLON.Mesh.MergeMeshes, but maintain separation via sub-meshes and materials via mutlimaterial

 

In this PG, http://www.babylonjs-playground.com/#28EUMN#21, I cannot seem to comprehend the relationship of indexStart and indexCount

 

The same goes for this PG, http://www.babylonjs-playground.com/#1FSS3J - how do I color both faces of the Y axis?

Link to comment
Share on other sites

Somewhat. In the 2nd PG example, how would I go about making the positive Y face(s) green as well? I think this would help clear it up for me.

 

I expected this to work:

var submesh1 = new BABYLON.SubMesh(0, 0, verticesCount, 0, 12, box);var submesh2 = new BABYLON.SubMesh(1, 0, verticesCount, 12, 12, box);var submesh3 = new BABYLON.SubMesh(2, 0, verticesCount, 24, 12, box);

24 vertices & 36 indices total

 

 

Scratch that, I copied from another PG example and didn't notice it was using emissiveColor. It does show it working as expected now that it's diffuseColor: http://www.babylonjs-playground.com/#1FSS3J#1

 

The sphere one was tricky to me because of the numbers it used. I understand now the numbers depend on the segments used in the sphere. Here's a PG with even numbers! http://www.babylonjs-playground.com/#28EUMN#22

 

Thanks for helping me clear this up! :)

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