Jump to content

Change uv coordinates with Dyn. Textures


Onit
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

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.

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