Function
save_obj
(v, f, file_name='output.obj')
Source from the content-addressed store, hash-verified
| 121 | cv2.waitKey(0) |
| 122 | |
| 123 | def save_obj(v, f, file_name='output.obj'): |
| 124 | obj_file = open(file_name, 'w') |
| 125 | for i in range(len(v)): |
| 126 | obj_file.write('v ' + str(v[i][0]) + ' ' + str(v[i][1]) + ' ' + str(v[i][2]) + '\n') |
| 127 | for i in range(len(f)): |
| 128 | obj_file.write('f ' + str(f[i][0]+1) + '/' + str(f[i][0]+1) + ' ' + str(f[i][1]+1) + '/' + str(f[i][1]+1) + ' ' + str(f[i][2]+1) + '/' + str(f[i][2]+1) + '\n') |
| 129 | obj_file.close() |
| 130 | |
| 131 | |
| 132 | def perspective_projection(vertices, cam_param): |
Tested by
no test coverage detected