Below is sample code on how to create a fixed size sphere(red) in scene.
Size of the sphere does not change when you zoom.
HC_Open_Segment_By_Key(m_pHView->GetModelKey()); {
float cube[24] = {
-1.0f, -1.0f, -1.0f,
1.0f, -1.0f, -1.0f,
-1.0f, 1.0f, -1.0f,
1.0f, 1.0f, -1.0f,
-1.0f, -1.0f, 1.0f,
1.0f, -1.0f, 1.0f,
-1.0f, 1.0f, 1.0f,
1.0f, 1.0f, 1.0f };
int conn[30] = {
4, 0,1,3,2,
4, 1,5,7,3,
4, 5,4,6,7,
4, 4,0,2,6,
4, 2,3,7,6,
4, 4,5,1,0 };
HC_Open_Segment(""); {
HC_Insert_Shell(8, cube, 30, conn);
HC_Open_Segment(""); {
// Translate red sphere to the corner of cube
HC_Translate_Object(1, 1, 1);
HC_Open_Segment(""); {
float center[] = { 0,0, 0 };
// Sphere need to be created at the origin
HC_Insert_Sphere(center, 0.1f, NULL, NULL);
HC_Set_Color("Red");
HC_Set_Rendering_Options("mask transform=(camera=(scale))");
} HC_Close_Segment();
} HC_Close_Segment();
} HC_Close_Segment();
} HC_Close_Segment();
Video: