Jump to content

Texture Scale


Robin
 Share

Recommended Posts

:unsure:  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;

 

image.png.f9e86c4a33c02b94c183bba5ac6747d8.png

 

Link to comment
Share on other sites

:D 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.

 

 

blob.png.7d69b7adbf43325163df0ba05a8a0de0.png

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...