max value for a chop

   Views 7676   Replies 6   Subscribers 1
User Avatar
Member
52 posts
Joined: April 2011
Offline
I am looking for a way to get the value for the maximum point on a chop. I am getting a good handle on what I am trying to do with this network, but I need it to return a certain range of values, specifically 0 to 1, though I can see using other ranges in other projects.

I have a function that I like how it works, but my high value shifts as I change the variables. I could spend another several hours working on the function to get it tweaked just right to not let it move, but I found a way to avoid that if I can just get it working.
How I am doing it right now is by having my channel be passed into a vopchop where I pass it through a fit range node. This actually works very well, but with the variable nature of the input range maximum, I am needing either an expression or another way to derive the maximum value of the input channel. How I did it before was to use Wolfram Alpha to calculate a linear function for the shifting values, which worked quite well. The only problem is that when I changed my scene around (switched from my basic path to a more complex one) the function no longer worked for calculating it. Nearest I can tell, it is still a linear function and I could do the same process again, I just would like a way have it get the max value for the channel so it can work automatically.
User Avatar
Member
9126 posts
Joined: July 2007
Offline
you can use either
Limit CHOP to normalize channels to -1,1 then Math CHOP to fit -1,1 to 0,1

or

use icmin() and icmax() directly in Math CHOP to fit min, max range to 0,1

here is the example

Attachments:
fit_channels_to_01_range.hip (20.8 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
52 posts
Joined: April 2011
Offline
Thanks, that trick worked like a charm. I am getting some weird behavior out of the chop though. I am modifying the movement of an object along a path based on another object moving along the same path (trying not to give too much away before I write the tutorial) and a multiplier. I have it modifying right, but it seems to be arguing with me on its null point. I have my network setup so that the output for object 2 is exactly the same as object 1, but when I playback the animation, the two objects are not coincidental as they should be. I have gone through the network a few times and worked it all out just in case the motion panel is lying to me, which it shouldn't be.

The motion of object 1 is $FF/$FEND on the position attribute, which gives me a linear 0-1 on that. Then with the multiplier set to 0, the value of the modification from object 1 is 0 and the change to the channel is nullified, leaving me with only the channel from object 1.

I am really lost as to why my two objects are not coincidental.
User Avatar
Member
9126 posts
Joined: July 2007
Offline
I am sorry, it's hard for me to imagine what you are trying to do and what may be wrong with that
Simple scene showing your problem will help
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
52 posts
Joined: April 2011
Offline
I guess I don't have to be too secretive. What I am trying to do is make a parametric camera that will work to reduce, remove or increase the apparent speed change caused by the parallax effect while the camera is moving through a scene. Right now I only have it “working” for the vertical height though. The concept is that the closer you get to the ground plane (y=0) the slower the camera goes, and visa versa. I have the math basically right. I need to tweak the envelopes (I think the term is applicable here) a bit, but other than that I feel it is just about right.

The problem is that two things that are supposed to have identical channels for their pos channel, don't.

Attachments:
DramaticCamera1.hipnc (88.0 KB)

User Avatar
Member
9126 posts
Joined: July 2007
Offline
actually, you are not using exactly the same input value for your camera pos

the value went through normalization so it is expected that it may be different
I know, you are expecting that if input channel is in range 0-1 then normalization will not change it and you are right
But your input value is not 0-1 because it is animated by expression which will give you 0-1 on range 1-250
however, you are reading range 0-$FEND/24.0144 in seconds
I suppose 24.0144 should be 24 but even then you have sample rate to 60 so your channels may not end precisely on integer frame (because fps is 24)
(your second channel has rate just 24 so I don't know what you are gaining from this having 60)
you better use frames for the range and make it $FSTART to $FEND
and make your sample rate multiple of your fps e.g 72 (3*24) so it will precisely start and end on range frames and will have 0-1 value range in that time range
now it can go through 01 normalization with no harm, but be careful in future that your source pos should be 0-1 range to avoid problems which is not very secure in my opinion

and don't forget when integrating velocity you may not get initial trajectory because you'll loose initial position, but for the case when it is starting from 0 it is correct

Attachments:
dramaticcamera1_fix.hipnc (93.8 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
52 posts
Joined: April 2011
Offline
Thanks for helping out. The sample rate thing was an artifact of a very late night last night working on this, and the $FSTART to $FEND i just didn't think of while I was working (probably another late night thing). What would your choice be for “security” on this? I am just kinda starting out with Houdini and I am trying to get in there with the math I have been learning in school.

I actually picked the path follow because it generally goes from 0 to 1. Most people that I know rarely start their animations in the middle of their path. Also, as I said, this is more of a project to see how it would be done and to serve as a tutorial when I get it all how I want it, so I am not 100% concerned about most outside ramifications of special circumstances. I am hoping that it can serve as a launching pad for new ideas.
  • Quick Links