在3D中使线更粗? [英] Make a line thicker in 3D?

查看:126
本文介绍了在3D中使线更粗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于这个问题

使用SceneKit在两点之间绘制一条线

我正在用3D绘制一条线,并希望通过使用此代码使其更粗

I'm drawing a line in 3D and want to make it thicker by using this code

  func renderer(aRenderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: NSTimeInterval) {
    //Makes the lines thicker
    glLineWidth(20)
  }

但它不起作用,iOS 8.2.

but it doesn't work, iOS 8.2.

还有另一种方法吗?

更新

Update

来自文档

https://developer.apple.com/library/prerelease/ios/documentation/SceneKit/Reference/SCNSceneRendererDelegate_Protocol/index.html#//apple_ref/occ/intfm/SCNSceneRendererDelegate/renderer:updateAtTime :

我确实添加了SCNSceneRendererDelegate和有效的线宽,但是仍然无法增加线宽.

I did add SCNSceneRendererDelegate and a valid line width but still could not get the line width to increase.

推荐答案

您不能为glLineWidth()分配任何数字. 您可以通过以下方式检查glLineWidth()的可能值范围:

You cannot assign any number to glLineWidth(). You can check the range of possible values of glLineWidth()by:

glGetFloatv(GL_LINE_WIDTH_RANGE,sizes);

一个疯狂的想法是使用圆柱体绘制线条;).当我想拥有漂亮且可控制的线条时,我会使用它,但是我不知道这样做有一个方便的OpenGl函数.

One crazy idea is to use a cylinder for drawing lines ;). I use it when I want to have nice and controllable lines but I am not aware of a handy OpenGl function to do so.

这篇关于在3D中使线更粗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