Noob question

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/05/2005 at 12:44, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   9.1 
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;   XPRESSO  ;

---------
Hello,
I'm just starting to try and learn coffee and would like to start out by making some simple functions. First I would like to make a coffee expression where I could have one bone aim at another bone. (pretty simple)
 
I could use some tips/advice as to  where to start and how to go about getting that done. If there any examples around that would help too.
 
Thanks Dave

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/05/2005 at 20:00, xxxxxxxx wrote:

Oh and I would also like the bone to scale to the target bone so that you get a muscle type of bone. An aim at with scale if you get what I mean.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 23/05/2005 at 20:43, xxxxxxxx wrote:

Ok I have used the code from the target node that comes with C4D to work on this problem. It does all the aim at stuff already. I have added a var to get the distance between the target bone and the object bone. Now I'm stuck on how to adjust the object bones length to the distance var I have added.
How do I go about setting the bones length to the var (dist) I have?
Here is the code with my line added in:
main()
{
 var mobj = Muscle->GetMg();
 var tobj = Target->GetMg();
 
 var p1 = mobj->GetV0();
 var p2 = tobj->GetV0();
 var dist = p2 - p1; //gets distance from p1 to p2
 
 var m = new(Matrix);
 m->SetV0(p1);
 m->SetV3(vnorm(p2 - p1));
 m->SetV2(vnorm(vcross(p2-p1, vector(0,1,0))));
 m->SetV1(vnorm(vcross(p2-p1, vector(0,0,1))));
  
 Rotation=m->GetHPB();
 var orot=mobj->GetHPB();
 Rotation.z=orot.z;
 
}

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 01/06/2005 at 12:17, xxxxxxxx wrote:

If you drag the Length field of a bone and drop it in the C.O.F.F.E.E. editor window, you'll see that it writes "#BONEOBJECT_LENGTH". This means that you can set the length with

    
    
    op#BONEOBJECT_LENGTH = dist;

where 'op' is the bone object.