将二维空间中的点映射到球体
我在矩形 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有一个正确答案。您可以根据您想要如何沿球体放置对象来选择不同的方法。
当你越来越接近球体的“两极”时,物体彼此越来越近,这样可以吗?为什么普通的纹理映射投影实际上对您不起作用?
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?