相关疑难解决方法(0)

如何将透视变换应用于UIView?

我想在UIView上执行透视变换(例如在coverflow中看到)

有谁知道这是否可能?

我已经调查过使用CALayer并且已经完成了所有实用的程序员Core Animation播客,但我仍然不清楚如何在iPhone上创建这种转换.

任何帮助,指针或示例代码片段将非常感谢!

cocoa-touch core-animation calayer uiview ios

199
推荐指数
2
解决办法
11万
查看次数

获取节点scenekit中顶点的位置

我有一个以编程方式创建的平面,我想获得该平面所具有的一个顶点的坐标.像这样的东西:print(Plane.vertices[1].position)它可能会打印如下:(x:1,y:1),并print(Plane.vertices[2].position)打印(x - 1,y:1)

在此输入图像描述 这就是我创造飞机的方式:

let positions = [SCNVector3Make(  0, -0.1,  0),
                         SCNVector3Make(  0.3, -0.1,  0),

                         SCNVector3Make(  0,  0.1,  0),
                         SCNVector3Make(  0.3,  0.1,  0),
                         ]
        let indices :[UInt16] = [

            0, 1, 2,
            1, 3, 2,
            ]

        let vertexSource = SCNGeometrySource(vertices: positions, count: 4)
        let indexData = NSData(bytes: indices, length: MemoryLayout<CInt>.size * indices.count)


        let newElement = SCNGeometryElement(data: NSData(bytes: indices, length: indices.count * MemoryLayout<Int16>.size) as Data, primitiveType: .triangles , primitiveCount: 2, bytesPerIndex: MemoryLayout<Int16>.size)

        let geometry = SCNGeometry(sources: [vertexSource], …
Run Code Online (Sandbox Code Playgroud)

scenekit swift

4
推荐指数
1
解决办法
2460
查看次数

标签 统计

calayer ×1

cocoa-touch ×1

core-animation ×1

ios ×1

scenekit ×1

swift ×1

uiview ×1