Butterfly flying upside down, wings movement is too uniform

Hi,
i’m building butterflies for a show,
but : - some of them appear upside down, where can i change their orientatiion?

  • they fly a bit the same speed, id 'like them flap faster and less homogenic ?
  • how i can i make them evolve more naturally ( flying around with chaotic path) more than being transported by the wind ?

thanks a lot
butterfly forumEMMITEUROSC.toe (74.2 KB)
picmix.com_1158739

Hi @bennid,

the deformation of the butterfly wing is happening in the phong1GLSLVertex shader in your example. There you have a line float offsetIndex = uIndex + (uOffset * TDInstanceID()); which is a lookup value into a texture which again is being used for the position calculation.

So you would want to do 2 things in this shader:

  • bring in a texture with random values and lookup a random value per instance
  • multiply the uIndex variable by some factor >1 based of the random value and after, normalize the value again to a 0-1 range.

The uIndex channel coming from the LFO CHOP is the minimum animation speed for your butterflies.

Alternatively you could create a feedback loop with a Noise TOP that adds and loops values to itself generating the lookup directly.

You could now use this texture directly in the line vec3 animation = texture(sAnimation, instanceLoc).xyz;. Where instanceLoc is a vec2 value of the pixel location in the texture derived from the TDInstanceID().

Rotation comes from the Null TOP called null_pRotation. You could rerange the values in this TOP to rotations that prevent an upside down. Currently they loop between 0 and 360…

cheers
Markus

1 Like