Subin George Posted June 19, 2014 Share Posted June 19, 2014 Please find my multi texture sphere implementation at http://www.babylonjs.com/playground/#KDRY0. Now I would like add actions to each of the colors in the sphere, or simply adding event handler with each sub meshes. But its not working.for(i=0;i<data.length;i++){ var currentRowSize = Math.round(data[i] * individualOffset) * rowSize; // Just adding remaing space to last item if(i == data.length-1){ currentRowSize = rowCount*rowSize - prevRowSize; } submeshes[i] = new BABYLON.SubMesh(i+1, 0, verticesCount, prevRowSize,currentRowSize , sphere); prevRowSize+= currentRowSize; sphere.subMeshes.push(submeshes[i]); submeshes[i].actionManager = new BABYLON.ActionManager(scene); submeshes[i].actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger, function(e){ console.log(e); })); }How can this can be implemented ? Please let us know your thoughts Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.