Final result looking usable (finally)
This commit is contained in:
@@ -60,10 +60,9 @@ void* process_cin(void* args) {
|
|||||||
if (strcmp(words[0], camera_bodies[i].name) == 0 && camera_bodies[i].b) {
|
if (strcmp(words[0], camera_bodies[i].name) == 0 && camera_bodies[i].b) {
|
||||||
Body& b = *camera_bodies[i].b;
|
Body& b = *camera_bodies[i].b;
|
||||||
glm::vec4& transl = b.pose[3];
|
glm::vec4& transl = b.pose[3];
|
||||||
transl = 0.9f * transl + 0.1f * glm::vec4(new_loc, 1); // lp filter
|
transl = (0.8f * transl) + (0.2f * glm::vec4(new_loc, 1)); // lp filter
|
||||||
int color_i = i + 1;
|
int color_i = i + 1;
|
||||||
b.color = glm::vec4(color_i & 0x4, color_i & 0x2, color_i & 0x1, 1); // reset alpha to 1
|
b.color = glm::vec4(color_i & 0x4, color_i & 0x2, color_i & 0x1, 1); // reset alpha to 1
|
||||||
b.pose = glm::translate(b.pose, glm::vec3(transl));
|
|
||||||
camera_bodies[i].hp = max_hp;
|
camera_bodies[i].hp = max_hp;
|
||||||
found_match = true;
|
found_match = true;
|
||||||
} else if (camera_bodies[i].b) {
|
} else if (camera_bodies[i].b) {
|
||||||
@@ -231,7 +230,8 @@ int main() {
|
|||||||
Body* b = (Body*)malloc(sizeof(Body));
|
Body* b = (Body*)malloc(sizeof(Body));
|
||||||
create_new_sphere(b);
|
create_new_sphere(b);
|
||||||
b->color = glm::vec4((i+1) & 0x4, (i+1) & 0x2, (i+1) & 0x1, max_hp);
|
b->color = glm::vec4((i+1) & 0x4, (i+1) & 0x2, (i+1) & 0x1, max_hp);
|
||||||
b->scale = 20;
|
b->scale = 25;
|
||||||
|
b->shader = shader;
|
||||||
camera_bodies[i].b = b;
|
camera_bodies[i].b = b;
|
||||||
}
|
}
|
||||||
draw_body(*camera_bodies[i].b);
|
draw_body(*camera_bodies[i].b);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ lines = None
|
|||||||
with open("gpoints_rotate.obj", "r") as f:
|
with open("gpoints_rotate.obj", "r") as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
|
||||||
period = 0.25
|
period = 0.01
|
||||||
|
|
||||||
for i in range(len(lines)):
|
for i in range(len(lines)):
|
||||||
time.sleep(period)
|
time.sleep(period)
|
||||||
|
|||||||
Reference in New Issue
Block a user