SCNText渲染没有曲线,不像字体
当我运行这个SceneKit代码时:
let txt = SCNText(string: "Hello", extrusionDepth: 0.2) let textNode = SCNNode(geometry: txt) scene.rootNode.addChildNode(textNode)
我得到非常有angular度的文字:
它似乎这样做,不pipe字体,它在设备上的行为与在模拟器中的行为相同。
以下是上下文中的代码:
// create a new scene let scene = SCNScene() // create and add a camera to the scene let cameraNode = SCNNode() cameraNode.camera = SCNCamera() scene.rootNode.addChildNode(cameraNode) // place the camera cameraNode.position = SCNVector3(x: 10, y: 0, z: 75) // create and add a light to the scene let lightNode = SCNNode() lightNode.light = SCNLight() lightNode.light!.type = SCNLightTypeOmni lightNode.position = SCNVector3(x: 0, y: 10, z: 10) scene.rootNode.addChildNode(lightNode) // create and add an ambient light to the scene let ambientLightNode = SCNNode() ambientLightNode.light = SCNLight() ambientLightNode.light!.type = SCNLightTypeAmbient ambientLightNode.light!.color = UIColor.darkGrayColor() scene.rootNode.addChildNode(ambientLightNode) let txt = SCNText(string: "Hello", extrusionDepth: 0.2) let textNode = SCNNode(geometry: txt) scene.rootNode.addChildNode(textNode) // retrieve the SCNView let scnView = self.view as! SCNView // set the scene to the view scnView.scene = scene
SCNText
为您的文本细分SCNText
path,就像Core Graphics在绘制文件时所做的一样。 您始终可以使用flatness
属性使其更平滑,但不会获得“亚像素平滑度”。
为了解决这个问题,你可以使用更大的字体大小,这样当发生离散化时,底层Bézierpath更大,生成更多的顶点。
- 从Objective-C向Google Spreadsheet Form提交数据
- 如何解除UIActionSheets和UIPopoverControllers而不知道是谁出示的
- 核心数据或NSUserDefaults
- 使用CFBundleDocumentTypes:为什么我的应用程序不会显示在“共享”菜单中?
- 按下Homebutton会导致SpriteKit SKView中的EXC_BAD_ACCESS代码= 1
- 如何获得项目的坐标,而它是animation?
- iOS 8 MDM:托pipe的应用程序configuration不起作用
- 如何防止Phonegap应用程序中的地理位置双重提示?
- 更改UIButton的标题不起作用