Brijesh Posted April 12, 2017 Share Posted April 12, 2017 I create a tube mesh using many vector array. Now i want to apply different color or texture to tube such as Example : If there are 10point that make a tube than from point 1 to point 3 red color, point 3 to point 7 green color and from 7 to 10 blue color so at last i got a tube with three color. plzz help me..!! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 12, 2017 Share Posted April 12, 2017 Hi B! https://www.babylonjs-playground.com/#1EX6VF#7 That is ONE way. Maybe not best way. Three tubes with different materials... all parented to same "gizmo"... so it LOOKS like they are single mesh. Positioning is very important, of course. You might not want to use .clone() in YOUR project (for tube2 and tube 3). *shrug* Could this method work okay for you? I hope so. Others may comment with better ideas. Be well, party on. Quote Link to comment Share on other sites More sharing options...
Brijesh Posted April 13, 2017 Author Share Posted April 13, 2017 I am update the tube mesh as data come from server, when i get new vector array from server i update the mesh. So if some point is out of some range than display some different color for connecting such a point. If vector value for x around 2 and in some time if i got x value around 5 for some points than i want to draw RED color tube mesh for such a connecting point. Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 13, 2017 Share Posted April 13, 2017 My guess is, what you want can be done with MultiMaterial and submeshes. Here's a tutorial, hope it helps https://www.eternalcoding.com/?p=283 Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Brijesh Posted April 14, 2017 Author Share Posted April 14, 2017 Sorry but i am still confuse, not any above solution work properly.. If any one have a idea than please help me...!!!! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 16, 2017 Share Posted April 16, 2017 Hi again B. I still think my method would be the best. Just create another Tube segment... from previous ending place, to new point... EACH TIME a new point arrives. Make that new tube-section any color you wish. No multiMaterial or subMesh work at all. Can you tell me why this would not work? (thx) 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.