Onit Posted September 9, 2016 Share Posted September 9, 2016 Hello, here there's a PG displaying a box with a dynamic texture applied. I need to change the uv coordinates to each face to correct the orientation of the texture. http://www.babylonjs-playground.com/#TYAHX#62 Ho could i do that? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 9, 2016 Share Posted September 9, 2016 Hello @Onit, welcome to forum. http://www.babylonjs-playground.com/#TYAHX#63 Does that look better? I changed the Y value in line 11... to be 80. You could also use texture.uOffset and .vOffset. And yes, you COULD even use mesh uvs, but that's a lot of work. Here is a demo that does that... http://www.babylonjs-playground.com/#TYAHX#64 I only moved the front side uvs. I was too lazy to move all sides. Hope this helps. Welcome again! Good to have you with us. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Onit Posted September 13, 2016 Author Share Posted September 13, 2016 Thank you for your kind answer and sorry for my late reply. You showed me how to translate a face using uvs. Instead how can uvs to set a different rotation to each face so that the one in each side becomes oriented in the right way. If i use wang it rotates the texture not the face. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 13, 2016 Share Posted September 13, 2016 Hi Onit... sorry about that. I don't know if that is possible. Perhaps need to make a box... from six planes (parented-together instances of a single textured plane). I have never tried to rotate one face's texture... of a textured box. Just the same, here is playground that uses a box with a faceUV setting. It comes from the createXXX tutorial. http://www.babylonjs-playground.com/#TYAHX#65 Lines 16-22 should give you all the experimenting power that you need. Sorry that I don't have more info. Perhaps others will comment soon. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 13, 2016 Share Posted September 13, 2016 Hi again. Just in case you would be okay-with a 6-plane box, I made one. In fact, I made a machine that makes them. I give it to you, now. http://www.babylonjs-playground.com/#TYAHX#68 Onit's Box Maker function - version 1.0 Your ONE STOP for quality 6-plane boxes (with correctly-oriented text)... at honest prices. There may be easier ways to do this... but... I needed a playground to work-on while I ate lunch, so I chose you. .position of the box... uses the master plane's position (I think). Perhaps my pivotPoint moving... in line 40... changed that. But maybe not. I didn't test. 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.