Quantcast
Viewing all articles
Browse latest Browse all 40524

Posing with ofxAssimpModelLoader

Is there any chance of you updating the code in that pastebin with something that compiles with the latest version of OF? I had to fix a problem with a crash in the loop area, but using your random rotation code, nothing is happening to the model (a makehuman model).

I had to change your code:

meshHelper.animatedPos.resize(mesh->mNumVertices);
meshHelper.animatedPos.assign(meshHelper.animatedPos.size(), aiVector3t<float>(0));
if(mesh->HasNormals()){
	meshHelper.animatedNorm.resize(mesh->mNumVertices);
	meshHelper.animatedNorm.assign(meshHelper.animatedNorm.size(), aiVector3t<float>(0));
}

which without this caused the following lines to cause a segfault:

meshHelper.animatedPos[vertexId] += weight.mWeight * (posTrafo * srcPos);
meshHelper.animatedNorm[vertexId] += weight.mWeight * (normTrafo * srcNorm);

since passing an index that is out-of-bounds to `vector<T>::operator[]` is undefined behavior. --- However, I've fixed that, but nothing is actually happening. I thought maybe it's because I'm drawing incorrectly:

this->modelLoader.drawFaces();

but I don't know what else I'd do to draw these things. The model draws, but it's just in its original pose.

What am I doing wrong? I realize the code is a few years old but it wasn't much different to get it to compile. Something lacking in these examples is the drawing calls within the ofApp::draw() method.


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>