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.