projects
/
ludumice
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added idle func animation
[ludumice]
/
src
/
tentacle.cc
diff --git
a/src/tentacle.cc
b/src/tentacle.cc
index
7a69c29
..
ceb5e43
100644
(file)
--- a/
src/tentacle.cc
+++ b/
src/tentacle.cc
@@
-25,13
+25,16
@@
Tentacle::add_control_point(const Vec3 &point)
}
void
}
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++) {
{
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();
}
glEnd();
@@
-41,7
+44,9
@@
Tentacle::draw()
glBegin(GL_POINTS);
glColor3f(1.0, 0.0, 0.0);
for(size_t i=0; i<cpoints.size(); i++) {
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);
}
glEnd();
glEnable(GL_DEPTH_TEST);