Home
Tips and Tricks
Gallery
Links
Downloads
About Me
Contact Me
Vacation time PDF Print
Written by Administrator   
Sunday, 05 October 2008 19:52

I got my year vacation now. I will be away from PC. Sorry if anyone dropped me an email and I didn't respond earlier. I will get to everyone of you when I get home.Thanks!

 

 
The simplest simplest simplest solution for Pole Vector PDF Print
Written by Marin Petrov   
Thursday, 18 September 2008 13:11
  1. global proc string mp_PoleVec()
  2. {
  3.   string $handle[] = `ls -sl`;
  4.   float $px = `getAttr ($handle[0] + ".poleVectorX")`;
  5.   float $py = `getAttr ($handle[0] + ".poleVectorY")`;
  6.   float $pz = `getAttr ($handle[0] + ".poleVectorZ")`;
  7.  
  8.   float $tx = `getAttr ($handle[0] + ".translateX")`;
  9.   float $ty = `getAttr ($handle[0] + ".translateY")`;
  10.   float $tz = `getAttr ($handle[0] + ".translateZ")`;
  11.  
  12.   string $loc = firstS(`spaceLocator`);
  13.   move -r -os $tx $ty $tz $loc;
  14.   move -r -os (10*$px) (10*$py) (10*$pz) $loc;
  15.  
  16.   select -r $loc;
  17.   select -add $handle;
  18.   poleVectorConstraint -weight 1;
  19.  
  20.   return $loc;
  21. }
  22.  
  23. mp_PoleVec;

What is so simple about it is that actually every ik Handle you create has the Pole Vector calculated at it's creation. That's why the joints stay in the same place when you create an ik Handle. And the Pole vector is simply the Pole Vector floats you read at the attribute editor of the handle. I don't know why so many people, me including don't know that. It is so obvious. Maybe that's why :) Ok - with that script just select the handle you want and run the mp_PoleVec procedure - it will automatically create a locator and constraint it to the ikHandle you selected. The good thing in this approach is that you can create a polevector fo N number of joints in the ik Solution! 

Note: The ikHandle must be parented to the world for the script to work. 

 

 
Animation timeline PDF Print
Written by Marin Petrov   
Friday, 29 August 2008 15:03

Clay from the Animation Podcast , started very handy timeline /spreadsheet/. Everyone is free to add more animations to it and maybe it will turn very valuable resource, as it already is:

You can view it here:

http://www.dipity.com/user/animationpodcast/timeline/personal

 
Finding the world space for a Pole Vector PDF Print
Written by Marin Petrov   
Friday, 15 August 2008 14:42

The problem:

If you have three joints, included in an Ik Solution of some type, and the plane the three points are making is NOT parellel with  one of the orthogonal projections of the  Cartesian space it will be difficult for you to find the proper placement of a Pole Vector , especially if /after adding it to the IK solution/ you don't want the joints to reorient themselves. 

I have seen several methods for this issue. The best solution I found /and used myself :) / is something I have seen Aaron Holly doing. I simply thought there is an easier solution for this problem. 

Me and a  friend and ex colleague of mine - Slavi Kaslev /great engineer btw :) !!! / have written some code that simply adds a locator in world space, that can be used for Pole Vector without reorienting the chain. Here is the solution, which I used for some time now with my autorigging tools I've wrote:

  1. global proc string mp_CScreatePoleLocator(string $jointA, string $jointB, string $jointC)
  2. {
  3.     vector $a = `xform -q -a -ws -t $jointA`;
  4.     vector $b = `xform -q -a -ws -t $jointB`;
  5.     vector $c = `xform -q -a -ws -t $jointC`;
  6.  
  7.     vector $ab = $b - $a;
  8.     vector $ac = $c - $a;
  9.  
  10.     vector $up = cross($ab, $ac);
  11.     vector $direction = cross($ac, $up);
  12.  
  13.     float $rot[] = vector2rot($direction, $up);
  14.  
  15.     string $locator = firstS(`spaceLocator`);
  16.     move -a -ws ($b.x) ($b.y) ($b.z);
  17.     rotate -a -ws ($rot[0]) ($rot[1]) ($rot[2]);
  18.  
  19.     // NOTE: Change here for locator offset
  20.     move -r -os 0 0 5;
  21.  
  22.     return $locator;
  23. }

 

 

firstS /on the 15th row/ is a proc that simply returns the first string.  

The idea behind this is to find a fourth point , which sits on tha plane of the three joints. That way, when you use that point for a Pole Vec - there are no offsets of the joints.

 Me and Dobri Georgiev made another solution for this :

  1. //the three points and their absolute coords
  2.  
  3.     vector $a = `xform -q -a -ws -t joint1`;
  4.     vector $b = `xform -q -a -ws -t joint2`;
  5.     vector $c = `xform -q -a -ws -t joint3`;
  6.  
  7. //the distance between the points as vectors
  8.  
  9.     vector $ab = unit($b - $a);
  10.     vector $bc = unit($b - $c);
  11.    
  12. //make the vectors start from the B point and offset them by 10 
  13.  
  14.     vector $f = $b + 10*$ab;
  15.     vector $g = $b + 10*$bc;
  16.  
  17. // find the center of the triangle made by the new vectors
  18.  
  19.     vector $center = ($f + $g + $b)/3;
  20.  
  21.  
  22.     string $locator = firstS(`spaceLocator`);
  23.     move -a -ws ($center.x) ($center.y) ($center.z);

This is a little different approach -  finding the three points in world space /like the first method/ and after that finding the distance between the points and storing them as vectors. Then making new vectors starting from the $b point but in the opposite direction of the first ones and shifting them by 10. Then finding the center of the triangle /the flipped one/ and adding a locator at the center. 

Cool Variant :) If you have another solutions for these I would like to hear them :) 

 

 

 

 
Michael Phelps PDF Print
Written by Administrator   
Friday, 15 August 2008 14:23

This is the guy that deserves the most attention at these Olympics!!!!

Simply incredible!  He is making a World Record from every start! He already won 6 gold medals!

It is simply a pleasure to watch him swim.  GO GO Michael!!!!!!

 
Bulgaria lost over USA PDF Print
Written by Marin Petrov   
Friday, 15 August 2008 14:18

Ahhhhh. Nothing more to say. I'm angry!!! Not because we lost /1:3 games/ , but because there are some things happening with our team which nobody knows why. Our captain - Plamen Konstantinov still doesn't play. They are making some blood tests and who knows why. If he manages to come for some of the next matches, the team won't be the same as it used to be. I can't believe they are stopping him play at the Olympics as I`m sure it's some intrigues and not a doping issue as they are saying in the medias. 

 

 

 
Bulgaria - second volleyball win! PDF Print
Written by Marin Petrov   
Tuesday, 12 August 2008 22:05

Bulgaria just won over Japan on their second volleyball match in the preliminary groups!

Before that we won the match with China, now we will be playing with Italy, which will be a little more hard I think :) These two matches we were playing without our captain - Konstantinov. Nobody knows why he's not playing, the medias just said that he will be playing in the next matches though! I hope so!

 
More Articles...
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>

Page 10 of 25

View Marin Petrov's profile on LinkedIn