ofxAssimpLoader vertex num is bigger then dae file's vertex num

I am working with OF 0.8.0 and targeting Android OS.

I design an animated object in 3ds Max 2009. I export it to openCollada format.
Then I load the animated model via ofxAssimpModelLoader addon into openFrameworks.

The vertex num of the created object is not equal to the vertex number of the loaded DAE file.

3ds Max mesh’s vertex num: 281
openCollada file’s position array length: 281
ofxAssimpModelLoader.modelMeshes[0].mesh->mNumVertices: 625

The object can be drawn correctly on the screen. But due to bigger number of vertex num, drawing operation works slower.

What is the reason of the difference of the vertex num?

I think the reason of this difference is here:
an assimp forum post about vertex num difference

assimp generates at least 1 vertice per edge. So if I understand correctly, for example, it generates at least 18 vertices for a textured cube.

The vertice num difference is not an openFrameworks issue.

You can add flags when you load models using
Have you tried:

#include "aiPostProcess.h"
ofxAssimpModelLoader model;
model.load("fichier.dae", aiProcess_JoinIdenticalVertices | ai_OptimizeMeshes);

I’ve tried with a cube. which has in Blender 8 vertices, 6 quad faces or 12 triangle faces.
When I import it, I’ve got 24 vertices and 12 triangular faces.
I guess that it is copying the vertices instead of putting it in an array and index it.

Flags aren’t changing anything for me.

And strange thing is that when I import the same object in .obj, I only have 8 vertices.

Your cube should contain 18 edges. So, altought they say in the given link that assimp generates 1 vertex per edge, your test shows that it generates even more vertices than that.

I tried the optimization flags. No success. It looks like optimization flags have no effect.

I think I’ve got it.

A vertex is described by its position but it may have a normal and uv coord too.
If your model isn’t smoothed, a face is maybe sharing the same vertex but not the same normal.

Try to smooth your model and tell me if it works. For me, it was successful. (I had no UVs on that cube).

sam_sept, do u mean smoothing in design environment before exporting the skinned mesh?

Yes, smoothing your mesh in 3dsmax then export it in .dae.
Hope it will work.

when I say smoothing, I don’t mean a turbosmooth or something like that, just smooth instead of facets.

Well, I am afraid i did not understand what you have mean by “smooth instead of facets” :smiley:

The general way I know to smooth a mesh is Turbosmooth. And it is definitely not the way I am looking for; because I want to reduce the total vertex num, not to raise it.

Unfortunately the obj format is not a choice for my case neither. Because my mesh is not a static one but it is a skinned mesh.

Can you please kindly explain me what you suggest to do to “smooth instead of facets”?

Hi Rancs,
the right word was “shading”.
Here is a comparison between smooth shading and flat shading:

That’s beautiful, I will test it. Thank you.