How to draw vertical sinewave in Opengl

658 Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

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)