Spin box/camera around with velocity in SceneKit -


aspects of .allowcameracontrol perfect use. i'm rotating camera node (child of sphere) around cube. i'd have spinning gradually come halt (like allowscameracontrol).

can assist in direction of how stop spinning based on velocity of gesture? add friction camera?

i spent lot of time working on this, , it's tricky subject. best approach found to:

  1. save past 10 or drag events every frame
  2. on release, calculate velocity x , y axis based on these frames
  3. keep moving camera using these velocity values
  4. every frame, dampen velocity. looking @ spring equations make more realistic
  5. when velocity under small threshold, stop moving avoid endless drifting

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -