c++openglanimationwaterfallsine-wave

How to draw vertical sinewave in Opengl


I have made a flowing water in Opengl and now wants it to convert in the form of waterfall. For water i used sine wave and for waterfall i want to convert those horizontal sine waves into vertical sine waves. i have tried swapping positions of x and y but nothing got displayed.


Solution

  • for(y=50;y<=-30;y+=inc)

    The condition above is never true (if inc is greater than zero), so you do not see anything.

    You should check the range and inc, probably it should look like this:

    for(y=-30;y<=50;y+=inc)