A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
Range Mapper
Posted: 11 January 2019 01:39 AM   [ Ignore ]  
Avatar
Total Posts:  197
Joined  2017-02-07

I am trying to automate the movement of a gun barrel, as the Slide of the handgun moves back.

Basically when the “slide” moves back, I want the barrel to slightly move back in the Z and Y axis, and rotate slightly. I’ve almost got it, but at a certain point I want the barrel to stop rotating. I’m having a difficult time with the range mapper, and hoping it can be cleared up.

Thanks!
Matt

Profile
 
 
Posted: 11 January 2019 01:49 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Matt,

Thanks for the question. I believe this has baffled a few others before as well.

The critical answer will be, if Spline is active as adjustment, then it is assumed that the range of an incoming value will be in the variety of the given settings.
But things will turn out differently, from time to time.

Please have a look at the movie clip below. This clips will showcase the problem to have values below the Input-Lower.
Scene file, Screen Capture
https://www.amazon.com/clouddrive/share/qL5x9z2xjIoR2WGHTuuJEYAqQm8Ifl8v0XAHlnp7hcd
The clamp option for the lower Input should remedy the problem. However, often it would be nice to have something that moves smoother in the lower range.

In the second scene file, you will find the simplest way to fix it. This also points to a more sophisticated solution. To set up an ease-out spline curve for this area.  The main spline curve should have its lowest point in the lower left corner, with a direction that will agree with the ease out of the secondary Range Mapper.

I hope that makes sense.

The alternative would be, to set up the range with enough space, so the values have never to leave the spline defined area.

One more option: Set up a pre-calculating Range-Mapper. This range provides a linear spline for the targeted values and a toe and shoulder for the lower as well as the outer range. With this, the outgoing value is already tamed.

So, instead of going through your file, as we have done it before with similar problems, perhaps you try to apply the tips from above first. If that doesn’t work, I will have a look again into it. OK?

My best wishes

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 11 January 2019 06:29 AM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Matt, I went through your file. Disconnect the Z position output, as this is just a loop internally, as the Z-Pos is the same as the slider.
I would suggest that you set the lower input for all to -100 and the upper to zero. Then create a little math to get the numbers normalized to zero to 1, so you have an idea where you are in the Spline editor. Anything else is just not really professional, as it is guesswork.
Set first to rational, which should be x= 0.09 and y=zero, with x=1 and y=1 in the Spline field.
Then set the Z position, like the rotation.
All you need now is to set the Y positions, as those are based on the given forward (z) and rotation values.
Again, you need to know where you are in the Spline editor. With that, you always have the x value. Set a new dot on the Spline and give that x value the number that you have found in the Result node.
Since this is a move towards, move up, move along motion, five dots are needed on that curve. Done.
I hope that makes all sense. If you keep the values from 0 to -91 and have the range in the Spline editor all over the place, I really understand your frustration. But that is a DIY frustration, as any rig works as good as the blueprint of it allowed for it to do so.
ENJOY

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 11 January 2019 07:11 AM   [ Ignore ]   [ # 3 ]  
Avatar
Total Posts:  197
Joined  2017-02-07

Wow you really go above and beyond to help! I really can’t thank you enough. I’m going to play around with your file for a bit smile

Thanks again Dr. Sassi!

Profile
 
 
Posted: 11 January 2019 07:33 AM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Thank you very much, Matt, for your feedback.

The key idea is here to see the hierarchy and dependency of the values. Secondly to be able to place the points in the spline field with confidence.
Choose the range for the spline field wisely, as any adjustment later, will change anything that was done before.
Simplified: If the slider would go just from 0-1, you would always know where the point (x) has to be placed. The value of this slider can be then translated with an initial range mapper, to the values in need. Perhaps added to a fixed number, to gain the final value. The way I have seen it in set-ups in the majority of scene-files is to start with values that are needed, but they introduce a lot of complexity in the long run.

Yes, Ideally the spline field would have the lower/upper in and out put numbers…

Enjoy your weekend

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile