Hello, Matthias.
Thanks for your reply and attached file.
I cannot reproduce the sample yet. I put a movie file of my operation on the following links. Best regards,
K-UDA

http://www2s.biglobe.ne.jp/~k-uda/CONSTRAINT_CENTER_001.htm
or
http://www2s.biglobe.ne.jp/~k-uda/CONSTRAINT_CENTER_001.swf (about 1.5MB)


----- Original Message ----- From: "Matthias Kappenberg" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, November 23, 2006 2:04 AM
Subject: Re: About constraint tool


Hi KUDA,

here's what I did:

Create a sphere
Do: Make Choreographable
In ChoregraphyWindow check "Animated" for "Translate"
Select the sphere
Create Constraint
(Now a sphere and a constraint should be in your select window)

Open the constraints properties and go to "Spec" tab
Put in this script:
// Script Begin
cog  = new r3Vect(0, 0, 0);
var i = 0;
for(i = 0; i < 3; i++) {
   child = Self.GETSUBBYORDNUM(i);
   if(!child)
       break;
   p = child.GetCenter();
   cog.fadd(p);
}
if(i > 0) {
   cog.fdiv(2);
}
Target.SetCenter(cog);
// Script end

Set command Language to JavaScript.

Create two new spheres and drop them in the constraint.

Move one or both of them, the "constrainted" sphere should move, too.

Modify the script to your needs in lines:
-->for(i = 0; i < (your max count spheres); i++) {
-->    cog.fdiv(your max count spheres);


Hope it's working,
Matthias


----- Original Message ----- From: "K-UDA" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, November 22, 2006 3:24 PM
Subject: Re: About constraint tool


Hello, Matthias.
Thanks for your reply and advice.
The explanation of the operation is not described in the manual. I made to active the animated property.
However, the target object did not move.
Are you able to move the target object?
Best regards,
K-UDA

----- Original Message ----- From: "Matthias Kappenberg" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, November 22, 2006 3:37 AM
Subject: Re: About constraint tool


> The "original" constraint to center script is written for 2 spheres:
> // Script begin
> cog  = new r3Vect(0, 0, 0);
> var i = 0;
> > for(i = 0; i < 3; i++) {
>    child = Self.GETSUBBYORDNUM(i);
>    if(!child)
>        break;
>    p = child.GetCenter();
>    cog.fadd(p);
> }
> > if(i > 0) {
>    cog.fdiv(2);                                      // 2 Spheres
> }
> > Target.SetCenter(cog);
> // Script end
> > use this for 3 spheres:
> // Script begin
> cog  = new r3Vect(0, 0, 0);
> var i = 0;
> > for(i = 0; i < 3; i++) {
>    child = Self.GETSUBBYORDNUM(i);
>    if(!child)
>        break;
>    p = child.GetCenter();
>    cog.fadd(p);
> }
> > if(i > 0) {
>    cog.fdiv(3);                                    // 3 Spheres
> }
> > Target.SetCenter(cog);
> // Script end
> > Have a look at the attached picture, too.
> Hope this is helpy,
> Matthias
> > > ----- Original Message ----- > From: "K-UDA" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Tuesday, November 21, 2006 6:37 AM
> Subject: About constraint tool
> > >> Hello List.
>> I tried the constraint center.r3d.
>> However, it did not work well.
>> I selected three input sphere objects and moved them.
>> The target object was not constrained to center.
>> It worked well when I selected only one input sphere object. >> Is it a bug? >> >> A bug of manual
>> The explanation of recursive option is different from the actual one.
>> >> I created four analytic spheres newly.
>> I did the same operation as the description of the manual.
>> Then I moved one object in the constraint object.
>> However, the target object did not move.
>> Did I make a mistake?
>> >> Best regards,
>> K-UDA
>>

Reply via email to