将二维空间中的点映射到球体

发布于 2024-10-05 07:29:47 字数 505 浏览 3 评论 0原文

我在矩形 x/y 空间中有一堆点,我想将它们投影到球体上。就像,我正在尝试编写这个函数:

function point_on_sphere(2dx:Number, 2dy:Number) : Vector3D
{
    //magic

    return new Vector3D(3dx, 3dy, 3dz);
}

我一直在尝试首先将点绘制到圆柱体上,然后按照 此维基百科页面。 但是,这些公式假设常量 z=0,这并不能真正达到我想要的效果。

我正在使用 actionscript 3 / flex,但是任何伪代码或正确方向的推动将不胜感激。

只是为了澄清:我并不是试图将纹理应用于球体对象,而是沿着假想的球体放置对象。

I have a bunch of points in a rectangular x/y space which I would like to project onto a sphere. As in, I am trying to write this function:

function point_on_sphere(2dx:Number, 2dy:Number) : Vector3D
{
    //magic

    return new Vector3D(3dx, 3dy, 3dz);
}

I have been trying to first plot the points on to a cylinder and then map those points to a sphere as directed by this wikipedia page. However, those formulas assume a constant z=0, which doesn't really do what I want.

I'm using actionscript 3 / flex, but any pseudo code or pushes in the right direction would be greatly appreciated.

Just to clarify: I'm not trying to apply a texture to a sphere object, but rather to place objects along an imaginary sphere.

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

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

发布评论

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

评论(1

南街女流氓 2024-10-12 07:29:47

没有一个正确答案。您可以根据您想要如何沿球体放置对象来选择不同的方法。

当你越来越接近球体的“两极”时,物体彼此越来越近,这样可以吗?为什么普通的纹理映射投影实际上对您不起作用?

There is no one right answer. You can choose different approaches based on how you want to place the objects along the sphere.

Is it OK for the objects to get nearer and nearer to each other as you get closer to the sphere's "poles"? Why wouldn't the normal texture-mapping projection actually work for you?

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