From b07896ffc92093a3e8adb4953d22927a5874e43d Mon Sep 17 00:00:00 2001 From: Eleni Maria Stea Date: Sun, 6 Jan 2019 18:10:00 +0200 Subject: [PATCH] removed the anchor points --- src/hair.cc | 24 ++---------------------- src/hair.h | 2 -- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/hair.cc b/src/hair.cc index 0fc026d..c86044b 100644 --- a/src/hair.cc +++ b/src/hair.cc @@ -127,26 +127,6 @@ bool Hair::init(const Mesh *m, int max_num_spawns, float thresh) for(size_t i=0; i 0.99)) { - vi = Vec3(0, -1, 0); - } - Vec3 vj = normalize(cross(vk, vi)); - vi = cross(vj, vk); - - /* identity when the hair points to the z axis */ - Mat4 basis = Mat4(vi, vj, vk); - - for(int j=0; j<3; j++) { - float angle = (float)j / 3.0 * 2 * M_PI; - /* dir of each anchor relative to hair root */ - Vec3 dir = Vec3(cos(angle), sin(angle), 0); - dir = basis * dir; - hair[i].anchor_dirs[j] = hair[i].pos + dir - hair[i].spawn_pt; - } } return true; } @@ -171,8 +151,8 @@ void Hair::draw() const /* glColor3f(1, 1, 0); glVertex3f(hair[i].pos.x, hair[i].pos.y, hair[i].pos.z); - Vec3 end = hair[i].pos + dbg_force * 2.0; - glVertex3f(end.x, end.y, end.z); + Vec3 fend = hair[i].pos + dbg_force * 2.0; + glVertex3f(fend.x, fend.y, fend.z); */ } glEnd(); diff --git a/src/hair.h b/src/hair.h index 6cbf14e..5ef54d0 100644 --- a/src/hair.h +++ b/src/hair.h @@ -8,8 +8,6 @@ struct HairStrand { Vec3 pos; Vec3 velocity; - /* directions relative to the spawn point */ - Vec3 anchor_dirs[3]; Vec3 spawn_pt; Vec3 spawn_dir; }; -- 1.7.10.4