ramsestom Posted June 19, 2016 Share Posted June 19, 2016 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? Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 19, 2016 Share Posted June 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 19, 2016 Share Posted June 19, 2016 you can use the shaderBuilder too if you Intersted i can make a pg sample for you Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 20, 2016 Share Posted June 20, 2016 hope this could be help http://babylonjs-playground.com/#1Y2L9H#0 http://babylonjs-playground.com/#1Y2L9H#2 iiceman, GameMonetize, adam and 3 others 6 Quote Link to comment Share on other sites More sharing options...
adam Posted June 20, 2016 Share Posted June 20, 2016 These playgrounds would be excellent documentation examples for ShaderBuilder. GameMonetize and NasimiAsl 2 Quote Link to comment Share on other sites More sharing options...
ramsestom Posted June 20, 2016 Author Share Posted June 20, 2016 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)). Quote Link to comment Share on other sites More sharing options...
adam Posted June 21, 2016 Share Posted June 21, 2016 29 minutes ago, ramsestom said: So I can't really use the new shaderBuilder I don't use BabylonHX, but it does appear they have ported shaderBuilder. https://github.com/vujadin/BabylonHx/tree/afa80717ab98ac4f1deb0169424b12539a52611c/com/babylonhx/shaderbuilder If you haven't already, I would see if shaderBuilder works. NasimiAsl 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.