HMP loader returns quads now, cleaned up the code a bit. Still longer than necessary.

BVH loader supports arbitrary rotation/translation orders now. Fixed a crash issue, added test models with ZYX and ZXY rotation order.
Updated CREDITS.
'Beautified' pushpack/poppack.
Collada loader does now also load XML files if 'COLLADA' is found in the header.
Fixed path issues in several IRR test files.


git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@282 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2009-01-10 17:58:06 +00:00
parent 39bfb7608b
commit b73cb1c569
23 changed files with 8194 additions and 265 deletions

11
CREDITS
View File

@ -1,4 +1,6 @@
===============================================================
Open Asset Import Library (Assimp)
Developers and Contributors
===============================================================
@ -11,13 +13,13 @@ Thanks for your help!
Configuration-Interface, AssImp-Viewer (Win32), Website (Admin and Design), admin.
-Thomas Schulze,
X-, BVH-Loader, Postprocessing framework. Data structure & Interface design, documentation.
X-, Collda-, BVH-Loader, Postprocessing framework. Data structure & Interface design, documentation.
-R.Schmidt,
Linux build, eclipse support.
- Kim Kulling:
Obj-Loader, Logging, Scons-build environment.
Obj-Loader, Logging, SCons-build environment.
- Matthias Gubisch,
Assimp.net
@ -49,4 +51,7 @@ supplied various XFiles for testing purposes.
searched the web for several thousands of test models for internal use
- John Connors
supplied patches for linux and SCons.
supplied patches for linux and SCons.
- T. R.
The GUY who performed some of the CSM mocaps.

View File

@ -51,14 +51,12 @@ using namespace Assimp;
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
BVHLoader::BVHLoader()
{
}
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
BVHLoader::~BVHLoader()
{
}
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
@ -73,10 +71,7 @@ bool BVHLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler) const
for( std::string::iterator it = extension.begin(); it != extension.end(); ++it)
*it = tolower( *it);
if( extension == ".bvh")
return true;
return false;
return ( extension == ".bvh");
}
// ------------------------------------------------------------------------------------------------
@ -410,31 +405,54 @@ void BVHLoader::CreateAnimation( aiScene* pScene)
// now generate the tracks for all nodes
anim->mNumChannels = mNodes.size();
anim->mChannels = new aiNodeAnim*[anim->mNumChannels];
// FIX: set the array elements to NULL to ensure proper deletion if an exception is thrown
for (unsigned int i = 0; i < anim->mNumChannels;++i)
anim->mChannels[i] = NULL;
for( unsigned int a = 0; a < anim->mNumChannels; a++)
{
const Node& node = mNodes[a];
const char* nodeName = node.mNode->mName.data;
const std::string nodeName = std::string( node.mNode->mName.data );
aiNodeAnim* nodeAnim = new aiNodeAnim;
anim->mChannels[a] = nodeAnim;
nodeAnim->mNodeName.Set( std::string( nodeName));
nodeAnim->mNodeName.Set( nodeName);
// translational part, if given
if( node.mChannels.size() == 6)
{
if( node.mChannels[0] != Channel_PositionX || node.mChannels[1] != Channel_PositionY
|| node.mChannels[2] != Channel_PositionZ)
{
throw new ImportErrorException( boost::str( boost::format( "Unexpected animation "
"channel setup at node \"%s\".") % nodeName));
}
nodeAnim->mNumPositionKeys = mAnimNumFrames;
nodeAnim->mPositionKeys = new aiVectorKey[mAnimNumFrames];
aiVectorKey* poskey = nodeAnim->mPositionKeys;
for( unsigned int fr = 0; fr < mAnimNumFrames; ++fr)
{
poskey->mTime = double( fr);
poskey->mValue.x = node.mChannelValues[fr * node.mChannels.size() + 0];
// Now compute all translations in the right order
switch (node.mChannels[0])
{
case Channel_PositionX: poskey->mValue.x = node.mChannelValues[fr * node.mChannels.size() + 0];break;
case Channel_PositionY: poskey->mValue.y = node.mChannelValues[fr * node.mChannels.size() + 0];break;
case Channel_PositionZ: poskey->mValue.z = node.mChannelValues[fr * node.mChannels.size() + 0];break;
default: throw new ImportErrorException( "Unexpected animation channel setup at node " + nodeName );
}
switch (node.mChannels[1])
{
case Channel_PositionX: poskey->mValue.x = node.mChannelValues[fr * node.mChannels.size() + 1];break;
case Channel_PositionY: poskey->mValue.y = node.mChannelValues[fr * node.mChannels.size() + 1];break;
case Channel_PositionZ: poskey->mValue.z = node.mChannelValues[fr * node.mChannels.size() + 1];break;
default: throw new ImportErrorException( "Unexpected animation channel setup at node " + nodeName );
}
switch (node.mChannels[2])
{
case Channel_PositionX: poskey->mValue.x = node.mChannelValues[fr * node.mChannels.size() + 2];break;
case Channel_PositionY: poskey->mValue.y = node.mChannelValues[fr * node.mChannels.size() + 2];break;
case Channel_PositionZ: poskey->mValue.z = node.mChannelValues[fr * node.mChannels.size() + 2];break;
default: throw new ImportErrorException( "Unexpected animation channel setup at node " + nodeName );
}
poskey->mValue.z = node.mChannelValues[fr * node.mChannels.size() + 1];
poskey->mValue.y = node.mChannelValues[fr * node.mChannels.size() + 2];
++poskey;
@ -451,25 +469,12 @@ void BVHLoader::CreateAnimation( aiScene* pScene)
// rotation part. Always present. First find value offsets
{
unsigned int rotOffset = 0;
unsigned int rotOffset = 0;
if( node.mChannels.size() == 6)
{
if( node.mChannels[3] != Channel_RotationZ || node.mChannels[4] != Channel_RotationX
|| node.mChannels[5] != Channel_RotationY)
{
throw new ImportErrorException( boost::str( boost::format( "Unexpected animation "
"channel setup at node \"%s\".") % nodeName));
}
// Offset all further calculations
rotOffset = 3;
} else
{
if( node.mChannels[0] != Channel_RotationZ || node.mChannels[1] != Channel_RotationX
|| node.mChannels[2] != Channel_RotationY || node.mChannels.size() != 3)
{
throw new ImportErrorException( boost::str( boost::format( "Unexpected animation "
"channel setup at node \"%s\".") % nodeName));
}
}
}
// Then create the number of rotation keys
nodeAnim->mNumRotationKeys = mAnimNumFrames;
@ -478,14 +483,35 @@ void BVHLoader::CreateAnimation( aiScene* pScene)
for( unsigned int fr = 0; fr < mAnimNumFrames; ++fr)
{
// translate ZXY euler angels into a quaternion
float angleZ = node.mChannelValues[fr * node.mChannels.size() + rotOffset + 0] * float( AI_MATH_PI) / 180.0f;
float angleX = node.mChannelValues[fr * node.mChannels.size() + rotOffset + 1] * float( AI_MATH_PI) / 180.0f;
float angleY = node.mChannelValues[fr * node.mChannels.size() + rotOffset + 2] * float( AI_MATH_PI) / 180.0f;
const float angle0 = node.mChannelValues[fr * node.mChannels.size() + rotOffset ] * float( AI_MATH_PI) / 180.0f;
const float angle1 = node.mChannelValues[fr * node.mChannels.size() + rotOffset+1] * float( AI_MATH_PI) / 180.0f;
const float angle2 = node.mChannelValues[fr * node.mChannels.size() + rotOffset+2] * float( AI_MATH_PI) / 180.0f;
aiMatrix4x4 temp;
aiMatrix3x3 rotMatrix;
aiMatrix4x4::RotationZ( angleZ, temp); rotMatrix *= aiMatrix3x3( temp);
aiMatrix4x4::RotationX( angleX, temp); rotMatrix *= aiMatrix3x3( temp);
aiMatrix4x4::RotationY( angleY, temp); rotMatrix *= aiMatrix3x3( temp);
// Compute rotation transformations in the right order
switch (node.mChannels[rotOffset])
{
case Channel_RotationX: aiMatrix4x4::RotationX( angle0, temp); rotMatrix *= aiMatrix3x3( temp); break;
case Channel_RotationY: aiMatrix4x4::RotationY( angle0, temp); rotMatrix *= aiMatrix3x3( temp); break;
case Channel_RotationZ: aiMatrix4x4::RotationZ( angle0, temp); rotMatrix *= aiMatrix3x3( temp); break;
default: throw new ImportErrorException( "Unexpected animation channel setup at node " + nodeName );
}
switch (node.mChannels[rotOffset+1])
{
case Channel_RotationX: aiMatrix4x4::RotationX( angle1, temp); rotMatrix *= aiMatrix3x3( temp); break;
case Channel_RotationY: aiMatrix4x4::RotationY( angle1, temp); rotMatrix *= aiMatrix3x3( temp); break;
case Channel_RotationZ: aiMatrix4x4::RotationZ( angle1, temp); rotMatrix *= aiMatrix3x3( temp); break;
default: throw new ImportErrorException( "Unexpected animation channel setup at node " + nodeName );
}
switch (node.mChannels[rotOffset+2])
{
case Channel_RotationX: aiMatrix4x4::RotationX( angle2, temp); rotMatrix *= aiMatrix3x3( temp); break;
case Channel_RotationY: aiMatrix4x4::RotationY( angle2, temp); rotMatrix *= aiMatrix3x3( temp); break;
case Channel_RotationZ: aiMatrix4x4::RotationZ( angle2, temp); rotMatrix *= aiMatrix3x3( temp); break;
default: throw new ImportErrorException( "Unexpected animation channel setup at node " + nodeName );
}
rotkey->mTime = double( fr);
rotkey->mValue = aiQuaternion( rotMatrix);

View File

@ -132,7 +132,11 @@ bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
for (unsigned int i = 0; i < numTokens;++i)
{
ai_assert(NULL != tokens[i]);
if (::strstr(buffer,tokens[i]))return true;
if (::strstr(buffer,tokens[i]))
{
DefaultLogger::get()->debug(std::string("Found positive match for header keyword: ") + tokens[i]);
return true;
}
}
}
return false;

View File

@ -1,4 +1,3 @@
/** Implementation of the Collada loader */
/*
---------------------------------------------------------------------------
Open Asset Import Library (ASSIMP)
@ -40,6 +39,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
/** @file Implementation of the Collada loader */
#include "AssimpPCH.h"
#include "../include/aiAnim.h"
#include "ColladaLoader.h"
@ -50,14 +51,12 @@ using namespace Assimp;
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
ColladaLoader::ColladaLoader()
{
}
{}
// ------------------------------------------------------------------------------------------------
// Destructor, private as well
ColladaLoader::~ColladaLoader()
{
}
{}
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
@ -75,6 +74,16 @@ bool ColladaLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler) con
if( extension == ".dae")
return true;
// XML - too generic, we need to open the file and search for typical keywords
if( extension == ".xml") {
/* If CanRead() is called in order to check whether we
* support a specific file extension in general pIOHandler
* might be NULL and it's our duty to return true here.
*/
if (!pIOHandler)return true;
const char* tokens[] = {"collada"};
return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
}
return false;
}
@ -88,7 +97,7 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
ColladaParser parser( pFile);
if( !parser.mRootNode)
throw new ImportErrorException( "File came out empty. Somethings wrong here.");
throw new ImportErrorException( "File came out empty. Something is wrong here.");
// create the materials first, for the meshes to find
BuildMaterials( parser, pScene);
@ -110,7 +119,6 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
0, 1, 0, 0,
0, 0, 0, 1);
// store all meshes
StoreSceneMeshes( pScene);
}

