title: Backspin effect in pool game with SceneKit
body: <p>I would like to create a realistic pool game and to implement at least some basic ball effects. I started from scratch with SceneKit and at this point I'm just studying the proper technology to go with it.SceneKit would be the ideal.
  I managed to achieve an acceptable ball effect for sidespin and some sort of forward spin. The one I'm struggle with is backspin. I'm playing around with the position parameter of applyForce method, but it seems that alone will not give me the result I'm looking for. Either I'm missing something (I've got limited knowledge of physics) or SceneKit's physics simulation is just not enough for what I want. Basically I have a sphere of 1.5 radius and I went from -1.5 to 1.5 on Y component for the position vector and the result is either the white ball or the ball I'm hitting jumps when collision occurs.</p>
  
  <p>The first screenshot shows the moment of impact whilst the latter shows after the collision and how it jumps.</p>
  
  <p><a href="https://i.stack.imgur.com/PtF8K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PtF8K.png" alt="Moment of impact"></a></p>
  
  <p><a href="https://i.stack.imgur.com/NaVLN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NaVLN.png" alt="After impact (ball jumps)"></a></p>
  
  <p>The two spheres are configured like this</p>
  
  <pre><code>    let sphereGeometry = SCNSphere(radius: 1.5)
      sphere1 = SCNNode(geometry: sphereGeometry)
      sphere1.position = SCNVector3(x: -15, y: 0, z: 0)
      sphere2 = SCNNode(geometry: sphereGeometry)
      sphere2.position = SCNVector3(x: 15, y: 0, z: 0)    
  </code></pre>
  
  <p>And the code that gives me that effect is the following:</p>
  
  <pre><code>sphere1.physicsBody?.applyForce(SCNVector3Make(350, 0, 0), atPosition:SCNVector3Make(1.5, -0.25, 0), impulse: true)
  </code></pre>
  
  <p>What I'm trying to do in that code is to hit the ball roughly a bit below the center. How I got to -0.25 was to get an angle of 10 degrees and calculate its sin function. Then I multiplied it by sphere radius so I can get a point that lies right on the sphere's surface.</p>