Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

Vector init and for loop in C++11

$
0
0

Ok i got it ! thanks a lot !

Is this the only way though ?

Also, now what if i want to use the particle index in the loop ?

i would update particle positions for instance like so before C++11

for (int = 0; i < 20; i++) {
    float x0 = i * p.x;
    float y0 = i * p.y;
    float x = ofGetWidth() * ofNoise(time * speed + x0);
    float y = ofGetHeight() * ofNoise(time * speed + y0);
    p.update(x, y);
}

Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>