openframeworks / openframeworks/openFrameworks
get mesh positions in ofxassimploader
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
Hi,
I've mentioned that Assimp model loader doesn't have positions of meshes. I've seen that the data is available in the Assimp library, but not interpreted in the addon.
I've allready made a start, but couldn't get the positions right.
//-------------------------------------------
ofPoint ofxAssimpModelLoader::getMeshPosition(int num){
ofPoint pos;
if((int)scene->mNumMeshes<=num){
ofLogError("ofxAssimpModelLoader") << "getMesh(): mesh id " << num
<< " out of range for total num meshes: " << scene->mNumMeshes;
return pos;
}
aiVector3D* verticles = scene->mMeshes[num]->mVertices;
ofPoint pt = ofPoint(verticles->x*normalizedScale,
verticles->y*normalizedScale ,
verticles->z*normalizedScale );
pt.rotate(-90, ofVec3f(1,0,0));
return pt;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading ofxAssimpModelLoader::getMeshPosition in the Assimp addon and the surrounding mesh-loading code. Check how Assimp exposes mesh data and how normalizedScale and rotation are applied elsewhere. Done means the getter returns the correct position for a requested mesh and handles invalid mesh indices consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100