-
-
Save harryhaaren/c356072cbfbddab7d71c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float nervousness = 0.25; // 0-1 range | |
// loop over every vertex in the mesh | |
for(int i = 0; i < mesh.getVertices().size(); i++ ) | |
{ | |
float x = 0.5 - ofRandomuf(); | |
float y = 0.5 - ofRandomuf(); | |
float z = 0.5 - ofRandomuf(); | |
// notice the += here. Increment the position with a value betwee -0.5 and 0.5. | |
// Therefore average position of the vertex will remain constant, but it will "walk" | |
mesh.getVertices().at(i) += ofVec3f( x*50*nervousness, y*25*nervousness, z*25*nervousness ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment