Jump to content

ActionManager is NOT working on Sub meshes?


Subin George
 Share

Recommended Posts

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

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