Monday, December 13, 2010

Incrementing (Adding) values over time

One of the challenges that I faced with developing a vehicle rig in Softimage ICE was how to add an acceleration variable and continuously translate my vehicle forward.  So if I started with a value of 0, and then continuously add 1 to that each frame, I would get values of 0, 1, 2, 3.  If I then changed the "acceleration" to 0, I would get 3, 3, 3, 3.  Changing Acceleration to -1 would generate 2, 1, 0

We start by initializing our custom attribute in the presim stack:

Now that our custom attribute is defined, we can go about modifying it over time.  To do this, we get the value of our custom attribute, add the amount we want to change it (each frame), and then set the custom attribute with the new amount:

3 comments:

  1. Super, but where would you apply this to the Car or the wheels ? I assume the car.

    ReplyDelete
  2. My car rig compound is pretty basic; The wheels follow the car null, as opposed to the car null following the wheels.

    So, I have a null that rotates and translates forward along the rotation. The amount of movement forward needs to increment over time (By setting acceleration to 0, you don't want the vehicle to return to the origin, you want it to stay in place).

    My tires are 'parented' to the car null via "Multiply Vector by Matrix". I'm planning on doing a blog entry on this ICE node; it's essential for working with ICE Kinematics!

    I think I used the acceleration to control the rotation amount of the tires.

    ReplyDelete
  3. Hi David I'd wanted to ask, if you wanted to collaborate ICE Blogs ? I'm currently running a ICE blog,posting problems as I work on new project or just practices.

    ReplyDelete