[Not a Bug] Geo instancing, rotate to vector bug

Version 2023.11760 non-commercial, Win10

image

image

Hi @pierre.a,

I think the issue is the first state where the default up vector (0,1,0) and the rotate to vector (0,1,1) are parallel resulting in a 0 rotation angle.
Actually not quite sure how to solve for this position if you are trying to point the instances to any point in space. I’ll get back to you.

cheers
Markus

1 Like

Hi @pierre.a,

the best way to prevent this is to add a slight offset to the vector incase the Rotate To vector is colinear with the Up Vector.

For textures you can do this with the help of the Matte TOP: The first input is the texture with the original Rotate To vectors. The second input is the original texture with a Math TOP adding a tiny amount on the red channel.
The third input now will be a Math TOP with the Channel Pre OP parameter set to positive (so we can catch co linear vectors that point in the opposite direction) then convert the rgb representation to hsv using a RGB to HSV TOP and feed this into a threshold where you set the Threshold parameter to “1/3”. The “1/3” comes from knowing that green (your up vector) has a hue value of approx. 1/3. While this is not completely precise, it seems to be sufficient to circle around the colinear case:

Rotate To Vector (0, 1, 0)

Rotate To Vector (0.01, 1, 0)

Hope this helps
Markus