Sign in to follow this  

step functions! What are they?

This topic is 2663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I've been tinkering around with animations and stuff just generally learning how to program. I've got a while to wait before I can buy Frank Luna's book so I thought I'd get some work in early and teach myself a bit more about code and animation.

I hear alot about a step function. What exactly is this and what's it for? How does it relate to framereates and the like? Thanks ;o)

Share this post


Link to post
Share on other sites
Easy: output is 0.0 (or some other value) below a certain input value, and 1.0 (or some other value) for all input values above a certain threshold. That's it.

In code:
float step(float input) { return (input < 0.5f) ? 0.0f : 1.0f; }

(Of course you can in principle do a step function with integers too, all that matters is that it's one value below and another value above some threshold.)

I'm not sure what step functions are good for in animations, since actually you want animations to be as smooth as possible, which is the opposite of "step".

Share this post


Link to post
Share on other sites

This topic is 2663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this