jacquesr Posted February 19, 2016 Share Posted February 19, 2016 Hi, can someone explain how updating the UV Maps of meshes works using updateVerticesData? I don't really get how the numbers list should be filled. And what is the difference between UVKind, UV2Kind etc... Faces Amount? Regards Jacques Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 19, 2016 Share Posted February 19, 2016 Hi Jacquesr! You can probably find the answer to your 2nd question... on the web. Here is a nice Jerome "howdy-do-dat?" demo... where I have added a few alerts into the playground scene. Close all the alerts and any errors, and then press RUN (again). http://www.babylonjs-playground.com/#1H7L5C#27 Take notice of lines 88-96. Line 88 shows that there are 180 positions in this model. It takes 3 values to create a vertex position... so I divided positions.length by 3. Line 89... here I divide the uvs array by 2. It also reports 180. So we know it takes 2 UVs values per vertex. Careful here. I think a SINGLE UV has 2 values... by its very nature. So there are 180... "pairs" of values. First a U, then a V, then a U, then a V, etc. Lines 91-96... I am dumping each UV (x/y) on a line of its own... in the alert. 'U-V-W' can be thought-of as X-Y-Z for textures. Ok, that's all I know. Hope this helps. Hope I didn't say anything stupid or wrong. Smarter people than I... are nearby. They'll comment soon, as needed. You can use our cool playground searcher to get links to LOTS of demos that use uvKind... http://doc.babylonjs.com/playground?q=uvKind Quote Link to comment Share on other sites More sharing options...
jacquesr Posted February 23, 2016 Author Share Posted February 23, 2016 Hey Wingnut, thank you for the response. That sheds some light on it. I'll dig deeper soon. Quote Link to comment Share on other sites More sharing options...
Suphi Posted February 23, 2016 Share Posted February 23, 2016 Here is a simple demo that may help explain how UV works and also shows how to use updateVerticesData http://www.babylonjs-playground.com/#2GBJEJ#1 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.