Open Inventor(Coin3D)中的某些转换

发布于 2024-08-28 03:52:48 字数 599 浏览 3 评论 0原文

我对 Open Inventor(Coin3D) 很陌生,并且遇到以下问题:

我有一个 SoSelection 持有根节点(也是 SoSeparator)。还有 根节点保存有多个SoSeparator节点。每个 SoSeparator 节点都包含一个 SoTransform 节点和一个 SoCube 节点。

当我选择一个立方体节点时,我希望距所选立方体一定距离内的所有其他立方体围绕所选立方体排列成一圈。 (此外,所有立方体都应该在一个平面上) 附加信息:我的立方体始终沿相机方向定向 (cubeTransform_->rotation.connectFrom(&camera_->orientation)

假设选定的立方体是圆的中心,我如何将其他立方体平移平面上的圆(垂直于所选立方体和相机之间的矢量)? 特别是如何在平面上找到距离轴(从中心立方体到相机)有一定距离的圆的坐标。

我已经做的是,一旦选择了一个立方体,就搜索一定距离内的所有立方体。 因此,我已经在 SoPathList 中拥有了所需的分隔符(其中包含相应的 SoTransforms 和 SoCubes)。 现在我想通过修改相应的 SoTransform->translation 值来排列立方体。

问候马克

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 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文