View File

@ -48,7 +48,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "HMPLoader.h"
#include "MD2FileData.h"
using namespace Assimp;
// ------------------------------------------------------------------------------------------------
@ -72,76 +71,69 @@ bool HMPImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler) const
// simple check of file extension is enough for the moment
std::string::size_type pos = pFile.find_last_of('.');
// no file extension - can't read
if( pos == std::string::npos)
return false;
if( pos == std::string::npos)return false;
std::string extension = pFile.substr( pos);
if (extension.length() < 4)return false;
if (extension[0] != '.')return false;
if (extension[1] != 'h' && extension[1] != 'H')return false;
if (extension[2] != 'm' && extension[2] != 'M')return false;
if (extension[3] != 'p' && extension[3] != 'P')return false;
for( std::string::iterator it = extension.begin(); it != extension.end(); ++it)
*it = tolower( *it);
return true;
return extension == ".hmp";
}
// ------------------------------------------------------------------------------------------------
// Imports the given file into the given scene structure.
void HMPImporter::InternReadFile(
const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
void HMPImporter::InternReadFile( const std::string& pFile,
aiScene* pScene, IOSystem* pIOHandler)
{
boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
// Check whether we can read from the file
if( file.get() == NULL)
{
throw new ImportErrorException( "Failed to open HMP file " + pFile + ".");
}
// check whether the HMP file is large enough to contain
// Check whether the HMP file is large enough to contain
// at least the file header
size_t fileSize = file->FileSize();
const size_t fileSize = file->FileSize();
if( fileSize < 50)
{
throw new ImportErrorException( "HMP File is too small.");
}
// allocate storage and copy the contents of the file to a memory buffer
// Allocate storage and copy the contents of the file to a memory buffer
this->pScene = pScene;
this->pIOHandler = pIOHandler;
this->mBuffer = new unsigned char[fileSize+1];
std::vector<uint8_t> buffer(fileSize+1);
mBuffer = &buffer[0];
file->Read( (void*)mBuffer, 1, fileSize);
iFileSize = (unsigned int)fileSize;
this->iFileSize = (unsigned int)fileSize;
// determine the file subtype and call the appropriate member function
// Determine the file subtype and call the appropriate member function
uint32_t iMagic = *((uint32_t*)this->mBuffer);
try {
// HMP4 format
if (AI_HMP_MAGIC_NUMBER_LE_4 == iMagic ||
AI_HMP_MAGIC_NUMBER_BE_4 == iMagic)
{
DefaultLogger::get()->debug("HMP subtype: 3D GameStudio A4, magic word is HMP4");
this->InternReadFile_HMP4();
InternReadFile_HMP4();
}
// HMP5 format
else if (AI_HMP_MAGIC_NUMBER_LE_5 == iMagic ||
AI_HMP_MAGIC_NUMBER_BE_5 == iMagic)
{
DefaultLogger::get()->debug("HMP subtype: 3D GameStudio A5, magic word is HMP5");
this->InternReadFile_HMP5();
InternReadFile_HMP5();
}
// HMP7 format
else if (AI_HMP_MAGIC_NUMBER_LE_7 == iMagic ||
AI_HMP_MAGIC_NUMBER_BE_7 == iMagic)
{
DefaultLogger::get()->debug("HMP subtype: 3D GameStudio A7, magic word is HMP7");
this->InternReadFile_HMP7();
InternReadFile_HMP7();
}
else
{
// print the magic word to the logger
// Print the magic word to the logger
char szBuffer[5];
szBuffer[0] = ((char*)&iMagic)[0];
szBuffer[1] = ((char*)&iMagic)[1];
@ -149,20 +141,17 @@ void HMPImporter::InternReadFile(
szBuffer[3] = ((char*)&iMagic)[3];
szBuffer[4] = '\0';
// we're definitely unable to load this file
// We're definitely unable to load this file
throw new ImportErrorException( "Unknown HMP subformat " + pFile +
". Magic word (" + szBuffer + ") is not known");
}
} catch (ImportErrorException* ex) {
delete[] this->mBuffer;
throw ex;
}
// Set the AI_SCENE_FLAGS_TERRAIN bit
pScene->mFlags |= AI_SCENE_FLAGS_TERRAIN;
// delete the file buffer
delete[] this->mBuffer;
return;
// File buffer destructs automatically now
}
// ------------------------------------------------------------------------------------------------
void HMPImporter::ValidateHeader_HMP457( )
{
@ -175,51 +164,49 @@ void HMPImporter::ValidateHeader_HMP457( )
}
if (!pcHeader->ftrisize_x || !pcHeader->ftrisize_y)
{
throw new ImportErrorException("Size of triangles in either x or y direction is zero");
}
if(pcHeader->fnumverts_x < 1.0f || (pcHeader->numverts/pcHeader->fnumverts_x) < 1.0f)
{
throw new ImportErrorException("Number of triangles in either x or y direction is zero");
}
if(!pcHeader->numframes)
{
throw new ImportErrorException("There are no frames. At least one should be there");
}
}
// ------------------------------------------------------------------------------------------------
void HMPImporter::InternReadFile_HMP4( )
{
throw new ImportErrorException("HMP4 is currently not supported");
}
// ------------------------------------------------------------------------------------------------
void HMPImporter::InternReadFile_HMP5( )
{
// read the file header and skip everything to byte 84
const HMP::Header_HMP5* pcHeader = (const HMP::Header_HMP5*)this->mBuffer;
const unsigned char* szCurrent = (const unsigned char*)(this->mBuffer+84);
this->ValidateHeader_HMP457();
const HMP::Header_HMP5* pcHeader = (const HMP::Header_HMP5*)mBuffer;
const unsigned char* szCurrent = (const unsigned char*)(mBuffer+84);
ValidateHeader_HMP457();
// generate an output mesh
this->pScene->mNumMeshes = 1;
this->pScene->mMeshes = new aiMesh*[1];
aiMesh* pcMesh = this->pScene->mMeshes[0] = new aiMesh();
pScene->mNumMeshes = 1;
pScene->mMeshes = new aiMesh*[1];
aiMesh* pcMesh = pScene->mMeshes[0] = new aiMesh();
pcMesh->mMaterialIndex = 0;
pcMesh->mVertices = new aiVector3D[pcHeader->numverts];
pcMesh->mNormals = new aiVector3D[pcHeader->numverts];
const unsigned int height = (unsigned int)(pcHeader->numverts / pcHeader->fnumverts_x);
const unsigned int width = (unsigned int)pcHeader->fnumverts_x;
const unsigned int width = (unsigned int)pcHeader->fnumverts_x;
// generate/load a material for the terrain
this->CreateMaterial(szCurrent,&szCurrent);
CreateMaterial(szCurrent,&szCurrent);
// goto offset 120, I don't know why ...
// (fixme) is this the frame header? I assume yes since it starts with 2.
szCurrent += 36;
this->SizeCheck(szCurrent + sizeof(const HMP::Vertex_HMP7)*height*width);
SizeCheck(szCurrent + sizeof(const HMP::Vertex_HMP7)*height*width);
// now load all vertices from the file
aiVector3D* pcVertOut = pcMesh->mVertices;
@ -238,31 +225,31 @@ void HMPImporter::InternReadFile_HMP5( )
}
// generate texture coordinates if necessary
if (pcHeader->numskins)this->GenerateTextureCoords(width,height);
if (pcHeader->numskins)GenerateTextureCoords(width,height);
// now build a list of faces
this->CreateOutputFaceList(width,height);
CreateOutputFaceList(width,height);
// there is no nodegraph in HMP files. Simply assign the one mesh
// (no, not the one ring) to the root node
this->pScene->mRootNode = new aiNode();
this->pScene->mRootNode->mName.Set("terrain_root");
this->pScene->mRootNode->mNumMeshes = 1;
this->pScene->mRootNode->mMeshes = new unsigned int[1];
this->pScene->mRootNode->mMeshes[0] = 0;
pScene->mRootNode = new aiNode();
pScene->mRootNode->mName.Set("terrain_root");
pScene->mRootNode->mNumMeshes = 1;
pScene->mRootNode->mMeshes = new unsigned int[1];
pScene->mRootNode->mMeshes[0] = 0;
}
// ------------------------------------------------------------------------------------------------
void HMPImporter::InternReadFile_HMP7( )
{
// read the file header and skip everything to byte 84
const HMP::Header_HMP5* const pcHeader = (const HMP::Header_HMP5*)this->mBuffer;
const unsigned char* szCurrent = (const unsigned char*)(this->mBuffer+84);
this->ValidateHeader_HMP457();
const HMP::Header_HMP5* const pcHeader = (const HMP::Header_HMP5*)mBuffer;
const unsigned char* szCurrent = (const unsigned char*)(mBuffer+84);
ValidateHeader_HMP457();
// generate an output mesh
this->pScene->mNumMeshes = 1;
this->pScene->mMeshes = new aiMesh*[1];
aiMesh* pcMesh = this->pScene->mMeshes[0] = new aiMesh();
pScene->mNumMeshes = 1;
pScene->mMeshes = new aiMesh*[1];
aiMesh* pcMesh = pScene->mMeshes[0] = new aiMesh();
pcMesh->mMaterialIndex = 0;
pcMesh->mVertices = new aiVector3D[pcHeader->numverts];
@ -272,13 +259,13 @@ void HMPImporter::InternReadFile_HMP7( )
const unsigned int width = (unsigned int)pcHeader->fnumverts_x;
// generate/load a material for the terrain
this->CreateMaterial(szCurrent,&szCurrent);
CreateMaterial(szCurrent,&szCurrent);
// goto offset 120, I don't know why ...
// (fixme) is this the frame header? I assume yes since it starts with 2.
szCurrent += 36;
this->SizeCheck(szCurrent + sizeof(const HMP::Vertex_HMP7)*height*width);
SizeCheck(szCurrent + sizeof(const HMP::Vertex_HMP7)*height*width);
// now load all vertices from the file
aiVector3D* pcVertOut = pcMesh->mVertices;
@ -306,25 +293,26 @@ void HMPImporter::InternReadFile_HMP7( )
}
// generate texture coordinates if necessary
if (pcHeader->numskins)this->GenerateTextureCoords(width,height);
if (pcHeader->numskins)GenerateTextureCoords(width,height);
// now build a list of faces
this->CreateOutputFaceList(width,height);
CreateOutputFaceList(width,height);
// there is no nodegraph in HMP files. Simply assign the one mesh
// (no, not the One Ring) to the root node
this->pScene->mRootNode = new aiNode();
this->pScene->mRootNode->mName.Set("terrain_root");
this->pScene->mRootNode->mNumMeshes = 1;
this->pScene->mRootNode->mMeshes = new unsigned int[1];
this->pScene->mRootNode->mMeshes[0] = 0;
pScene->mRootNode = new aiNode();
pScene->mRootNode->mName.Set("terrain_root");
pScene->mRootNode->mNumMeshes = 1;
pScene->mRootNode->mMeshes = new unsigned int[1];
pScene->mRootNode->mMeshes[0] = 0;
}
// ------------------------------------------------------------------------------------------------
void HMPImporter::CreateMaterial(const unsigned char* szCurrent,
const unsigned char** szCurrentOut)
{
aiMesh* const pcMesh = this->pScene->mMeshes[0];
const HMP::Header_HMP5* const pcHeader = (const HMP::Header_HMP5*)this->mBuffer;
aiMesh* const pcMesh = pScene->mMeshes[0];
const HMP::Header_HMP5* const pcHeader = (const HMP::Header_HMP5*)mBuffer;
// we don't need to generate texture coordinates if
// we have no textures in the file ...
@ -334,7 +322,7 @@ void HMPImporter::CreateMaterial(const unsigned char* szCurrent,
pcMesh->mNumUVComponents[0] = 2;
// now read the first skin and skip all others
this->ReadFirstSkin(pcHeader->numskins,szCurrent,&szCurrent);
ReadFirstSkin(pcHeader->numskins,szCurrent,&szCurrent);
}
else
{
@ -356,25 +344,25 @@ void HMPImporter::CreateMaterial(const unsigned char* szCurrent,
pcHelper->AddProperty(&szName,AI_MATKEY_NAME);
// add the material to the scene
this->pScene->mNumMaterials = 1;
this->pScene->mMaterials = new aiMaterial*[1];
this->pScene->mMaterials[0] = pcHelper;
pScene->mNumMaterials = 1;
pScene->mMaterials = new aiMaterial*[1];
pScene->mMaterials[0] = pcHelper;
}
*szCurrentOut = szCurrent;
}
// ------------------------------------------------------------------------------------------------
void HMPImporter::CreateOutputFaceList(unsigned int width,unsigned int height)
{
aiMesh* const pcMesh = this->pScene->mMeshes[0];
// allocate enough storage
const unsigned int iNumSquares = (width-1) * (height-1);
pcMesh->mNumFaces = iNumSquares << 1;
// Allocate enough storage
pcMesh->mNumFaces = (width-1) * (height-1);
pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
pcMesh->mNumVertices = pcMesh->mNumFaces*3;
pcMesh->mNumVertices = pcMesh->mNumFaces*4;
aiVector3D* pcVertices = new aiVector3D[pcMesh->mNumVertices];
aiVector3D* pcNormals = new aiVector3D[pcMesh->mNumVertices];
aiVector3D* pcNormals = new aiVector3D[pcMesh->mNumVertices];
aiFace* pcFaceOut(pcMesh->mFaces);
aiVector3D* pcVertOut = pcVertices;
@ -383,59 +371,34 @@ void HMPImporter::CreateOutputFaceList(unsigned int width,unsigned int height)
aiVector3D* pcUVs = pcMesh->mTextureCoords[0] ? new aiVector3D[pcMesh->mNumVertices] : NULL;
aiVector3D* pcUVOut(pcUVs);
// build the terrain square
// Build the terrain square
unsigned int iCurrent = 0;
for (unsigned int y = 0; y < height-1;++y)
{
for (unsigned int x = 0; x < width-1;++x)
{
// first triangle of the square
pcFaceOut->mNumIndices = 3;
pcFaceOut->mIndices = new unsigned int[3];
for (unsigned int y = 0; y < height-1;++y) {
for (unsigned int x = 0; x < width-1;++x,++pcFaceOut) {
pcFaceOut->mNumIndices = 4;
pcFaceOut->mIndices = new unsigned int[4];
*pcVertOut++ = pcMesh->mVertices[y*width+x];
*pcVertOut++ = pcMesh->mVertices[y*width+x+1];
*pcVertOut++ = pcMesh->mVertices[(y+1)*width+x];
*pcVertOut++ = pcMesh->mVertices[(y+1)*width+x+1];
*pcVertOut++ = pcMesh->mVertices[y*width+x+1];
*pcNorOut++ = pcMesh->mNormals[y*width+x];
*pcNorOut++ = pcMesh->mNormals[y*width+x+1];
*pcNorOut++ = pcMesh->mNormals[(y+1)*width+x];
*pcNorOut++ = pcMesh->mNormals[(y+1)*width+x+1];
*pcNorOut++ = pcMesh->mNormals[y*width+x+1];
if (pcMesh->mTextureCoords[0])
{
*pcUVOut++ = pcMesh->mTextureCoords[0][y*width+x];
*pcUVOut++ = pcMesh->mTextureCoords[0][y*width+x+1];
*pcUVOut++ = pcMesh->mTextureCoords[0][(y+1)*width+x];
}
pcFaceOut->mIndices[2] = iCurrent++;
pcFaceOut->mIndices[1] = iCurrent++;
pcFaceOut->mIndices[0] = iCurrent++;
++pcFaceOut;
// second triangle of the square
pcFaceOut->mNumIndices = 3;
pcFaceOut->mIndices = new unsigned int[3];
*pcVertOut++ = pcMesh->mVertices[(y+1)*width+x];
*pcVertOut++ = pcMesh->mVertices[y*width+x+1];
*pcVertOut++ = pcMesh->mVertices[(y+1)*width+x+1];
*pcNorOut++ = pcMesh->mNormals[(y+1)*width+x];
*pcNorOut++ = pcMesh->mNormals[y*width+x+1];
*pcNorOut++ = pcMesh->mNormals[(y+1)*width+x+1];
if (pcMesh->mTextureCoords[0])
{
*pcUVOut++ = pcMesh->mTextureCoords[0][(y+1)*width+x];
*pcUVOut++ = pcMesh->mTextureCoords[0][y*width+x+1];
*pcUVOut++ = pcMesh->mTextureCoords[0][(y+1)*width+x+1];
*pcUVOut++ = pcMesh->mTextureCoords[0][y*width+x+1];
}
pcFaceOut->mIndices[2] = iCurrent++;
pcFaceOut->mIndices[1] = iCurrent++;
pcFaceOut->mIndices[0] = iCurrent++;
++pcFaceOut;
for (unsigned int i = 0; i < 4;++i)
pcFaceOut->mIndices[i] = iCurrent++;
}
}
delete[] pcMesh->mVertices;
@ -450,6 +413,7 @@ void HMPImporter::CreateOutputFaceList(unsigned int width,unsigned int height)
pcMesh->mTextureCoords[0] = pcUVs;
}
}
// ------------------------------------------------------------------------------------------------
void HMPImporter::ReadFirstSkin(unsigned int iNumSkins, const unsigned char* szCursor,
const unsigned char** szCursorOut)
@ -461,69 +425,58 @@ void HMPImporter::ReadFirstSkin(unsigned int iNumSkins, const unsigned char* szC
uint32_t iType = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
if (0 == iType)
{
DefaultLogger::get()->warn("Skin type is 0. Skipping 12 bytes to "
"the next valid value, which seems to be the real skin type. "
"However, it is not known whether or not this is correct.");
szCursor += sizeof(uint32_t) * 2;
iType = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
if (0 == iType)
{
if (!iType)
throw new ImportErrorException("Unable to read HMP7 skin chunk");
}
}
// read width and height
uint32_t iWidth = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
uint32_t iHeight = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
uint32_t iWidth = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
uint32_t iHeight = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
// allocate an output material
MaterialHelper* pcMat = new MaterialHelper();
// read the skin, this works exactly as for MDL7
this->ParseSkinLump_3DGS_MDL7(szCursor,&szCursor,
ParseSkinLump_3DGS_MDL7(szCursor,&szCursor,
pcMat,iType,iWidth,iHeight);
// now we need to skip any other skins ...
for (unsigned int i = 1; i< iNumSkins;++i)
{
iType = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
iWidth = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
iHeight = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
iType = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
iWidth = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
iHeight = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
this->SkipSkinLump_3DGS_MDL7(szCursor,&szCursor,
iType,iWidth,iHeight);
this->SizeCheck(szCursor);
SkipSkinLump_3DGS_MDL7(szCursor,&szCursor,iType,iWidth,iHeight);
SizeCheck(szCursor);
}
// setup the material ...
this->pScene->mNumMaterials = 1;
this->pScene->mMaterials = new aiMaterial*[1];
this->pScene->mMaterials[0] = pcMat;
pScene->mNumMaterials = 1;
pScene->mMaterials = new aiMaterial*[1];
pScene->mMaterials[0] = pcMat;
*szCursorOut = szCursor;
return;
}
// ------------------------------------------------------------------------------------------------
void HMPImporter::GenerateTextureCoords(
const unsigned int width, const unsigned int height)
{
ai_assert(NULL != this->pScene->mMeshes && NULL != this->pScene->mMeshes[0] &&
NULL != this->pScene->mMeshes[0]->mTextureCoords[0]);
ai_assert(NULL != pScene->mMeshes && NULL != pScene->mMeshes[0] &&
NULL != pScene->mMeshes[0]->mTextureCoords[0]);
aiVector3D* uv = this->pScene->mMeshes[0]->mTextureCoords[0];
aiVector3D* uv = pScene->mMeshes[0]->mTextureCoords[0];
const float fY = (1.0f / height) + (1.0f / height) / (height-1);
const float fX = (1.0f / width) + (1.0f / width) / (width-1);
for (unsigned int y = 0; y < height;++y)
{
for (unsigned int x = 0; x < width;++x)
{
for (unsigned int y = 0; y < height;++y) {
for (unsigned int x = 0; x < width;++x,++uv) {
uv->y = 1.0f-fY*y;
uv->x = fX*x;
uv->z = 0.0f;
++uv;
}
}
return;
}

View File

@ -102,9 +102,9 @@ bool IRRImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler) const
if (extension == ".irr")return true;
else if (extension == ".xml")
{
/* If CanRead() is called to check whether the loader
* supports a specific file extension in general we
* must return true here.
/* If CanRead() is called in order to check whether we
* support a specific file extension in general pIOHandler
* might be NULL and it's our duty to return true here.
*/
if (!pIOHandler)return true;
const char* tokens[] = {"irr_scene"};

View File

@ -217,6 +217,9 @@ void TerragenImporter::InternReadFile( const std::string& pFile,
// Check whether we have a mesh now
if (pScene->mNumMeshes != 1)
throw new ImportErrorException("TER: Unable to load terrain");
// Set the AI_SCENE_FLAGS_TERRAIN bit
pScene->mFlags |= AI_SCENE_FLAGS_TERRAIN;
}
#endif // !! AI_BUILD_NO_TERRAGEN_IMPORTER

View File

@ -1,4 +1,5 @@
// A very small replacement for boost::tuple
// (c) Alexander Gessler, 2008
#ifndef BOOST_TUPLE_INCLUDED
#define BOOST_TUPLE_INCLUDED

View File

@ -1,7 +1,13 @@
// may be included multiple times - resets structure packing to default
// for all supported compilers. A pushpack1.h include must preceed
// each inclusion of this header.
// ===============================================================================
// May be included multiple times - resets structure packing to the defaults
// for all supported compilers. Reverts the changes made by #include <pushpack1.h>
//
// Currently this works on the following compilers:
// MSVC 7,8,9
// GCC
// BORLAND (complains about 'pack state changed but not reverted', but works)
// ===============================================================================
#ifndef AI_PUSHPACK_IS_DEFINED
# error pushpack1.h must be included after poppack1.h

View File

@ -1,20 +1,21 @@
// may be included multiple times - sets structure packing to 1
// for all supported compilers. A poppack1.h include must follow
// each inclusion of this header.
/*
PACK_STRUCT must follow each structure declaration:
struct X
{
} PACK_STRUCT;
*/
// ===============================================================================
// May be included multiple times - sets structure packing to 1
// for all supported compilers. #include <poppack1.h> reverts the changes.
//
// Currently this works on the following compilers:
// MSVC 7,8,9
// GCC
// BORLAND (complains about 'pack state changed but not reverted', but works)
//
//
// USAGE:
//
// struct StructToBePacked {
// } PACK_STRUCT;
//
// ===============================================================================
#ifdef AI_PUSHPACK_IS_DEFINED
# error poppack1.h must be included after pushpack1.h
@ -30,11 +31,11 @@ struct X
#endif
#if defined(_MSC_VER)
// packing was changed after the inclusion of the header, propably missing #pragma pop
// C4103: Packing was changed after the inclusion of the header, propably missing #pragma pop
# pragma warning (disable : 4103)
#endif
#define AI_PUSHPACK_IS_DEFINED

View File

@ -49,7 +49,7 @@ extern "C" {
#endif
// ---------------------------------------------------------------------------
/** Returns a string with legal copyright and licensing information
/** @brief Returns a string with legal copyright and licensing information
* about Assimp.
*
* @return Never NULL
@ -57,7 +57,7 @@ extern "C" {
ASSIMP_API const char* aiGetLegalString ();
// ---------------------------------------------------------------------------
/** Returns the current minor version number of Assimp.
/** @brief Returns the current minor version number of Assimp.
*
* @return Minor version of the Assimp runtime the application was
* linked/built against
@ -65,7 +65,7 @@ ASSIMP_API const char* aiGetLegalString ();
ASSIMP_API unsigned int aiGetVersionMinor ();
// ---------------------------------------------------------------------------
/** Returns the current major version number of Assimp.
/** @brief Returns the current major version number of Assimp.
*
* @return Major version of the Assimp runtime the application was
* linked/built against
@ -73,7 +73,7 @@ ASSIMP_API unsigned int aiGetVersionMinor ();
ASSIMP_API unsigned int aiGetVersionMajor ();
// ---------------------------------------------------------------------------
/** Returns the repository revision of the Assimp runtime.
/** @brief Returns the repository revision of the Assimp runtime.
*
* @return Repository revision number of the Assimp runtime the application
* was linked/built against
@ -85,11 +85,11 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
#endif
// ---------------------------------------------------------------------------
/** \brief Set the maximum number of vertices in a mesh.
/** @brief Set the maximum number of vertices in a mesh.
*
* This is used by the "SplitLargeMeshes" PostProcess-Step to determine
* whether a mesh must be splitted or not.
* \note The default value is AI_SLM_DEFAULT_MAX_VERTICES, defined in
* @note The default value is AI_SLM_DEFAULT_MAX_VERTICES, defined in
* the internal header file SplitLargeMeshes.h
* Property type: integer.
*/
@ -97,11 +97,11 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Set the maximum number of triangles in a mesh.
/** @brief Set the maximum number of triangles in a mesh.
*
* This is used by the "SplitLargeMeshes" PostProcess-Step to determine
* whether a mesh must be splitted or not.
* \note The default value is AI_SLM_DEFAULT_MAX_TRIANGLES, defined in
* @note The default value is AI_SLM_DEFAULT_MAX_TRIANGLES, defined in
* the internal header file SplitLargeMeshes.h
* Property type: integer.
*/
@ -109,10 +109,10 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Set the maximum number of bones affecting a single vertex
/** @brief Set the maximum number of bones affecting a single vertex
*
* This is used by the aiProcess_LimitBoneWeights PostProcess-Step.
* \note The default value is AI_LBW_MAX_WEIGHTS, defined in
* @note The default value is AI_LBW_MAX_WEIGHTS, defined in
* the internal header file LimitBoneWeightsProcess.h
* Property type: integer.
*/
@ -120,7 +120,7 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Set the vertex animation keyframe to be imported
/** @brief Set the vertex animation keyframe to be imported
*
* ASSIMP does not support vertex keyframes (only bone animation is supported).
* The library reads only one frame of models with vertex animations.
@ -144,7 +144,7 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Configures the AC loader to collect all surfaces which have the
/** @brief Configures the AC loader to collect all surfaces which have the
* "Backface cull" flag set in separate meshes.
*
* Property type: integer (0: false; !0: true). Default value: true.
@ -153,11 +153,10 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Configures the ASE loader to always reconstruct normal vectors
/** @brief Configures the ASE loader to always reconstruct normal vectors
* basing on the smoothing groups loaded from the file.
*
* Many ASE files have invalid normals (they're not orthonormal). This
* is the fault of 3DS Max ASE exporter.
* Many ASE files have invalid normals (they're not orthonormal).
* Property type: integer (0: false; !0: true). Default value: false.
*/
#define AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS "imp.ase.reconn"
@ -165,7 +164,7 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Configures the LWO loader to load just one layer from the model.
/** @brief Configures the LWO loader to load just one layer from the model.
*
* LWO files consist of layers and in some cases it could be useful to load
* only one of them. This property can be either a string - which specifies
@ -178,18 +177,18 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Defines the output frame rate of the IRR loader.
/** @brief Defines the output frame rate of the IRR loader.
*
* IRR animations are difficult to convert for Assimp and there will
* always be a loss of quality. This setting defines how many keys per second
* the converter will compute.<br>
* are returned by the converter.<br>
* Property type: integer. Default value: 100
*/
#define AI_CONFIG_IMPORT_IRR_ANIM_FPS "imp.irr.fps"
// ---------------------------------------------------------------------------
/** \brief Specifies the maximum angle that may be between two vertex tangents
/** @brief Specifies the maximum angle that may be between two vertex tangents
* that their tangents and bitangents are smoothed.
*
* This applies to the CalcTangentSpace-Step. The angle is specified
@ -200,20 +199,22 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
#define AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE "pp.ct.max_smoothing"
// ---------------------------------------------------------------------------
/** \brief Specifies the maximum angle that may be between two face normals
* at the same vertex position that their are smoothed.
/** @brief Specifies the maximum angle that may be between two face normals
* at the same vertex position that their are smoothed together.
*
* Sometimes also refered to as 'crease angle'.
* This applies to the GenSmoothNormals-Step. The angle is specified
* in degrees, so 180 is PI. The default value is
* 175 degrees (all vertex normals are smoothed). The maximum value is 175
* Property type: float. Warning: seting this option may cause a severe
* loss of performance.
* in degrees, so 180 is PI. The default value is 175 degrees (all vertex
* normals are smoothed). The maximum value is 175. Property type: float.
* Warning: seting this option may cause a severe loss of performance. The
* performance is unaffacted if the AI_CONFIG_FAVOUR_SPEED flag is set, but
* the output quality may be reduced.
*/
#define AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE "pp.gsn.max_smoothing"
// ---------------------------------------------------------------------------
/** \brief Specifies the minimum number of faces a node should have.
/** @brief Specifies the minimum number of faces a node should have.
* This is an input parameter to the OptimizeGraph-Step.
*
* Nodes whose referenced meshes have less faces than this value
@ -225,19 +226,19 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Specifies whether the OptimizeGraphProcess joins nodes even if
/** @brief Specifies whether the OptimizeGraphProcess joins nodes even if
* their local transformations are inequal.
*
* By default, nodes with different local transformations are never joined.
* The intention is that all vertices should remain in their original
* local coordinate space where they are correctly centered and aligned,
* which does also allow for some significant culling improvements.
* which could also allow for significant culling improvements.
*/
#define AI_CONFIG_PP_OG_JOIN_INEQUAL_TRANSFORMS "pp.og.allow_diffwm"
// ---------------------------------------------------------------------------
/** \brief Sets the colormap (= palette) to be used to decode embedded
/** @brief Sets the colormap (= palette) to be used to decode embedded
* textures in MDL (Quake or 3DGS) files.
*
* This must be a valid path to a file. The file is 768 (256*3) bytes
@ -250,7 +251,7 @@ ASSIMP_API unsigned int aiGetVersionRevision ();
// ---------------------------------------------------------------------------
/** \brief Enumerates components of the aiScene and aiMesh data structures
/** @brief Enumerates components of the aiScene and aiMesh data structures
* that can be excluded from the import with the RemoveComponent step.
*
* See the documentation to #aiProcess_RemoveComment for more details.
@ -307,12 +308,15 @@ enum aiComponent
_aiComponent_Force32Bit = 0x9fffffff
};
// Remove a specific color channel 'n'
#define aiComponent_COLORSn(n) (1u << (n+20u))
// Remove a specific UV channel 'n'
#define aiComponent_TEXCOORDSn(n) (1u << (n+25u))
// ---------------------------------------------------------------------------
/** \brief Input parameter to the #aiProcess_RemoveComponent step:
/** @brief Input parameter to the #aiProcess_RemoveComponent step:
* Specifies the parts of the data structure to be removed.
*
* See the documentation to this step for further details. The property
@ -326,25 +330,31 @@ enum aiComponent
#define AI_CONFIG_PP_RVC_FLAGS "pp.rvc.flags"
// ---------------------------------------------------------------------------
/** \brief Input parameter to the #aiProcess_SortByPType step:
/** @brief Input parameter to the #aiProcess_SortByPType step:
* Specifies which primitive types are removed by the step.
*
* This is a bitwise combination of the aiPrimitiveType flags.
* Specifying all of them is illegal, of course. A typical use would
* be to easily exclude all line and point meshes from the import. This
* be to exclude all line and point meshes from the import. This
* is an integer property, its default value is 0.
*/
#define AI_CONFIG_PP_SBP_REMOVE "pp.sbp.remove"
// TransformUVCoords evalutes UV scalings
#define AI_UVTRAFO_SCALING 0x1
// TransformUVCoords evalutes UV rotations
#define AI_UVTRAFO_ROTATION 0x2
// TransformUVCoords evalutes UV translation
#define AI_UVTRAFO_TRANSLATION 0x4
// Everything baked together -> default value
#define AI_UVTRAFO_ALL (AI_UVTRAFO_SCALING | AI_UVTRAFO_ROTATION | AI_UVTRAFO_TRANSLATION)
// ---------------------------------------------------------------------------
/** \brief Input parameter to the #aiProcess_TransformUVCoords step:
/** @brief Input parameter to the #aiProcess_TransformUVCoords step:
* Specifies which UV transformations are evaluated.
*
* This is a bitwise combination of the AI_UVTRAFO_XXX flags (integer
@ -355,7 +365,7 @@ enum aiComponent
// ---------------------------------------------------------------------------
/** \brief Causes assimp to favour speed against import quality.
/** @brief A hint to assimp to favour speed against import quality.
*
* Enabling this option may result in faster loading, but it needn't.
* It represents just a hint to loaders and post-processing steps to use
@ -364,8 +374,4 @@ enum aiComponent
* The default value is 0.
*/
#define AI_CONFIG_FAVOUR_SPEED "imp.speed_flag"
#endif // !! AI_CONFIG_H_INC

View File

@ -186,6 +186,21 @@ struct aiNode
*/
#define AI_SCENE_FLAGS_NON_VERBOSE_FORMAT 0x8
/** @def AI_SCENE_FLAGS_TERRAIN
* Denotes pure height-map terrain data. Pure terrains usually consist of quads,
* sometimes triangles, in a regular grid. The x,y coordinates of all vertex
* positions refer to the x,y coordinates on the terrain height map, the z-axis
* stores the elevation at a specific point.
*
* TER (Terragen) and HMP (3D Game Studio) are height map formats.
* @note Assimp is propably not the best choice for loading *huge* terrains -
* fully triangulated data takes extremely much free store and should be avoided
* as long as possible (typically you'll do the triangulation when you actually
* need to render it).
*/
#define AI_SCENE_FLAGS_TERRAIN 0x16
// ---------------------------------------------------------------------------
/** The root structure of the imported data.
*

4
make_mingw.bat 100644
View File

@ -0,0 +1,4 @@
cd code
mingw32-make -f makefile.mingw
pause

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
http://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion
ReadmeFirst.txt
================
READMEFIRST v1.00 last update July 20, 2008 by B. Hahne
This READMEFIRST file accompanies the cgspeed.com "BVH conversion"
release of the Carnegie-Mellon University (CMU) Graphics Lab Motion
Capture Database. See "Where to find stuff" at the bottom of this
file for where to get the BVH conversion and/or the original CMU
dataset.
The original CMU motion capture database isn't in BVH format - it's
in ASF/AMC format. This BVH conversion release was created by Bruce
Hahne, a hobbyist animator, in the interest of making the data more
available and easily usable by other animators. I presently (2008)
maintain the web site www.cgspeed.com, where this BVH conversion
release will be available or linked.
The emphasis on this release is to produce BVH files that can rapidly
be used in MotionBuilder for motion retargetting. The files are not
yet particularly Poser-friendly or DazStudio-friendly, due to
incorrect assumptions that those programs have to make about the
underlying joint rotation setup.
[...]
USAGE RIGHTS:
CMU places no restrictions on the use of the original dataset, and I
(Bruce) place no additional restrictions on the use of this particular
BVH conversion.
Here's the relevant paragraph from mocap.cs.cmu.edu:
Use this data! This data is free for use in research and commercial
projects worldwide. If you publish results obtained using this data,
we would appreciate it if you would send the citation to your
published paper to jkh+mocap@cs.cmu.edu, and also would add this text
to your acknowledgments section: "The data used in this project was
obtained from mocap.cs.cmu.edu. The database was created with funding
from NSF EIA-0196217."
[...]

View File

@ -0,0 +1,210 @@
<?xml version="1.0"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<author>alorino</author>
<authoring_tool>Maya 7.0 | ColladaMaya v2.01 Jun 9 2006 at 16:08:19 | FCollada v1.11</authoring_tool>
<comments>Collada Maya Export Options: bakeTransforms=0;exportPolygonMeshes=1;bakeLighting=0;isSampling=0;
curveConstrainSampling=0;exportCameraAsLookat=0;
exportLights=1;exportCameras=1;exportJointsAndSkin=1;
exportAnimations=1;exportTriangles=0;exportInvisibleNodes=0;
exportNormals=1;exportTexCoords=1;exportVertexColors=1;exportTangents=0;
exportTexTangents=0;exportConstraints=0;exportPhysics=0;exportXRefs=1;
dereferenceXRefs=0;cameraXFov=0;cameraYFov=1</comments>
<copyright>
Copyright 2006 Sony Computer Entertainment Inc.
Licensed under the SCEA Shared Source License, Version 1.0 (the
&quot;License&quot;); you may not use this file except in compliance with the
License. You may obtain a copy of the License at:
http://research.scea.com/scea_shared_source_license.html
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</copyright>
</contributor>
<created>2006-06-21T21:23:22Z</created>
<modified>2006-06-21T21:23:22Z</modified>
<unit meter="0.01" name="centimeter"/>
<up_axis>Y_UP</up_axis>
</asset>
<library_cameras>
<camera id="PerspCamera" name="PerspCamera">
<optics>
<technique_common>
<perspective>
<yfov>37.8493</yfov>
<aspect_ratio>1</aspect_ratio>
<znear>10</znear>
<zfar>1000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
<camera id="testCameraShape" name="testCameraShape">
<optics>
<technique_common>
<perspective>
<yfov>37.8501</yfov>
<aspect_ratio>1</aspect_ratio>
<znear>0.01</znear>
<zfar>1000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_lights>
<light id="light-lib" name="light">
<technique_common>
<point>
<color>1 1 1</color>
<constant_attenuation>1</constant_attenuation>
<linear_attenuation>0</linear_attenuation>
<quadratic_attenuation>0</quadratic_attenuation>
</point>
</technique_common>
<technique profile="MAX3D">
<intensity>1.000000</intensity>
</technique>
</light>
<light id="pointLightShape1-lib" name="pointLightShape1">
<technique_common>
<point>
<color>1 1 1</color>
<constant_attenuation>1</constant_attenuation>
<linear_attenuation>0</linear_attenuation>
<quadratic_attenuation>0</quadratic_attenuation>
</point>
</technique_common>
</light>
</library_lights>
<library_materials>
<material id="Blue" name="Blue">
<instance_effect url="#Blue-fx"/>
</material>
</library_materials>
<library_effects>
<effect id="Blue-fx">
<profile_COMMON>
<technique sid="common">
<phong>
<emission>
<color>0 0 0 1</color>
</emission>
<ambient>
<color>0 0 0 1</color>
</ambient>
<diffuse>
<color>0.137255 0.403922 0.870588 1</color>
</diffuse>
<specular>
<color>0.5 0.5 0.5 1</color>
</specular>
<shininess>
<float>16</float>
</shininess>
<reflective>
<color>0 0 0 1</color>
</reflective>
<reflectivity>
<float>0.5</float>
</reflectivity>
<transparent>
<color>0 0 0 1</color>
</transparent>
<transparency>
<float>1</float>
</transparency>
<index_of_refraction>
<float>0</float>
</index_of_refraction>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="box-lib" name="box">
<mesh>
<source id="box-lib-positions" name="position">
<float_array id="box-lib-positions-array" count="24">-50 50 50 50 50 50 -50 -50 50 50 -50 50 -50 50 -50 50 50 -50 -50 -50 -50 50 -50 -50</float_array>
<technique_common>
<accessor count="8" offset="0" source="#box-lib-positions-array" stride="3">
<param name="X" type="float"></param>
<param name="Y" type="float"></param>
<param name="Z" type="float"></param>
</accessor>
</technique_common>
</source>
<source id="box-lib-normals" name="normal">
<float_array id="box-lib-normals-array" count="72">0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 -1 0 0 -1 0 0 -1 0 0 -1</float_array>
<technique_common>
<accessor count="24" offset="0" source="#box-lib-normals-array" stride="3">
<param name="X" type="float"></param>
<param name="Y" type="float"></param>
<param name="Z" type="float"></param>
</accessor>
</technique_common>
</source>
<vertices id="box-lib-vertices">
<input semantic="POSITION" source="#box-lib-positions"/>
</vertices>
<polylist count="6" material="BlueSG">
<input offset="0" semantic="VERTEX" source="#box-lib-vertices"/>
<input offset="1" semantic="NORMAL" source="#box-lib-normals"/>
<vcount>4 4 4 4 4 4</vcount>
<p>0 0 2 1 3 2 1 3 0 4 1 5 5 6 4 7 6 8 7 9 3 10 2 11 0 12 4 13 6 14 2 15 3 16 7 17 5 18 1 19 5 20 7 21 6 22 4 23</p>
</polylist>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="VisualSceneNode" name="untitled">
<node id="Camera" name="Camera">
<translate sid="translate">-427.749 333.855 655.017</translate>
<rotate sid="rotateY">0 1 0 -33</rotate>
<rotate sid="rotateX">1 0 0 -22.1954</rotate>
<rotate sid="rotateZ">0 0 1 0</rotate>
<instance_camera url="#PerspCamera"/>
</node>
<node id="Light" name="Light">
<translate sid="translate">-500 1000 400</translate>
<rotate sid="rotateZ">0 0 1 0</rotate>
<rotate sid="rotateY">0 1 0 0</rotate>
<rotate sid="rotateX">1 0 0 0</rotate>
<instance_light url="#light-lib"/>
</node>
<node id="Box" name="Box">
<rotate sid="rotateZ">0 0 1 0</rotate>
<rotate sid="rotateY">0 1 0 0</rotate>
<rotate sid="rotateX">1 0 0 0</rotate>
<instance_geometry url="#box-lib">
<bind_material>
<technique_common>
<instance_material symbol="BlueSG" target="#Blue"/>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id="testCamera" name="testCamera">
<translate sid="translate">-427.749 333.855 655.017</translate>
<rotate sid="rotateY">0 1 0 -33</rotate>
<rotate sid="rotateX">1 0 0 -22.1954</rotate>
<rotate sid="rotateZ">0 0 1 0</rotate>
<instance_camera url="#testCameraShape"/>
</node>
<node id="pointLight1" name="pointLight1">
<translate sid="translate">3 4 10</translate>
<rotate sid="rotateZ">0 0 1 0</rotate>
<rotate sid="rotateY">0 1 0 0</rotate>
<rotate sid="rotateX">1 0 0 0</rotate>
<instance_light url="#pointLightShape1-lib"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#VisualSceneNode"/>
</scene>
</COLLADA>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.