P Bartoli Posted January 26, 2006 Share Posted January 26, 2006 I'm currently drawing a bicycle in VW, and would like to "animate" the movement of legs and crank somehow like what's being done with the "cam.sta" file supplied with VW. I've never worked with Vectorscript, so I don't know how it works. Can Vectorscript be used to make some kind of controllable/customizable step-by-step 2d vector animation? BTW, I'm not looking for 3d animation, and I'd like to make it within VW... if possible! Thanks Quote Link to comment
MullinRJ Posted January 27, 2006 Share Posted January 27, 2006 Hi Paolo, Yes it can be done, but there is no easy 3D motion modeling platform in VW to work from. Depending on the level of accuracy you want to achieve will determine the amount of work you will need to do. It would be possible to describe the relation of thigh, knee, leg, ankle and foot to each other as a function of pedal rotation, but that would be the most difficult. If you go this route, the vector math in VS is up to the task. If you are not doing a physics demo, then I would consider having 3, 4 or 5 legs drawn in different positions and different classes and toggling the class visibility in sequence to simulate cyclic motion. I'm not sure what kind of rendering problems you may run into, but perhaps if you don't cast shadows it might work. Others will have to help you when you get that far. Have fun, Raymond Quote Link to comment
P Bartoli Posted January 27, 2006 Author Share Posted January 27, 2006 Thanks raymond, I'm NOT looking for a 3d animation, but basically the possibility to move "leg vector lines" in 2d. The parts of the leg should be joined as to have a "chain" movement Quote Link to comment
MullinRJ Posted January 27, 2006 Share Posted January 27, 2006 No 3D? Your job just got easier. What do you want to use to control the leg? Pedal position? It would be the easiest variable to base everything on. If knee and ankle are circles, then thigh, leg and foot can be polys (preferably all saved as symbols). Their positions and angles can be calculated to correspond to formulae based on pedal position. This is not too difficult, just tedious. Tom Urie's code for the Rotating Cam should provide a good example of what's needed. Find it in the VW application folder under "\Extras\Goodies\Rotating Cam.sta" Raymond Quote Link to comment
P Bartoli Posted January 30, 2006 Author Share Posted January 30, 2006 quote: Originally posted by MullinRJ: Tom Urie's code for the Rotating Cam should provide a good example of what's needed. Find it in the VW application folder under "\Extras\Goodies\Rotating Cam.sta" Raymond, I tried to open the "rotating cam.sta" file with a text editor. It comes with some garbage inside. Can I just modify the readable text and save it with a new name? Does it work or should I follow a different path? Quote Link to comment
MullinRJ Posted January 31, 2006 Share Posted January 31, 2006 Paolo, Open the file with VW. Option-Double-Click on the "Rotate" script and VW will open the script in the VS Script editor. Copy and Paste all of the text to a word processor of your choosing. Sorry if I'm cryptic, it's almost 5AM and I'm up past my bed time. G'Night HTH, Raymond Quote Link to comment
machwave Posted March 1, 2006 Share Posted March 1, 2006 The rotating cam example mentioned above is pretty intricate. I think I've extracted the core of the method in the procedure below. It puts a box on the display and spins it around an origin. Hope it helps someone get started. I spent a couple days trying to figure it out. **************************************** Procedure Rotate_a_box; VAR angle: REAL; { angle rotation per REPEAT cycle } recH: HANDLE; { rectangle handle } Xcenter,Ycenter : REAL; { rotation origin } xM,yM : REAL; {required for MouseDown function} cCode : INTEGER ; {required for keyDown function} BEGIN angle:=.2; { set rotation angle; size sets percieved speed of rotation } Xcenter := 0 ; {set an arbitrary rotation origin} Ycenter := 0 ; UnDoOff; { turn off UNDO, not sure why, maybe for faster operation? } Rect(0,0,.5,1); {draw an arbitrary size rectangle and get its handle} recH := LNewObj; DSelectAll; { Unselect the rectangle to remove the screen markers } REPEAT {rotate rectangle by 'angle' degrees until press key or mouse button} HRotate(recH , Xcenter , Ycenter , angle ); ReDraw; { refresh screen } UNTIL KeyDown( cCode ) | MouseDown(xM,yM); { check for key or mouse button } END; RUN(Rotate_a_Box); 1 Quote Link to comment
Recommended Posts
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.