OpenGL ES 帮助——提高 PanoramaGL 的球面分辨率?

发布于 2024-10-07 01:01:12 字数 1303 浏览 0 评论 0原文

那天晚上我开始尝试 PanoramaGL。在对下载的项目进行了一番修改之后(有一些小问题导致它无法立即编译),我让它开始工作——我加载了一张 1200 x 512(左右)的全景图像,并且球形视图工作得很好。有两个问题:我加载了太大的纹理,这使得该功能只能在 iPhone4 上运行(至少,我认为这就是它在我的 iPad 上无法运行的原因),而且全景图非常模糊。

我开始对 iPhone 上的 3D 进行一些研究,并且我并不(太)尴尬地承认大多数概念都超出了我的理解范围。我没有任何使用 3D 的经验,我希望能从 StackOverflow 的好人那里得到一些帮助。

这就是我想要做的:我想将我的全景图像分解为图块(我正在考虑垂直条,但我愿意以其他方式做到这一点)。我想将这些图块作为纹理加载到 PLSphere 视图上,并告诉它某个图块对应于某些角度。

查看 PanoramaGL 的源代码,看起来有一个放置此代码的好地方。在 PLSphere 类中,有这样的代码块

- (void)internalRender
{
    gluQuadricNormals(quadratic, GLU_SMOOTH);
    gluQuadricTexture(quadratic, true);

    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, ((PLTexture *)[textures objectAtIndex:0]).textureId);

    gluSphere(quadratic, kRatio, divs, divs);

    glDisable(GL_TEXTURE_2D);
}

:在 PLCube 中,我在其 internalRender 方法中看到以下代码:

// Front Face
glBindTexture(GL_TEXTURE_2D, ((PLTexture *)[textures objectAtIndex:kCubeFrontFaceIndex]).textureId);
glNormal3f(0.0f, 0.0f, 1.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

基于此,我认为我可以指定一个方向(使用类似 glNormal3f code>) 并将图块绑定为纹理。

我走在正确的轨道上吗?我希望有人能为我提供指导,使其发挥作用。

谢谢!

I started playing around with PanoramaGL the other night. After finagling with the downloaded project (there were some minor issues that prevented it from compiling right out the gate), I got it to work -- I loaded up a 1200 by 512(ish) panorama image and got the spherical view working pretty well. Two problems: I'm loading too large of a texture, which makes this work only on an iPhone4 (at least, I think that's why it didn't work on my iPad), and the panorama turned out to be pretty blurry.

I started doing a bit of studying on doing 3D on the iPhone and I'm not (too) embarrassed to admit that most of the concepts are over my head. I don't have any experience working with 3D and I'm hoping to get some help from the good folks here at StackOverflow.

Here's what I want to do: I want to break up my panorama image into tiles (I was thinking vertical strips but I'm open to doing it in other ways). I want to load these tiles as textures on the PLSphere view and tell it that a certain tile corresponds to certain angles.

Looking at the source of PanoramaGL, it looks like there'd be a good place to put this code in. In the PLSphere class, there's this block of code:

- (void)internalRender
{
    gluQuadricNormals(quadratic, GLU_SMOOTH);
    gluQuadricTexture(quadratic, true);

    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, ((PLTexture *)[textures objectAtIndex:0]).textureId);

    gluSphere(quadratic, kRatio, divs, divs);

    glDisable(GL_TEXTURE_2D);
}

And looking at PLCube, I see the following code in its internalRender method:

// Front Face
glBindTexture(GL_TEXTURE_2D, ((PLTexture *)[textures objectAtIndex:kCubeFrontFaceIndex]).textureId);
glNormal3f(0.0f, 0.0f, 1.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

Based on this, I would think that I could specify a direction (using something like glNormal3f) and bind a tile as a texture.

Am I on the right track here? I'm hopeful someone can provide me with guidance to get this to work.

Thanks!

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

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

发布评论

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

评论(1

梦魇绽荼蘼 2024-10-14 01:01:12

您可以使用 Hugin/pano 将球形纹理更改为 6 个立方体纹理
请参阅

http://vinayhacks.blogspot.com/2010/11/ conversion-equirectangle-panorama-to.html

纹理大小不是必须是 2 的幂吗?

You can change speherical to 6 cube textures using hugin/pano
see

http://vinayhacks.blogspot.com/2010/11/converting-equirectangular-panorama-to.html

dont texture sizes have to be powers of 2?

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