retrieving transform data for mesh objects

This commit is contained in:
devZoGok
2021-11-05 21:43:03 +02:00
parent 20f34426e6
commit 754d1ce2cf
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -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')
+2
View File
@@ -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;
}
+8 -1
View File
@@ -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<string>(meshData.begin() + animationStartLine, meshData.begin() + driverStartLine);