   long neck lookat simulation in game
  hi there :    animal like rooster has longer neck than human (ostrichs' is even longer), to simulate how these animals looking at somewhere in game the first thing came into my mind is to use IK.in Welman's thesis he introduced two methodes : CCD (Cyclic-Coordinate Descent) and Jacobian Transpose. Both methods are good to drive linked bones (arm for example) to touch somewhere in space, and even if the target position is not reachable (beyond arm's range), the methods will still try hard to reach out the arm to touch that target.    to simulate rooster looking at somehere in space, what we need is a direction, rooster looks in that direction is just OK, we dont need it to reach out her head to try hard to touch anything. based on this consideration i wrote the following code (its like CCD but target position is ignored) :  angle = angle_between_head_orientation_and_target_direction();  if (angle < 0.1 degree)return;    for (int i = 0; i < 100; ++i)  {const vec3 euler_rot = head.rotation_to_lookat_target();head.rot = euler_rot;head.clamp_to_limits();// neck consists of three bones, head is linked to the final neck boneneck1.rot = 0.1 * head.rot;neck2.rot = 0.2 * head.rot;neck3.rot = 0.3 * head.rot;neck1.clamp_to_limits();neck2.clamp_to_limits();neck3.clamp_to_limits();update_hierarchy();euler_rot = head.rotation_to_lookat_target();head.rot = euler_rot;head.clmap_to_limits();angle = angle_between_head_orientation_and_target_direction();if (angle < 0.1 degree)   break;  }anyway the code does not produce corret result -- its unstable, the neck is shaking while i draging around the lookat target, and even worse suddenly the neck becomes totally a mess after a while i dragging;could you please share your thoughts, big thanks.   
  the original CCD method introduced by Wang&Chen on IEEE as far as i remember included orientation in both actual and destination vector(as transofrmation matrix containing 3 ortonormal vectors of destination world axes). jacobian pseudo-inverse methods also can work upon orientation (the jacobian has 6 rows that way). i can't give you apropriate links becouse i'm in work right now, but you could try googling, and if i don't forget i' ll reply from home. if you are willing to try developing your own algorithm i would suggest neural networks or fuzzy drivers ( ro both, google:ANFIS). i hope this will help.   ;  hi, thanks for your reply.CCD is fast and easier, i tried to use CCD to solve this kind of lookat (by checking only the angle between current orientation and target direction), but the result is sometimes the head still reach out and try hard to touch the lookat target, i.e. head and three neck bones are forming a line to 'lookat' the target. anyway, in case i was doing something wrong in the solving process, i'll check again my CCD code and read again that thesis.ok, let me start from 'ANFIS', cause it sounds interesting and basicly i dont have clue what people can do with it (AI stuff?).   