小编San*_*811的帖子

在Scenekit中使用.obj从文档目录中加载.mtl文件以获取纹理

我正在尝试从文档目录加载下载的3d对象。我已经成功地在Scenekit中加载了3d对象文件和.mtl文件,但是在.mtl文件中命名的图像无法渲染以在3d模型上应用纹理,这些图像也以与.mtl文件中相同的名称放置在文档目录中。

下面是使用的代码

func loadObjToScene() {
    let scene = SCNScene()

    let cameraNode = SCNNode()
    cameraNode.camera = SCNCamera()
    scene.rootNode.addChildNode(cameraNode)

    cameraNode.position = SCNVector3.init(0, 0, 15)

    // create and add a light to the scene
    let lightNode = SCNNode()
    lightNode.light = SCNLight()
    lightNode.light?.type = .omni
    lightNode.position = SCNVector3.init(0, 0, 10)
    scene.rootNode.addChildNode(lightNode)

    // create and add an ambient light to the scene
    let ambientLightNode = SCNNode()
    ambientLightNode.light = SCNLight()
    ambientLightNode.light?.type = .ambient
    ambientLightNode.light?.color = UIColor.darkGray
    scene.rootNode.addChildNode(ambientLightNode)


    scnView.scene = scene
    scnView.allowsCameraControl = true
    scnView.showsStatistics = false …
Run Code Online (Sandbox Code Playgroud)

3d xcode scenekit swift arkit

6
推荐指数
0
解决办法
257
查看次数

如何在IGListKit中添加像表视图标题这样的sectionHeader

IGListKit库链接:https : //github.com/Instagram/IGListKit

我使用IGListKit制作了不同的单元格。我成功完成了此任务,但无法使用iglistKit为不同部分添加标题

ios swift

2
推荐指数
1
解决办法
2327
查看次数

标签 统计

swift ×2

3d ×1

arkit ×1

ios ×1

scenekit ×1

xcode ×1