Quantcast
Viewing all articles
Browse latest Browse all 388

create a viewcube with multimaterial

Hi,

 

I create a ViewCube to inform the view of the window (front, back, top, bottom, left, right).  I apply a dynamic texture with a multimaterial. I used an orthographic camera to display the cube in the upper right hand corner with a layerMask. so far, all are well.
 
But I have some difficulty for submeshes portion of the cube that I do not fully understand.
 
this:
viewcube.subMeshes.push(new BABYLON.SubMesh(0, 0, verticesCount, 0, 4, viewcube));
viewcube.subMeshes.push(new BABYLON.SubMesh(1, 0, verticesCount, 4, 8, viewcube));
viewcube.subMeshes.push(new BABYLON.SubMesh(2, 0, verticesCount, 8, 12, viewcube));
viewcube.subMeshes.push(new BABYLON.SubMesh(3, 0, verticesCount, 12, 16, viewcube));
viewcube.subMeshes.push(new BABYLON.SubMesh(4, 0, verticesCount, 16, 20, viewcube));
viewcube.subMeshes.push(new BABYLON.SubMesh(5, 0, verticesCount, 20, 24, viewcube));
Could you help me please you. I create the sample on the playground to reproduce what I have done so far.

 

http://www.babylonjs-playground.com/#1Z5260

 

Thanks for help


Viewing all articles
Browse latest Browse all 388

Trending Articles