Skip to content

Instantly share code, notes, and snippets.

@Vercidium
Last active May 4, 2019 02:38
Show Gist options
  • Save Vercidium/9cddb4e92638ac33720468ce8a10530e to your computer and use it in GitHub Desktop.
Save Vercidium/9cddb4e92638ac33720468ce8a10530e to your computer and use it in GitHub Desktop.
Multiple Arm Layers
// Create multiple layers
for (int o = 0; o < layers; o++)
{
// Create the arms
for (int i = 0; i < 100000; i++)
{
Vector3 position = GetPoint();
position.Y -= heightMagnitude * Math.Sin(position.Magnitude * heightFrequency);
// Colour and store each point
...
}
// Randomise the height magnitude for the next layer
// so that each layer follows a different path
heightMagnitude *= random.NextDouble();
// 50% chance that the next layer will be flipped vertically
if (random.NextDouble() > 0.5)
heightMagnitude *= -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment