如何使用point3d使用setPosition?

发布于 2025-02-06 07:12:41 字数 78 浏览 2 评论 0原文

如何设置Point3D的位置? 2D点的位置可以使用方法设置设置,然后是board.fullupdate()。这似乎与Point3D不起作用。

How do I set the position of a Point3D? The Position of a 2D Point can be set with the method setPosition, followed by board.fullUpdate(). This does not seem to work with a Point3D.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

断肠人 2025-02-13 07:12:42

在v1.4.4中,仍缺少用于3D处理的许多功能,其中包括setPosition3d和moveto3d。

顺便说一句,point.moveto([x,y],time);是移动2D点的首选方法。 setPosition()被视为低水平。但是,可以通过设置Array P.D3.Coords 3D点P来完成setPosition3d()可以完成,然后进行板更新:

var p = view.create('point3d', [1, 1, 2], { size: 5 });

// Coordinates given in the form [1, x, y, z]
p.D3.coords = [1, 1, 1, -2];
board.update();

3D点的坐标阵列具有长度4(因为它包含均匀的坐标),并且是[1,x,x,y,z]的表单。

参见 https://jsfiddle.net/wmsg2963/ 用于工作示例。

In v1.4.4 many functions for 3D handling are still missing, among them are setPosition3D and moveTo3D.

By the way, point.moveTo([x,y], time); is the preferred way to move 2D points. setPosition() is considered as low level. Nevertheless, setPosition3D() can be done by setting the array p.D3.coords of a 3D point p, followed by a board update:

var p = view.create('point3d', [1, 1, 2], { size: 5 });

// Coordinates given in the form [1, x, y, z]
p.D3.coords = [1, 1, 1, -2];
board.update();

The coords array of a 3D point has length 4 (as it contains homogeneous coordinates) and is of the form [1, x, y, z].

See https://jsfiddle.net/wmsg2963/ for working example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文