Robin Posted November 20, 2017 Share Posted November 20, 2017 Hi guys, I am confused about texture uScale and vScale, and need some help. Below is my code and a screenshot of the result, which is opposited to what I expect. For my understanding, uScale=2 will repeat image twice along x axis. Thank you. var groundMat = new BABYLON.StandardMaterial("ground", game.scene); groundMat.diffuseTexture = new BABYLON.Texture("assets/ground.png", game.scene); groundMat.diffuseTexture.uScale = 2; Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted November 20, 2017 Share Posted November 20, 2017 http://www.babylonjs-playground.com/#XJHNXG Your camera is just aligned wrong. Quote Link to comment Share on other sites More sharing options...
Robin Posted November 20, 2017 Author Share Posted November 20, 2017 Thank you for the reply. My camera is located same with the demo. But I used a box and scaled the y axis instead of calling the ground function. (Because I want the ground has a little thick) As u know, box has six faces; a ground has only one. What I can guess is, uScale=2 indeed repeat texture twice along u axis. For the box, the u axis of its front face is along x axis; while the u axis of its top face may along y axis. Correct me if I am wrong. Thank you. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted November 20, 2017 Share Posted November 20, 2017 You just need to construct your own cube then and have the uv’s aligned in the manor that will work for you. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2017 Share Posted November 20, 2017 More about custom UV:http://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors#box-faceuv Quote Link to comment Share on other sites More sharing options...
jerome Posted November 21, 2017 Share Posted November 21, 2017 I'll add the parameter to allow to build the box with custom UVs soon Arte 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.