public func transform<R: RectProtocol>(_ rect: R) -> [R.PointType] where R.Element: BinaryFloatingPoint { let points: [R.PointType] = [ rect.topLeft, rect.topRight, rect.bottomLeft, rect.bottomRight ] return points.map { (p) in transform(p.toGLKVector().to3(z: 0)).to2().toPoint().to(type: R.PointType.self) } }
GLKMAtrix4.swift
のこれで (edited)