可缩放至 Android 设备上的相机 3D 线

发布于 2024-12-22 22:55:10 字数 310 浏览 1 评论 0原文

我需要在 Android 设备上使用 open gl 绘制一条不断增长的 3d 线。

问题是我需要绘制具有“激光”类型效果的缩放线条。

最初我只是想绘制简单的 gl 线或线环,但如果相机靠近它们,它们就不会缩放 - 就像飞过一样。

我的下一个想法是生成一个圆柱体网格并挤压它,就像我实时做一条线一样,通过在从终点挤压一个新圆柱体后添加 45 度旋转来考虑 90 度旋转,再次将末端旋转 45 度并挤压另一个圆柱体圆柱体来创建新的直线延伸等等...

圆柱体的问题是近剪裁平面将穿过它们。

任何人有更好的想法或主意可以向我提出吗?

I need to draw a growing 3d line using open gl on an Android device.

The problem is I need to draw lines that scale with a "laser" type effect on them.

Originally I just thought of drawing simple gl lines or line loops but they wont scale if the camera is moved closer to them - like a fly through.

My next thought was to generate a cylinder mesh and extrude it as I would do a line in real time, accounting for 90 degree turns by adding a 45degree rotation after extruding from the end point a new cylinder, turning the end 45degrees again and extruding another cylinder to create the new line extension and so on and so-forth...

Problem with cylinders is the near clipping plane will clip through them.

Anyone have a better thought or idea they can throw at me for this?

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

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

发布评论

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

评论(1

怎樣才叫好 2024-12-29 22:55:10

圆柱体的问题是近裁剪面会穿过它们。

任何类型的几何形状都会出现这种情况。但是,您可以使用深度钳制来避免剪裁的某些影响。有关详细信息,请参阅此处 http://arcsynthesis.org/gltut/Positioning/Tut05%20Depth %20Clamping.html

Problem with cylinders is the near clipping plane will clip through them.

This will be the case with any kind of geometry. You can however use depth clamping to avoid some of the effects of clipping. See here for details http://arcsynthesis.org/gltut/Positioning/Tut05%20Depth%20Clamping.html

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