------------------------------------------------------------------------------- -- Arunan Rabindran, Vijay Krishnamoorthy -- Project 3 - Animation using motion capture -- Song - Thriller, Michael Jackson -------------------------------------------------------------------------------- --globals -------------------------------------------------------------------------------- tumble = false scale = false zoom = 1 rot_x = 0 rot_y = 0 idx = 1 idx1 = 1 tm = 0 tm1 = 0 sound = 0 offset = 1.4 offset1 = 0.8 --tracker files track6_file = "trackerdata/step_jump_take1" track7_file = "trackerdata/4_wallwalktorso" track8_file = "trackerdata/3_dragtorso" track9_file = "trackerdata/4_karthiktorso" track10_file = "trackerdata/4_kushttorso" --object files ph1a_file = "objects/head.obj" ph1b_file = "objects/body1.obj" ph1c_file = "objects/body2.obj" ph1d_file = "objects/mouth.obj" ph2_file = "objects/dummy.obj" ph3_file = "objects/fullwormtall.obj" ph4_file = "objects/hands_obj.obj" ph5_file = "objects/lefteye.obj" ph6_file = "objects/eyebrows.obj" ph7_file = "objects/rightbrow.obj" ph8_file = "objects/leftbrow.obj" ph9_file = "objects/fullwormnoeyeballs.obj" ph10_file = "objects/leftantena.obj" ph11_file = "objects/rightantena.obj" ph12_file = "objects/lefteyeball.obj" ph13_file = "objects/righteyeball.obj" ph14_file = "objects/cross.obj" ph15_file = "objects/fence.obj" ph16_file = "objects/tombstone.obj" ph17_file = "objects/sky.obj" ph18_file = "objects/pumpkin.obj" ph19_file = "objects/moon.obj" --song song_file = "thriller.ogg" --font font_file = "fonts/Eighty Percent Outline.ttf" -------------------------------------------------------------------------------- --structures str = {} str1 = {} --time time = " " times = {} times1 = {} --tracker 0 t0px = {} t0py = {} t0pz = {} t0ox = {} t0oy = {} t0oz = {} --tracker 1 t1px = {} t1py = {} t1pz = {} t1ox = {} t1oy = {} t1oz = {} --tracker 2 t2px = {} t2py = {} t2pz = {} t2ox = {} t2oy = {} t2oz = {} --tracker 3 t3px = {} t3py = {} t3pz = {} t3ox = {} t3oy = {} t3oz = {} --tracker 4 t4px = {} t4py = {} t4pz = {} t4ox = {} t4oy = {} t4oz = {} --tracker 5 t5px = {} t5py = {} t5pz = {} t5ox = {} t5oy = {} t5oz = {} --tracker 6 t6px = {} t6py = {} t6pz = {} t6ox = {} t6oy = {} t6oz = {} --tracker 7 t7px = {} t7py = {} t7pz = {} t7ox = {} t7oy = {} t7oz = {} -------------------------------------------------------------------------------- spc_cnt = 0 ccnt = 0 stop_counting_space = false --idx = 0 -------------------------------------------------------------------------------- function get_lines1(filename) for line in io.lines(filename) do table.insert(str, line) end end function get_lines2(filename) for line in io.lines(filename) do table.insert(str1, line) end end ------------------------------------------------------------------------------ function get_trackerdata1(i) local markerA=1 local markerB=1 tempstr = " " spc_cnt = 0 time_done = false t0px_done = false t0py_done = false t0pz_done = false t0ox_done = false t0oy_done = false t0oz_done = false t1px_done = false t1py_done = false t1pz_done = false t1ox_done = false t1oy_done = false t1oz_done = false t2px_done = false t2py_done = false t2pz_done = false t2ox_done = false t2oy_done = false t2oz_done = false t3px_done = false t3py_done = false t3pz_done = false t3ox_done = false t3oy_done = false t3oz_done = false for j = 1, string.len(str[i]) do temp = string.sub(str[i], j, j) if(temp==" ") then if(stop_counting_space==false) then spc_cnt = spc_cnt + 1 end stop_counting_space = true end if(temp ~=" ") then tempstr = tempstr .. temp if(stop_counting_space == true) then stop_counting_space = false end end -- Time if(spc_cnt==1 and time_done==false) then table.insert(times, tempstr) tempstr=" " time_done = true end -- Tracker 0 if(spc_cnt==2 and t0px_done==false) then table.insert(t0px, tempstr) tempstr=" " t0px_done = true end if(spc_cnt==3 and t0py_done==false) then table.insert(t0py, tempstr) tempstr=" " t0py_done = true end if(spc_cnt==4 and t0pz_done==false) then table.insert(t0pz, tempstr) tempstr=" " t0pz_done = true end if(spc_cnt==5 and t0ox_done==false) then table.insert(t0ox, tempstr) tempstr=" " t0ox_done = true end if(spc_cnt==6 and t0oy_done==false) then table.insert(t0oy, tempstr) tempstr=" " t0oy_done = true end if(spc_cnt==7 and t0oz_done==false) then table.insert(t0oz, tempstr) tempstr=" " t0oz_done = true end -- Tracker 1 if(spc_cnt==8 and t1px_done==false) then table.insert(t1px, tempstr) tempstr=" " t1px_done = true end if(spc_cnt==9 and t1py_done==false) then table.insert(t1py, tempstr) tempstr=" " t1py_done = true end if(spc_cnt==10 and t1pz_done==false) then table.insert(t1pz, tempstr) tempstr=" " t1pz_done = true end if(spc_cnt==11 and t1ox_done==false) then table.insert(t1ox, tempstr) tempstr=" " t1ox_done = true end if(spc_cnt==12 and t1oy_done==false) then table.insert(t1oy, tempstr) tempstr=" " t1oy_done = true end if(spc_cnt==13 and t1oz_done==false) then table.insert(t1oz, tempstr) tempstr=" " t1oz_done = true end -- Tracker 2 if(spc_cnt==14 and t2px_done==false) then table.insert(t2px, tempstr) tempstr=" " t2px_done = true end if(spc_cnt==15 and t2py_done==false) then table.insert(t2py, tempstr) tempstr=" " t2py_done = true end if(spc_cnt==16 and t2pz_done==false) then table.insert(t2pz, tempstr) tempstr=" " t2pz_done = true end if(spc_cnt==17 and t2ox_done==false) then table.insert(t2ox, tempstr) tempstr=" " t2ox_done = true end if(spc_cnt==18 and t2oy_done==false) then table.insert(t2oy, tempstr) tempstr=" " t2oy_done = true end if(spc_cnt==19 and t2oz_done==false) then table.insert(t2oz, tempstr) tempstr=" " t2oz_done = true end -- Tracker 3 if(spc_cnt==20 and t3px_done==false) then table.insert(t3px, tempstr) tempstr=" " t3px_done = true end if(spc_cnt==21 and t3py_done==false) then table.insert(t3py, tempstr) tempstr=" " t3py_done = true end if(spc_cnt==22 and t3pz_done==false) then table.insert(t3pz, tempstr) tempstr=" " t3pz_done = true end if(spc_cnt==23 and t3ox_done==false) then table.insert(t3ox, tempstr) tempstr=" " t3ox_done = true end if(spc_cnt==24 and t3oy_done==false) then table.insert(t3oy, tempstr) tempstr=" " t3oy_done = true end if(spc_cnt==25 and t3oz_done==false) then table.insert(t3oz, tempstr) tempstr=" " t3oz_done = true end end end --- function get_trackerdata2(i) local markerA=1 local markerB=1 tempstr = " " spc_cnt = 0 time_done = false t4px_done = false t4py_done = false t4pz_done = false t4ox_done = false t4oy_done = false t4oz_done = false t5px_done = false t5py_done = false t5pz_done = false t5ox_done = false t5oy_done = false t5oz_done = false t6px_done = false t6py_done = false t6pz_done = false t6ox_done = false t6oy_done = false t6oz_done = false t7px_done = false t7py_done = false t7pz_done = false t7ox_done = false t7oy_done = false t7oz_done = false for j = 1, string.len(str1[i]) do temp = string.sub(str1[i], j, j) if(temp==" ") then if(stop_counting_space==false) then spc_cnt = spc_cnt + 1 end stop_counting_space = true end if(temp ~=" ") then tempstr = tempstr .. temp if(stop_counting_space == true) then stop_counting_space = false end end -- Time if(spc_cnt==1 and time_done==false) then table.insert(times1, tempstr) tempstr=" " time_done = true end -- Tracker 4 if(spc_cnt==2 and t4px_done==false) then table.insert(t4px, tempstr) tempstr=" " t4px_done = true end if(spc_cnt==3 and t4py_done==false) then table.insert(t4py, tempstr) tempstr=" " t4py_done = true end if(spc_cnt==4 and t4pz_done==false) then table.insert(t4pz, tempstr) tempstr=" " t4pz_done = true end if(spc_cnt==5 and t4ox_done==false) then table.insert(t4ox, tempstr) tempstr=" " t4ox_done = true end if(spc_cnt==6 and t4oy_done==false) then table.insert(t4oy, tempstr) tempstr=" " t4oy_done = true end if(spc_cnt==7 and t4oz_done==false) then table.insert(t4oz, tempstr) tempstr=" " t4oz_done = true end -- Tracker 5 if(spc_cnt==8 and t5px_done==false) then table.insert(t5px, tempstr) tempstr=" " t5px_done = true end if(spc_cnt==9 and t5py_done==false) then table.insert(t5py, tempstr) tempstr=" " t5py_done = true end if(spc_cnt==10 and t5pz_done==false) then table.insert(t5pz, tempstr) tempstr=" " t5pz_done = true end if(spc_cnt==11 and t5ox_done==false) then table.insert(t5ox, tempstr) tempstr=" " t5ox_done = true end if(spc_cnt==12 and t5oy_done==false) then table.insert(t5oy, tempstr) tempstr=" " t5oy_done = true end if(spc_cnt==13 and t5oz_done==false) then table.insert(t5oz, tempstr) tempstr=" " t5oz_done = true end -- Tracker 6 if(spc_cnt==14 and t6px_done==false) then table.insert(t6px, tempstr) tempstr=" " t6px_done = true end if(spc_cnt==15 and t6py_done==false) then table.insert(t6py, tempstr) tempstr=" " t6py_done = true end if(spc_cnt==16 and t6pz_done==false) then table.insert(t6pz, tempstr) tempstr=" " t6pz_done = true end if(spc_cnt==17 and t6ox_done==false) then table.insert(t6ox, tempstr) tempstr=" " t6ox_done = true end if(spc_cnt==18 and t6oy_done==false) then table.insert(t6oy, tempstr) tempstr=" " t6oy_done = true end if(spc_cnt==19 and t6oz_done==false) then table.insert(t6oz, tempstr) tempstr=" " t6oz_done = true end -- Tracker 7 if(spc_cnt==20 and t7px_done==false) then table.insert(t7px, tempstr) tempstr=" " t7px_done = true end if(spc_cnt==21 and t7py_done==false) then table.insert(t7py, tempstr) tempstr=" " t7py_done = true end if(spc_cnt==22 and t7pz_done==false) then table.insert(t7pz, tempstr) tempstr=" " t7pz_done = true end if(spc_cnt==23 and t7ox_done==false) then table.insert(t7ox, tempstr) tempstr=" " t7ox_done = true end if(spc_cnt==24 and t7oy_done==false) then table.insert(t7oy, tempstr) tempstr=" " t7oy_done = true end if(spc_cnt==25 and t7oz_done==false) then table.insert(t7oz, tempstr) tempstr=" " t7oz_done = true end end --527mocap! end ------------------------------------------------------------------------------ function init_scene() X0, Y0, Z0, X1, Y1, Z1 = E.get_display_bound() XC = (X0 + X1) / 2 YC = (Y0 + Y1) / 2 ZC = (Z0 + Z1) / 2 camera = E.create_camera(E.camera_type_perspective) o_camera = E.create_camera(E.camera_type_orthogonal) light = E.create_light(E.light_type_directional) sp_light1 = E. create_light(E.light_type_positional) pivot = E.create_pivot() E.parent_entity(o_camera, camera) E.parent_entity(light, camera) E.parent_entity(pivot, light) E.set_entity_position(camera, XC, YC + 3, ZC + 8) E.set_entity_position(light, XC, YC + 6, ZC + 8) E.set_entity_position(pivot, XC, YC, ZC) sound = E.load_sound(song_file) E.play_sound(sound) end function load_object(filename, scaleX, scaleY, scaleZ, rotX, rotY, rotZ) object = E.create_object(filename) E.parent_entity(object, pivot) E.set_entity_scale(object, scaleX, scaleY, scaleZ) E.set_entity_rotation(object, rotX, rotY, rotZ) E.set_entity_body_type(object, false) E.set_entity_body_attr(object, E.body_attr_gravity, false) bminX, bminY, bminZ, bmaxX, bmaxY, bmaxZ = E.get_entity_bound(object) E.set_entity_geom_type(object, E.geom_type_box, (bmaxX-bminX), (bmaxY-bminY), (bmaxZ-bminZ)) E.set_entity_geom_attr(object, E.geom_attr_mass, 100) return object end ------------------------------------------------------------------------------ function load_objects() sky_object = load_object(ph17_file, 80.0, 80.0, 80.0, 0.0, 0.0, 0.0) E.parent_entity(sky_object, pivot) envmap = E.create_image("objects/sky_nx.png", "objects/sky_px.png", "objects/sky_ny.png", "objects/sky_py.png", "objects/sky_nz.png", "objects/sky_pz.png") E.set_brush_image(E.get_mesh(sky_object, 0), envmap) E.set_brush_flags(E.get_mesh(sky_object, 0), E.brush_flag_unlit, true) E.set_brush_flags(E.get_mesh(sky_object, 0), E.brush_flag_sky_map_0, true) --left eyebrow ph1_obj = load_object(ph7_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) --right eyebrow ph2_obj = load_object(ph8_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) ------------------------------------------- --head (whole) --ph3_obj = load_object(ph9_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) ------------------------------------------------------------------ --head (separate) ph3a_obj = load_object(ph1a_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) ------------------------------------------------------------------ --body1 ph3b_obj = load_object(ph1b_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) ------------------------------------------------------------------ --body2 ph3c_obj = load_object(ph1c_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) ------------------------------------------------------------------ --mouth ph3d_obj = load_object(ph1d_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) ---------------------------------------- --left hand ph4_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 180.0, 40.0) ph4a_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 180.0, 40.0) ph4b_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 180.0, 40.0) ph4c_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 180.0, 40.0) ph4d_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 180.0, 40.0) --right hand ph5_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 0.0, 40.0) ph5a_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 0.0, 40.0) ph5b_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 0.0, 40.0) ph5c_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 0.0, 40.0) ph5d_obj = load_object(ph4_file, 0.01, 0.01, 0.01, 0.0, 0.0, 40.0) ---------------------------------------- --left antenna ph6_obj = load_object(ph10_file, 0.012, 0.015, 0.012, 0.0, 0.0, 0.0) ---------------------------- --right antenna ph7_obj = load_object(ph11_file, 0.012, 0.015, 0.012, 0.0, 0.0, 0.0) ------------------------- --left eyeball ph8_obj = load_object(ph12_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) ------------------------------------- --right eyeball ph9_obj = load_object(ph13_file, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0) ------------------------- ------------------------------------------------------------------------------- --environs ------------------------------------------------------------------------------- --tombs tomb_obj = load_object(ph16_file, 0.05, 0.05, 0.05, 0.0, 0.0, 0.0) E.set_entity_position(tomb_obj, 7.0, 1.0, -6.0) tomb_obj1 = load_object(ph16_file, 0.05, 0.05, 0.05, 0.0, 0.0, 0.0) E.set_entity_position(tomb_obj1, -6.0, 1.0, -4.0) tomb_obj2 = load_object(ph16_file, 0.05, 0.05, 0.05, 0.0, 0.0, 0.0) E.set_entity_position(tomb_obj2, -3.0, 1.0, -14.0) tomb_obj3 = load_object(ph16_file, 0.05, 0.05, 0.05, 0.0, 0.0, 0.0) E.set_entity_position(tomb_obj3, 0.0, 1.0, -5.0) tomb_obj4 = load_object(ph16_file, 0.05, 0.05, 0.05, 0.0, 0.0, 0.0) E.set_entity_position(tomb_obj4, 13.0, 1.0, -9.0) ------------------------ -- fences local fences = {} for i= 1, 40 do f_obj = load_object(ph15_file, 0.02, 0.02, 0.02, 0.0, 0.0, 0.0) table.insert(fences, f_obj) end for i= 1, 10 do E.set_entity_position(fences[i], -0.25 * i, 1.0, 2.0) end for i= 10, 20 do E.set_entity_position(fences[i], 0.25 * i, 1.0, 2.0) end for i= 20, 30 do E.set_entity_position(fences[i], -0.5 * i, 1.0, 2.0) end for i= 30, 40 do E.set_entity_position(fences[i], 0.5 * i, 1.0, 2.0) end --------------------------- -- crosses cross_obj = load_object(ph14_file, 0.02, 0.02, 0.02, 0.0, 0.0, 30.0) E.set_entity_position(cross_obj, -2.0, 1.0, -6.0) cross_obj1 = load_object(ph14_file, 0.02, 0.02, 0.02, 0.0, 0.0, -30.0) E.set_entity_position(cross_obj1, 3.0, 1.0, -8.0) cross_obj2 = load_object(ph14_file, 0.04, 0.04, 0.04, 0.0, 0.0, 0.0) E.set_entity_position(cross_obj2, -6.0, 1.0, -16.0) cross_obj3 = load_object(ph14_file, 0.02, 0.02, 0.02, 0.0, 0.0, 30.0) E.set_entity_position(cross_obj3, -12.0, 1.0, -8.0) -- pumpkin pkin_obj = load_object(ph18_file, 0.04, 0.04, 0.04, 0.0, 0.0, 0.0) E.set_entity_position(pkin_obj, -4.0, 1.0, -4.0) pkin_obj1 = load_object(ph18_file, 0.02, 0.02, 0.02, 0.0, 0.0, 0.0) E.set_entity_position(pkin_obj1, 2.5, 1.8, 2.0) -- moon moon_obj = load_object(ph19_file, 0.08, 0.08, 0.08, 0.0, 0.0, 0.0) E.set_entity_position(moon_obj, 10.0, 10.0, -30.0) end ------------------------------------------------------------------------------ function do_start() E.set_typeface(font_file) --------------------------------------------- -- Read required data for the step A get_lines1(track6_file) for i = 1, table.getn(str) do get_trackerdata1(i) end -- Read required data for the step B --get_lines2(track7_file) --for i = 1, table.getn(str1) do -- get_trackerdata2(i) --end --------------------------------------------- -- Initialize Graphics init_scene() -- Load objects load_objects() -- Timer E.enable_timer(true) end ------------------------------------------------------------------------------ function do_click(b, s) if b == 1 then tumble = s end if b == 3 then scale = s end return true end function do_point(dx, dy) if tumble then rot_x = rot_x + dy rot_y = rot_y + dx if rot_x > 90.0 then rot_x = 90 end if rot_x < -90.0 then rot_x = -90 end E.set_entity_rotation(pivot, rot_x, rot_y, 0) return true end if scale then zoom = zoom + dy / 500 E.set_entity_scale(pivot, zoom, zoom, zoom) return true end return false end ------------------------------------------------------------------------------ function do_timer(dt) --E.set_entity_position(ph1_obj, t1px[idx], t1py[idx], t1pz[idx]) --<1> --E.set_entity_position(ph2_obj, t0px[idx]+0.1, t0py[idx]+0.6, t0pz[idx]) --<0> --E.set_entity_position(ph3_obj, t3px[idx]+0.1, t3py[idx]-0.5, t3pz[idx]+0.5) --<3> if(tm==0) then -- Read required data for the step B get_lines2(track7_file) for i = 1, table.getn(str1) do get_trackerdata2(i) end end tm = tm + 1 --start shifting if(tm==1092) then -- Read required data for the step B print("getting next track...") for i = 1, table.getn(str1) do table.remove(str1, i) end get_lines2(track8_file) for i = 1, table.getn(str1) do get_trackerdata2(i) end end if(tm==1536+1092) then -- Read required data for the step B print("getting next track...") for i = 1, table.getn(str1) do table.remove(str1, i) end get_lines2(track9_file) for i = 1, table.getn(str1) do get_trackerdata2(i) end end if(tm==598+1536+1092) then -- Read required data for the step B print("getting next track...") for i = 1, table.getn(str1) do table.remove(str1, i) end get_lines2(track10_file) for i = 1, table.getn(str1) do get_trackerdata2(i) end end if(tm==1426+1536+1092+598) then print("the end") E.nuke() end -------------------------------------------------------------------------------- E.set_entity_position(ph1_obj, t7px[idx1]+(t6px[idx1+1] - t6px[idx1]), -- eyebrows t7py[idx1]+(t6py[idx1+1] - t6py[idx1]), t7pz[idx1]) E.set_entity_position(ph2_obj, t7px[idx1]-(t6px[idx1+1] - t6px[idx1]), t7py[idx1]-(t6py[idx1+1] - t6py[idx1]), t7pz[idx1]) -------------------------------------------------------------------------------- E.set_entity_position(ph7_obj, t7px[idx1]-(t6px[idx1+1] - t6px[idx1]), -- antenna t7py[idx1]-0.05, t7pz[idx1]) E.set_entity_position(ph6_obj, t7px[idx1]+(t6px[idx1+1] - t6px[idx1]), t7py[idx1]-0.05, t7pz[idx1]) -------------------------------------------------------------------------------- --E.set_entity_position(ph3_obj, t7px[idx1], t7py[idx1], t7pz[idx1]) -- whole body E.set_entity_position(ph3a_obj, t7px[idx1], t7py[idx1], t7pz[idx1]) --head E.set_entity_position(ph3b_obj, t7px[idx1]+(t6px[idx1+1] - t6px[idx1]), t7py[idx1], t7pz[idx1]) --body 1 E.set_entity_position(ph3c_obj, t7px[idx1]+(t6px[idx1+1] - t6px[idx1])*0.5, t7py[idx1]+0.05, t7pz[idx1]) --body2 E.turn_entity(ph3c_obj, 0.0, 9.0, 0.0) E.set_entity_position(ph3d_obj, t7px[idx1], t7py[idx1], t7pz[idx1]) --------------------------------------------------------------------------------- E.set_entity_position(ph4_obj, t5px[idx1], t5py[idx1]+0.14, t5pz[idx1]+0.4) -- hands E.set_entity_position(ph5_obj, t6px[idx1], t6py[idx1]+0.14, t6pz[idx1]+0.4) E.set_entity_position(ph4a_obj, t5px[idx1], (t5py[idx1]+0.07), (t5pz[idx1]+0.4)) -- hands E.set_entity_position(ph5a_obj, t6px[idx1], (t6py[idx1]+0.07), (t6pz[idx1]+0.4)) E.set_entity_position(ph4b_obj, t5px[idx1], t5py[idx1], (t5pz[idx1]+0.4)) -- hands E.set_entity_position(ph5b_obj, t6px[idx1], t6py[idx1], (t6pz[idx1]+0.4)) E.set_entity_position(ph4c_obj, t5px[idx1], t5py[idx1]-0.07, t5pz[idx1]+0.4) -- hands E.set_entity_position(ph5c_obj, t6px[idx1], t6py[idx1]-0.07, t6pz[idx1]+0.4) E.set_entity_position(ph4d_obj, t5px[idx1], t5py[idx1]-0.14, t5pz[idx1]+0.4) -- hands E.set_entity_position(ph5d_obj, t6px[idx1], t6py[idx1]-0.14, t6pz[idx1]+0.4) ------------------------------------------------------------------------------- E.set_entity_position(ph8_obj, t7px[idx1]+(t6px[idx1+1] - t6px[idx1]), -- eyeballs t7py[idx1], t7pz[idx1]) E.set_entity_position(ph9_obj, t7px[idx1]+(t6px[idx1+1] - t6px[idx1]), t7py[idx1], t7pz[idx1]) --------------------------------------------------------------------------------- if(idx >= table.getn(t5px) or idx >= table.getn(t1px)) then idx = 1 end idx = idx + 1 idx1 = idx1 + 1 if(idx1 >= table.getn(t5px)) then idx1 = 1 print(string.format("time for %s = %d", track10_file,tm)) end end ------------------------------------------------------------------------------ do_start() ------------------------------------------------------------------------------ --reference times --4_wallwalktorso - 546 X 2 = 1092 --3_dragtorso - 768 X 2 = 1536 --4_karthiktorso - 299 X 2 = 598 --4_kushttorso - 713 X 2 = 1426 -- ---- -- 4652 + ? = 4991 --total time - 4991 -- 4652 -- ---- -- 339 -> starting step -- ----