Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: ofxAssimpModelLoader getMeshes() function to return a vector <ofMesh> #5929

Open
dimitre opened this issue Mar 16, 2018 · 0 comments

Comments

@dimitre
Copy link
Member

dimitre commented Mar 16, 2018

it would be nice to have a function like this in ofxAssimpModelLoader

//-------------------------------------------
vector <ofMesh> ofxAssimpModelLoader::getMeshes() {
	vector <ofMesh> m;
	for(int i=0; i<(int)scene->mNumMeshes; i++){
		ofMesh ofm;
		ofm.setMode(OF_PRIMITIVE_TRIANGLES);
		aiMeshToOfMesh(scene->mMeshes[i],ofm);
		m.push_back(move(ofm));
	}
	return move(m);
}

to be used like this, for example:

for (auto & m : model.getMeshes()) {
	m.setMode(OF_PRIMITIVE_LINES);
	m.drawWireframe();
}

In fact it is already tested and working here, just not sure about the move() commands.
Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant