reset password
Author Message
cthanh
Posts: 56
Posted 23:29 May 10, 2015 |

I was trying to figure out how to do the animate portion of the homework.

Are we suppose to emulate the keyboard input to get the proper animation or do we need to reupdate all the different variables of the robot arm in an order such as:

int animate = 0;

- if(animate == 1) increase arm angle until degrees<90; animate =2;

-else if(animate == 2) increase z position until 1.0; animate =3;

-else if(animate ==3)  open claw;

myIdle function is registered to update the image after the values have been altered

Any suggestions to guide me in the right direction?

 

Thanks!

lbriggs
Posts: 57
Posted 23:47 May 10, 2015 |
Remember the tweening lab. We had arrays with points that were "waypoints". And remember we should always update positions in the idle method. So in your idle method you should loop through your array of waypoints and "tween" between them. Hope that helps you on the track. Start with an array of just two values (let's say the x and z coordinate of the base. And just tween between them when idling and animation key was pressed. Once you can do that, expand the array to do something more fancy.
Last edited by lbriggs at 23:47 May 10, 2015.