Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
405 views
in Technique[技术] by (71.8m points)

javascript - 在立方体贴图内映射等矩形正方形切片| Javascript / Python(Map an equirectangular square slice inside cubemap | Javascript/Python)

I'm trying to map a square slice of an equirectangular image inside a cubemap with 6 faces, without distortion.

(我正在尝试在具有6个面的立方体贴图中映射等角矩形图像的正方形切片,而不会发生变形。)

The point is that I'm dealing with huge array sizes if I try to project the whole equirectangular texture (because the circumference is Earth-like), so I'm cutting it into pieces on demand, with a higher detail.

(关键是,如果我尝试投影整个等矩形纹理(因为圆周像地球一样),那么我将处理巨大的数组大小,因此我将根据需要将其切成碎片,并提供更高的细节。)

I need to convert/project this square image (512*512px) which is covering 0.08° of the 360*180 degrees that the equirectangular image provides.

(我需要转换/投影这个正方形图像(512 * 512px),该图像覆盖等矩形图像提供的360 * 180度的0.08°。)

The total circumference is 4407500mts.

(总周长为4407500mts。)

and the offset is 34.5° Lat and 56.8 ° Lon.

(偏移为34.5°纬度和56.8°纬度。)

(These values would change, but not the circumference)

((这些值会改变,但周长不会改变))

Can you help me to find a way to project that image onto a cubemap?

(您能帮我找到一种将图像投影到立方体贴图上的方法吗?)

I already have an algorithm to make a cubemap from the full equirectangular image but can't find a way to do the same with just a squared portion of it.

(我已经有一种算法可以从整个等角矩形图像制作一个立方体贴图,但是找不到一种方法可以仅用它的平方部分来做同样的事情。)

Thanks!

(谢谢!)

  ask by user12451423 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...