可缩放至 Android 设备上的相机 3D 线
我需要在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何类型的几何形状都会出现这种情况。但是,您可以使用深度钳制来避免剪裁的某些影响。有关详细信息,请参阅此处 http://arcsynthesis.org/gltut/Positioning/Tut05%20Depth %20Clamping.html
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