Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let imagePlane = SCNPlane(width: self.sceneView.bounds.width/6000, height: self.sceneView.bounds.height/6000)
- imagePlane.firstMaterial?.diffuse.contents = self.image//<-- UIImage here
- imagePlane.firstMaterial?.lightingModel = .constant
- self.planeNode = SCNNode(geometry: imagePlane)
- let xAngle = SCNMatrix4MakeRotation(Float(self.rotX), 1, 0, 0);
- let yAngle = SCNMatrix4MakeRotation(Float(self.rotY), 0, 1, 0);
- let zAngle = SCNMatrix4MakeRotation(Float(self.rotZ), 0, 0, 1);
- let rotationMatrix = SCNMatrix4Mult(SCNMatrix4Mult(xAngle, yAngle), zAngle);
- self.planeNode.pivot = SCNMatrix4Mult(rotationMatrix, self.planeNode.transform);
Add Comment
Please, Sign In to add comment