How i get a rotation over time on the Y Axis for thin instances in a shader

How i get a rotation over time on the Y Axis for thin instances in a shader:

Hello and welcome to the Babylon community! You should be able to extract the rotation of each instance through the instance transform matrix (which is the output of the Instances block):
image

1 Like

Thank you for the answer. But this is not exactly my problem. I want to know how to apply a new rotation?

Is there something like a Matrix Rotate Node?

You can build a rotation matrix with the Matrix node:


And multiply it by your transform

1 Like

You can do it like this:

Using the MatrixBuilder block won’t work because you must give it an immediate/constant value and I guess you want to be able to change the angle(?) The PG above is using the time variable to update the angle.

1 Like

Okay - it seems i have been a little bit unspecific about my problem. I have a lot of 3D Icons as thin instances and they should rotate on the local Y Axis not the global, i wanted to use a custom shader material for this.

In that case you can rotate the local position instead of the world position, like this:

1 Like

Thank You!!! It Works!

Here is your Final NodeMaterial (for anyone who is searching a rotation on the local y axis for thin instances): https://nme.babylonjs.com/#99S0T5#79

1 Like