• ARKit的使用


    //创建场景

            let scene = SCNScene()

            /*

             //1.几何

             let box = SCNBox.init( 0.1, height: 0.1, length: 0.1, chamferRadius: 0  )

             //2.渲染

             let materil = SCNMaterial.init()

             materil.diffuse.contents = UIColor.red

             box.materials = [materil]

             

             //3.节点

             let node = SCNNode.init(geometry: box)

             node.position = SCNVector3.init(0, 0, -0.5)

             scene.rootNode.addChildNode(node)

             

             */

            

            //几何 渲染

            let text = SCNText.init(string: "hello ARKit", extrusionDepth: 0)

            text.font = UIFont.init(name: "Future", size: 0.15)

            text.firstMaterial?.diffuse.contents = UIColor.orange

            text.firstMaterial?.specular.contents = UIColor.white

            //几点

            let textNode = SCNNode.init(geometry: text)

            textNode.position = SCNVector3.init(0, 0, -0.5 )

    //        textNode.scale =

            

            scene.rootNode.addChildNode(textNode)

            

            

            

            //把场景显示出来

            sceneView.scene = scene;

            

  • 相关阅读:
    Apple Magic Trackpad All In One
    git tag All In One
    Python 字符串插值 All In One
    Pycharm 如何自定义新建的 Python 文件的注释模版 All in One
    How to Create a New File on Mac with Finder All In One
    Python & PEP 8 & Style Guide All In One
    python 中(序列)内置函数enumerate
    c语言中枚举类型
    c语言中利用函数递归求阶乘
    linux 中sed命令如何删除第一列和最后一列
  • 原文地址:https://www.cnblogs.com/daxueshan/p/7643098.html
Copyright © 2020-2023  润新知