Whenever I select a target mesh object, my goal is to connect a standard size sphere mesh object to it. In case the target mesh has been scaled differently than (1,1,1), the code below will make sure that the scaling of the attached marker sphere adjusts accordingly to maintain a consistent radius.
//...attach marker sphere to clicked object
intersected_object.add(marker_sphere);
var positionV3 = new THREE.Vector3();
positionV3 = intersected_object.worldToLocal(intersects[0].point);
xxx = F_Position_Copy_from_vector3_to_Object3D(positionV3, marker_sphere);
marker_sphere.scale.x = 1/intersected_object.scale.x;
marker_sphere.scale.y = 1/intersected_object.scale.y;
marker_sphere.scale.z = 1/intersected_object.scale.z;
However, if the selected target mesh is a child of a parent mesh (or an Object3D) with non-uniform scaling, then we need to consider the parent's scaling when adjusting the marker sphere's scale. This becomes even more complex if the target is a grandchild.
One alternative approach would be to identify the most senior object within the target's ancestry hierarchy (excluding Scene) and base the positioning and scaling of the attached marker sphere on the values of this senior object.
INQUIRY
Is there an efficient and reliable method to determine the "senior" object in the ancestry hierarchy of a mesh object?