openframeworks / openframeworks/openFrameworks

get mesh positions in ofxassimploader

Open
#2,980 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

addon feature prelim-analysis section-3D
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.