Guest User

Untitled

a guest
Jan 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. let imagePlane = SCNPlane(width: self.sceneView.bounds.width/6000, height: self.sceneView.bounds.height/6000)
  2. imagePlane.firstMaterial?.diffuse.contents = self.image//<-- UIImage here
  3. imagePlane.firstMaterial?.lightingModel = .constant
  4. self.planeNode = SCNNode(geometry: imagePlane)
  5.  
  6. let xAngle = SCNMatrix4MakeRotation(Float(self.rotX), 1, 0, 0);
  7. let yAngle = SCNMatrix4MakeRotation(Float(self.rotY), 0, 1, 0);
  8. let zAngle = SCNMatrix4MakeRotation(Float(self.rotZ), 0, 0, 1);
  9. let rotationMatrix = SCNMatrix4Mult(SCNMatrix4Mult(xAngle, yAngle), zAngle);
  10. self.planeNode.pivot = SCNMatrix4Mult(rotationMatrix, self.planeNode.transform);
Add Comment
Please, Sign In to add comment