diff --git a/script.py b/script.py index a8ca03a..73597ab 100644 --- a/script.py +++ b/script.py @@ -8,7 +8,7 @@ def exportData(ob): file.write('{\n' + ob.type + ": " + ob.name + '\n') file.write('pos: ' + str(ob.location.x) + ' ' + str(ob.location.y) + ' ' + str(ob.location.z) + ' \n') - file.write('rot: ' + str(ob.rotation_quaternion.w) + ' ' + str(ob.rotation_quaternion.x) + ' ' + str(ob.rotation_quaternion.y) + ' ' + str(-ob.rotation_quaternion.z) + ' \n') + file.write('rot: ' + str(ob.rotation_quaternion.w) + ' ' + str(ob.rotation_quaternion.x) + ' ' + str(ob.rotation_quaternion.y) + ' ' + str(ob.rotation_quaternion.z) + ' \n') file.write('scale: ' + str(ob.scale.x) + ' ' + str(ob.scale.y) + ' ' + str(ob.scale.z) + ' \n') file.write('parent: ' + ('-' if par is None else par.name) + '\n') diff --git a/texture.frag b/texture.frag index 57eba6d..425f67f 100755 --- a/texture.frag +++ b/texture.frag @@ -46,6 +46,7 @@ float getShadow(int id){ int type = light[id].type; float shadow = 0, closestDepth = 0, currentDepth = 0, bias = .005, val = .7; +/* if(type == 0){ vec3 projDir = fragPos - light[id].pos; closestDepth = texture(light[id].depthMapCube, projDir).r * light[id].far; @@ -65,6 +66,7 @@ float getShadow(int id){ if(projCoords.z > 1) shadow = 0; } +*/ return shadow; } diff --git a/vbModelReader.cpp b/vbModelReader.cpp index bf74ef0..2ca37ee 100644 --- a/vbModelReader.cpp +++ b/vbModelReader.cpp @@ -530,8 +530,15 @@ namespace vb01{ readShapeKeys(vertices, vertIds, meshSubData, shapeKeys, numShapes, numVertices); meshSubData.clear(); + getLineData(meshData[1].substr(meshData[1].find_first_of(':') + 2), data, 3); + Vector3 pos = Vector3(atof(data[0].c_str()), atof(data[2].c_str()), -atof(data[1].c_str())); + getLineData(meshData[2].substr(meshData[2].find_first_of(':') + 2), data, 4); + Quaternion rot = Quaternion(atof(data[0].c_str()), atof(data[1].c_str()), atof(data[3].c_str()), -atof(data[2].c_str())); + getLineData(meshData[3].substr(meshData[3].find_first_of(':') + 2), data, 3); + Vector3 scale = Vector3(atof(data[0].c_str()), atof(data[1].c_str()), atof(data[2].c_str())); + AnimationController *controller = new AnimationController(); - Node *node = new Node(Vector3::VEC_ZERO, Quaternion::QUAT_W, Vector3::VEC_IJK, name, controller); + Node *node = new Node(pos, rot, scale, name, controller); nodes.push_back(node); meshSubData = vector(meshData.begin() + animationStartLine, meshData.begin() + driverStartLine);