Jump to content

rotate a material


Recommended Posts

I need to rotate a material applied to the face of a cube. Is there any function to do this with only one function call rather than iterating over the textures of this material and modifying their "wAng"? 

Or alternatively, is it possible to rotate only a submesh (a face of a cube) from a mesh?

Link to comment
Share on other sites

On 19/6/2016 at 8:23 PM, dbawel said:

Here is a post from 2014 which tells how one user accomplished this. The post doesn't provide the specific code, but should provide eenough info to accomplish rotating a texture on a cube.


He uses the "wAng" properties of the textures. But this is not an ideal solution when a material is composed of multiple textures as, as I said, it requires to iterate over each texture of the material to rotate the full material....


On 19/6/2016 at 8:49 PM, NasimiAsl said:

you can use the shaderBuilder too if you Intersted i can make a pg sample for you :)

Thanks. But I am actually using the haxe port of babylonjs (babylonHx) that do not yet include the latest changes in babylonjs. So I can't really use the new shaderBuilder (anyway it is probably not really the function I need because I just need to perform a "one shot" material rotation and not a dynamic one. So I just need a function to rotate the submesh of my cube face, or only its UVs or else, a function to rotate a material (by rotating all the textures of this material)).  

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.

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.


  • Recently Browsing   0 members

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