15 for (int i=0; i<5; i++) {
16 add_control_point(Vec3(0.5, i / 10.0, 0.0));
22 Tentacle::add_control_point(const Vec3 &point)
24 cpoints.push_back(point);
28 Tentacle::draw(long time)
31 glBegin(GL_LINE_STRIP);
32 glColor3f(0.0, 0.0, 1.0);
33 for(size_t i=0; i<cpoints.size(); i++) {
34 float y = cpoints[i].y;
35 float offs = gph::noise(y, time * 0.0005 * y);
36 glVertex3f(cpoints[i].x + offs, y, cpoints[i].z + offs);
42 glDisable(GL_DEPTH_TEST);
45 glColor3f(1.0, 0.0, 0.0);
46 for(size_t i=0; i<cpoints.size(); i++) {
47 float y = cpoints[i].y;
48 float offs = gph::noise(y, time * 0.0005 * y);
49 glVertex3f(cpoints[i].x + offs, y, cpoints[i].z + offs);
52 glEnable(GL_DEPTH_TEST);