EVO 3d 和绘制文本
我正在为 evo 3d 创建一个 s3d 应用程序,并且我拥有所有图形设置并在 3d 中完美工作。我的问题是,如何使用drawText并将其变成3d?到目前为止,使用drawText我只能让文本显示在“左眼”视图中,但在“右眼”视图中屏幕上没有显示任何内容。
I'm creating a s3d app for the evo 3d and I have all the graphics setup and working perfectly in 3d. My question is, how do I use drawText and make it 3d? So far using drawText I can only get the text to show in the "left eye" view but in the "right eye" view nothing is displayed on the screen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道在 Android 上创建 3D 应用程序的过程,但我假设您正在生成标准的并排图片。如果这是真的,您将必须使用不同的坐标调用drawText两次 - 一次用于左眼,一次用于右眼。
然而,使用drawText在场景上显示文本的问题是它不支持眼睛位移。双眼看到的效果完全相同,给人一种无限远的感觉。这反过来又会扰乱整个场景的 3D 印象,因为最终会出现无限远的物体覆盖您的对象,这意味着它仍然在它们的前面。
我建议您了解您用于 3D 图形的框架是否能够在 3D 空间中绘制文本。简而言之,您需要一个多边形,您可以在其上绘制文本并将其放置在 3D 场景中所有内容的前面。换句话说,您的文本不再是叠加层,而是 3D 场景的一部分。
至于将这个多边形放在哪里以便它始终位于其他所有物体之前的问题,我建议将其位置锁定到近裁剪平面。
希望这有帮助,希望我说得足够清楚:)
I don't know the process of creating 3D apps on Android, but I'll assume you're producing a standard side-by-side picture. If this is true, you will have to call drawText twice with different coordinates - once for the left eye and once for the right eye.
The problem, however, with using drawText to show text over your scene is that it does not honour the eye displacement. It will show up exactly the same for both the eyes, which gives an impression of it being infinitely far away. This in turn messes up the impression of 3D of your entire scene, because you end up having something appearing infinitely far covering your objects, which then means it's still in front of them.
I suggest you find out whether the framework you're using for 3D graphics has a means to draw text in 3D space. In short, you would want a polygon onto which you will draw your text and position it in front of everything in your 3D scene. In other words, your text is no longer an overlay, but a part of the 3D scene.
As for the question of where to put this polygon so that it's always in front of everything else, I would suggest locking its position to the near clipping plane.
Hope this helps, hope I was clear enough :)