Jump to content

animating leg movement


Recommended Posts

I'm drawing a bicycle and would like to draw/animate the movement of the legs. How can it be done?

I tried to use the parameetric constraints, without success. Can it be done with these constraints?

I had a look at the "cam.sta" file and looks interesting. Can an animation like this be modified to suit my "leg movements" needs?

Link to comment

quote:

Originally posted by Kaare Baekgaard:

'Can an animation like this be modified to suit my "leg movements" needs?'

If you are a programming wiz - then maybe. If not, there is a score of programs out there, that can do it easily. I use an ancient version af Stratas Studiopro, when the need arises.

Strata as far as I know is a rendering/animation package. It's not what I'm looking for.

What I need right now is a 2d CAD animation, like the one seen in the "cam.sta" file supplied with the VW package.

Link to comment

'AnimationWorks from OzCAD should be able to achieve what you want'

Nope... You can rotate stuff in animationworks, but to my knowledge you can't ensure that the joints stay together. Chances are, that the elements will get out of sync.

If yoy need to do it in 2D, there must be some flash animation applications out there, that does the trick. It might actually be faster to do the whole thing in stop-motion manually, though.

Link to comment

Maybe I posed the problem in the wrong way. I didn't make myself clear, sorry for that.

I'm not looking for animations in 3d. I would like to do something in 2d, obtaining a result like the "cam.sta" drawing supplied with VW, and would like to make it within VW. As I understand the "cam.sta" file isn't easily customizable.

Another way to achieve my goal would be to draw in 2d using parametric constraints to lock into position the knee joint for example and let the orther parts of the leg move. Is this kind of "constraints locked" movement possible?

I'm quite new at VW so don't know in deep the power of 2d constraints.

Link to comment

Looking at the samples given. They are freely editable vectorscripts:

__________________________________

Procedure Crank;

{*******************************************************}

{* *}

{* ?2001, Nemetschek N.A., All Rights Reserved *}

{* Developed by Tom Urie *}

{* *}

{*******************************************************}

CONST

kXCrank = -3.000;

kYCrank = 0.000;

kXArm = 3.125;

kLCrank = 1.500";

kLArm = 4.625;

kMaxDTheta = 20;

kMaxSpeed = 120;

VAR

a, b, c : REAL;

angleB : REAL;

angleC : REAL;

dTheta : REAL;

oldAngleB : REAL;

oldC : REAL;

theta : REAL;

xArm : REAL;

xM, yM : REAL;

cCode : INTEGER;

dialogID : INTEGER;

exitState : INTEGER;

armH : HANDLE;

crankH : HANDLE;

pistonH : HANDLE;

recordH : HANDLE;

dialogOK : BOOLEAN;

{======================================================================}

FUNCTION defineDialog : INTEGER;

VAR

dialogID : INTEGER;

BEGIN

dialogID := CreateLayout ( 'Crank', False, ' Start ', 'Quit' );

{* Create the control items *}

CreateGroupBox( dialogID, 3, 'Speed', True );

CreateStaticText( dialogID, 4, 'Slow', -1 );

CreateControl( dialogID, 5, 3, '', kMaxSpeed );

CreateStaticText( dialogID, 6, 'Fast', -1 );

{* Position the control items *}

SetFirstLayoutItem( dialogID, 3 );

SetFirstGroupItem( dialogID, 3, 4 );

SetRightItem( dialogID, 4, 5, 0, 0 );

SetRightItem( dialogID, 5, 6, 0, 0 );

{SetBelowItem( dialogID, 3, 7, 0, 1 );}

{* Align the button and the group box to the right side *}

AlignItemEdge( dialogID, 3, 1, 100, 0 );

AlignItemEdge( dialogID, 7, 1, 100, 0 );

defineDialog := dialogID;

END; { of defineDialog }

{======================================================================}

PROCEDURE displayDialog( VAR item : LONGINT; data : LONGINT );

VAR

speed : INTEGER;

BEGIN

CASE item OF

SetUpDialogC: BEGIN

speed := (dTheta - 1) * kMaxSpeed / (kMaxDTheta - 1);

SetControlData (dialogID, 5, speed);

END;

1: BEGIN

END;

5: BEGIN

GetControlData( dialogID, 5, speed );

dTheta := ((kMaxDTheta - 1) * speed / kMaxSpeed) + 1;

END;

END; { of CASE item }

END; { of displayDialog }

{======================================================================}

BEGIN {Main}

DselectAll;

UnDoOff;

crankH := GetObject ('Crank');

armH := GetObject ('Arm');

pistonH := GetObject ('Piston');

a := kLArm;

b := kLCrank;

{numIterations := 360 / kDTheta;}

recordH := GetObject( 'Crank Record' );

dTheta := Str2Num (GetRField( recordH, 'Crank Record', 'dTheta'));

theta := Str2Num (GetRField( recordH, 'Crank Record', 'theta'));

oldAngleB := Str2Num (GetRField( recordH, 'Crank Record', 'oldAngleB'));

oldC := Str2Num (GetRField( recordH, 'Crank Record', 'oldC'));

dialogID := defineDialog;

dialogOK := VerifyLayout (dialogID);

exitState := RunLayoutDialog (dialogID, displayDialog);

IF exitState = 1 THEN

BEGIN

REPEAT

theta := theta + dTheta;

angleB := ArcSin (b * Sin (Deg2Rad (theta)) / a);

angleC := Pi - Deg2Rad (theta) - angleB;

c := Sqrt (a^2 + b^2 - 2 * a * b * Cos (angleC));

IF angleC > Pi THEN c := -c;

xArm := kXCrank + c;

HRotate (crankH, kXCrank, kYCrank, dTheta);

HMove (pistonH, c - oldC, 0);

HMove (armH, c - oldC, 0);

HRotate (armH, xArm, 0, Rad2Deg (oldAngleb - angleB));

oldC := c;

oldAngleB := angleB;

RedrawAll;

UNTIL KeyDown( cCode ) | MouseDown( xM, yM );

SetRField (recordH, 'Crank Record', 'dTheta', Num2Str (4, dTheta));

SetRField (recordH, 'Crank Record', 'theta', Num2Str (4, theta));

SetRField (recordH, 'Crank Record', 'oldAngleB', Num2Str (4, oldAngleB));

SetRField (recordH, 'Crank Record', 'oldC', Num2Str (4, oldC));

END; {of exitState = 1}

END; {of Main}

RUN (Crank);

Link to comment

EJ Armstrong, thanks a lot... but how does it work??

I'm not pratical with VectorScript, but I tried my best to understand how to use and customize the "cranck" script that I renamed "cranck.vss" and tried to run it into VW, apparently without success.

I must admit I know almost nothing about Vectorscript, and will try to learn it.

Thanks anyway EJ, just shed some light on the matter...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...