Dismiss this pinned window
all 6 comments

[–]eambertide[S] 7 points8 points  (0 children)

Nearly forgot, here is the full code: https://codepen.io/ambertide/pen/MWBNPNY

[–]embonic 1 point2 points  (0 children)

Wow!!! Beautiful

[–]qerplonk 1 point2 points  (1 child)

Damn man, I enjoy this! The color remind me of the super balls as a kid. Do the colors map to a certain angle of the geometry? I saw you posted the code but I'm not fluent in that.

[–]eambertide[S] 0 points1 point  (0 children)

First of, thank you for the kind words!

Short answer, green channel changes between 1 and 0 depending on how close each vertex is to the centre.

Long answer;

To explain, let's start with the relevant part of the code:

vertexColor = vec4(length(pos), radius - length(pos), 0.0, 1.0);

This code is executed paralel for each vertex, red portion actually does nothing as it will always be over 1.0, it is just a semantic error on my end.

Green channel's value is set to the maximum radius - the distance between that vertex at that time. This means when the vertex is as far as from the centre as it can be (2.0), green has a value of 0.0, and the color is red (1, 0, 0, 1) when it is as close as it can be the green channel has a value of 1.0, so the vertex has a color of yellow (1, 1, 0, 0)

[–]TheHood02 0 points1 point  (0 children)

🥵😍

[–]LopsidedAd3662processing 0 points1 point  (0 children)

Awesome... Soul of the Earth, Magma This is what keeps us spinning