Sign in to follow this  

Wave that approaches triangle from sine?

This topic is 3574 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

I want to make a curve that approaches a triangle wave from a sinus wave. Does anybody know some fast / convenient way to calculate this? The curve should look like a sine wave raised to a number greater than 1 but with more “linear” transition from lowest to highest value. Like the sketch below but symmetric :) Thanks

Share this post


Link to post
Share on other sites
You can get something like that if you take an ordinary triangle wave and smooth it out using quadratic/cubic/quintic/whatever interpolation.

If you happen to own a copy of GPU Gems 3, there's ready made shader code with cubic interpolation in chapter 16. It uses x*x*(3.0 - 2.0*x) for that matter.

Share this post


Link to post
Share on other sites

This topic is 3574 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