Correct geometry but incorrect colors after following CAD viewer example

I am a bit confused with something. I followed the CAD viewer example as closely as possible, and currently it seems the colors we are reading do not match the CAD file.

It seems we are somehow permuting the colors of the nodes. However, this is the snippet oh where we load our data:

NodeGeometry getNodeGeometry(A3DTree* const hnd_tree, A3DTreeNode* const hnd_node) {
	NodeGeometry geometry;

	// Extract the geometry as an A3DMeshData and collect their position and color to render it
    A3DMeshData mesh_data;
    A3D_INITIALIZE_DATA(A3DMeshData, mesh_data);
    A3DStatus code = A3DTreeNodeGetGeometry(hnd_tree, hnd_node, A3D_TRUE, &mesh_data, 0);

    if (code == A3D_SUCCESS) {
        Mat4 position = he_extract_position(hnd_node);
		Vec4 color = he_extract_color(hnd_node);

		geometry.color = color;
		geometry.transformation = position;
             /*more stuff*/
    }
   return geometry;
}

We are clearly loading the position/transformation at the exact same time as the color and we are completely certain we are not ever over writing the color. So we don’t understand how one can be right and the other wrong. They should both either be correct or incorrect.

This is our full code atm:
ForesightLoader.cpp (20.9 KB)

Which we based off of the CAD viewer example.

And we got the input file from autodesk, we used the second example titled rac_basic_sample_project.rvt

I have asked a colleague to look at the code and he also seemed confused as it seems we are doing what the tutorial says to do. We are hoping you can give us some pointers as to what is happening.

I can only post a few media per comment, so here are the images;

Our rendering:

Autodesk viewer:

Additionally, the autodesk viewer shows an IfcGUID , I am trying to find which HOOPS identifier corresponds to it.

It doesn’t seem to be rbd.m_pcPersistentId from A3DRootBaseData. Any suggestions as to which field might have that IFC id?

Hello @camilo.talero
By checking the Revit file, the color information is stored in A3DTessFaceData::m_puiStyleIndexes. You can refer to the example MeshViewer, and look at the function RepresentationItem::build_buffer_per_style.
As for IfcGUID, they are stored as attribute.

Best Regards,
Man