Telescopic Movement Using Expressions


#1

So I’ve been using some basic expressions in LW to tie together various movements. I’ve been working on a deicing boom (basically, a big crane arm looking thing). The movements it is capable of includes rotating around it’s main support column, rotating the entire length of the arm up and down, rotating the driver’s cab around the point where it’s connected to the arm, and finally, telescopic movement of the entire length of the arm.

 If you're having trouble visualizing this, here's more:
 [http://www.google.com/patents?id=4jsNAAAAEBAJ&dq=6616102](http://www.google.com/patents?id=4jsNAAAAEBAJ&dq=6616102)
 
 So far, I've used some basic expressions to pull off just about everything I've needed to do. When you rotate the arm up, the B rotation data feeds the rotation of a hydraulic arm, and also makes the hydraulic rod scale x/y from the base. Here's one example:
  
  mapRange(crane:InnerBoom.rot(Time).b, -10, 35, .98, 1.2)
  
  this expression is added on the Modifier tab in the graph editor on the X/Y scaling of crane:Hydraulic Rod
  
  So that's fine and dandy... no problems there. That's the first time I've ever used an expression, just started researching this morning... so I was happy that it worked.
  
  HOWEVER, now I want to use another expression... and this time I want to use it for the telescopic movement of the arm. So... like a telescope, the arm is made up of pieces that are nested inside one another. What I want to do, is grab the last piece at the very end, and be able to move that in the X axis... and when it reaches a certain point, it's not only moving itself, but moving the next piece in, and then when those two pieces together reach a certain point, it moves the next piece... and so on and so forth. Basically, I just want to affect the X position of the final piece and by moving that retract the entire arm... and then again... pull on that final piece and as I move it forward in the X direction, it "opens" the arm back up. This is what I tried to do:
  
  mapRange(crane:Outer Boom(Time).x, 0, -2.94, 0, -1.04)
  
  The range of movement for the final piece (Outer Boom) is this:
  
  Fully extended, it's at position 0, fully retracted, it's at position -1.9.
  
  For the next piece in (called Intermediate#3), it's range is 0, and fully retracted it's -1.04
  
  So, the -2.94 is the result of the Outer Boom movement, plus the Intermediate#3 movement.
  
  So I guess in my head I was thinking that would work, but it doesn't. The Intermediate#3 piece starts moving as soon as you move the Outer Boom. So I thought maybe using "clamp" would fix it, but that doesn't work either. 
  
  So I'm thinking, that somehow... I need to delay the movement of Intermediate #3, so that it doesn't begin to move UNTIL Outer Boom hits it's fully retracted point (-1.9m). However, since I'm new to expressions I'm having a hard time figuring out how I would do this.
  
  Sorry this became such a long-winded post, but to summarize..
  
  I'm new to expressions, and I'm having trouble linking X position movements together for a nested telescopic motion. Any ideas or help, or even links to resources would all be greatly appreciated.

#2

Hmm…

For the telescope movement I would probably go for Cyclist instead of Expressions. Maybe your goal IS to solve the problem using expressions though, so maybe this isn’t helpful at all. :slight_smile:

http://www.newtek.com/lightwave/training.php?t=77002

Scroll down to Animation and take a look at the Cyclist video in order to get an idea of how it works!


#3

Thanks so much for your response. I tried Cyclist and WOW! How did I not know about this tool before! It worked perfectly. Guess I just thought expressions would be the best solution, but boy was I wrong!


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.