}
void
-Tentacle::draw()
+Tentacle::draw(long time)
{
glLineWidth(2.0);
glBegin(GL_LINE_STRIP);
glColor3f(0.0, 0.0, 1.0);
for(size_t i=0; i<cpoints.size(); i++) {
- glVertex3f(cpoints[i].x, cpoints[i].y, cpoints[i].z);
+ float y = cpoints[i].y;
+ float offs = gph::noise(y, time * 0.0005 * y);
+ glVertex3f(cpoints[i].x + offs, y, cpoints[i].z + offs);
+
}
glEnd();
glBegin(GL_POINTS);
glColor3f(1.0, 0.0, 0.0);
for(size_t i=0; i<cpoints.size(); i++) {
- glVertex3f(cpoints[i].x, cpoints[i].y, 1.0);
+ float y = cpoints[i].y;
+ float offs = gph::noise(y, time * 0.0005 * y);
+ glVertex3f(cpoints[i].x + offs, y, cpoints[i].z + offs);
}
glEnd();
glEnable(GL_DEPTH_TEST);