I am quite new to Open Inventor(Coin3D) and have the following problem:
I have a SoSelection holding a root node(also SoSeparator). And the root node holds a number of SoSeparator nodes. Each of these SoSeparator nodes holds a SoTransform node and a SoCube node.
When I select one cube node I want all other cubes within a certain distance to the selected cube to arrange in a circle arround the selected cube. (Moreover all of the cubes should be on a plane than) An 开发者_StackOverflow社区additional information: My cubes are always oriented in the camera direction with (cubeTransform_->rotation.connectFrom(&camera_->orientation)
Assuming the selected cube is the center of the circle, how do I translate the other cubes in a circle on a plane(perpendicular to the vector between the selected cube and the camera)? Especially how do I find coordinates on the plain on which the circle should be which have a certain distance from the Axis (from center cube to camera).
What I already did is to search for the for all cubes within a certain distance as soon as one cube is selected. As a result I already have the required separators (which are holding the according SoTransforms and SoCubes) in a SoPathList. Now I want to arrange the cubes by modifing the according SoTransform->translation values.
Regards Mark
精彩评论