make it rotate

This commit is contained in:
yangxiao 2014-06-11 10:01:52 +08:00
parent 6d09b50699
commit cddad40ec0
1 changed files with 7 additions and 7 deletions

View File

@ -92,11 +92,11 @@ bool Bundle3D::loadMeshData(const std::string& id, MeshData* meshdata)
//float vert[] = {0.f,50.f,0.f, 0.f,0.f,50.f, 50.f,0.f,0.f, -50.f,0.f,0.f};
memcpy(meshdata->vertex, vert, meshdata->vertexSizeInFloat * sizeof(float));
//meshdata->numIndex = 4 * 3;
meshdata->numIndex = 3;
meshdata->numIndex = 4 * 3;
//meshdata->numIndex = 3;
meshdata->indices = new unsigned short[meshdata->numIndex];
//unsigned short index[] = {0,1,2, 0,3,1, 0,2,3, 3,2,1};
unsigned short index[] = {0,3,2};
unsigned short index[] = {0,1,2, 0,3,1, 0,2,3, 3,2,1};
//unsigned short index[] = {0,3,2};
//unsigned short index[] = {0,1,2};
memcpy(meshdata->indices, index, meshdata->numIndex * sizeof(unsigned short));
@ -174,11 +174,11 @@ bool Bundle3D::loadAnimationData(const std::string& id, Animation3DData* animati
Quaternion quat;
Quaternion::createFromAxisAngle(Vec3(1.f, 0.f, 0.f), 0, &quat);
rot[0] = quat.x, rot[1] = quat.y, rot[2] = quat.z, rot[3] = quat.w;
Quaternion::createFromAxisAngle(Vec3(1.f, 0.f, 0.f), MATH_DEG_TO_RAD(0), &quat);
Quaternion::createFromAxisAngle(Vec3(1.f, 0.f, 0.f), MATH_DEG_TO_RAD(90), &quat);
rot[4] = quat.x, rot[5] = quat.y, rot[6] = quat.z, rot[7] = quat.w;
Quaternion::createFromAxisAngle(Vec3(1.f, 0.f, 0.f), MATH_DEG_TO_RAD(0), &quat);
Quaternion::createFromAxisAngle(Vec3(1.f, 0.f, 0.f), MATH_DEG_TO_RAD(180), &quat);
rot[8] = quat.x, rot[9] = quat.y, rot[10] = quat.z, rot[11] = quat.w;
Quaternion::createFromAxisAngle(Vec3(1.f, 0.f, 0.f), MATH_DEG_TO_RAD(0), &quat);
Quaternion::createFromAxisAngle(Vec3(1.f, 0.f, 0.f), MATH_DEG_TO_RAD(270), &quat);
rot[12] = quat.x, rot[13] = quat.y, rot[14] = quat.z, rot[15] = quat.w;
curve->rotCurve = Animation3D::Curve::AnimationCurveQuat::create(keytime1, rot, 4);
curve->rotCurve->retain();