Quac_quac_92 Posted December 2, 2016 Share Posted December 2, 2016 Hello, i use this code for create 8 Cylinder in a cirlce. var angle = 0; for (var index = 0; index < 8; index++) { var Cylinder = BABYLON.Mesh.CreateCylinder("cylinder", 0.3, .5, .5, 20, 1, scene, false); Cylinder.position.y = Math.sin(angle);; Cylinder.position.x = Math.cos(angle); Cylinder.rotation.x = Math.PI/2; angle -= Math.PI / 4; } Now i want to add material for each them after an event (click ,...) , but i don't know how. I only can add material for the first Cylinder. one more thing, how to add URL image on http://www.babylonjs-playground.com like BABYLON.Texture("textures/misc.jpg", scene); demo.rar Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 2, 2016 Share Posted December 2, 2016 Hello here is an example on how to use a texture from Dropbox: http://www.babylonjs-playground.com/#149MFM#4 Please provide a PG for your question, we will then be able to help you Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 4, 2016 Share Posted December 4, 2016 Hi guys! QQ, how about I treat you to a PG (a playground demo) that should help? http://www.babylonjs-playground.com/#11XV5X#1 That should get you rolling. ActionManager picks are active on most mesh. Clicking makes changes to material colors. Code lightly commented. And... a little cosine animating... which is always fun. Hope this helps. Be well. 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.