Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

INVERSE KINEMATICS: DRAGGING AND REACHING > Reaching with multiple segments

Reaching with multiple segments

To start with inverse kinematics reaching, you'll take this chapter's initial example, OneSegment.as, and add to that. That file simply had the segment rotating to a target, which was the mouse position.

Reaching for the mouse

First, you need to determine where the segment should be to exactly touch that target. This is the same calculation you use to position the segment when you're dragging. However, in this case, you don't actually move the segment. You just find that position. So, what do you do with that position? You use that as the target of the next segment up the line, and have that segment rotate to that position. When you reach the base of the system, you then work back down, positioning each piece on the end of its parent. Figure 14-4 illustrates how this works.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint