开发者

Create Vertical Sine wave

I am developing a game which uses sine wave. I made use of the horizontal sin wave with the following example http://www.roseindia.net/java/example/java/swing/create_sine_wave.开发者_如何学Pythonshtml

How do create a similar kind of wave vertically?


Where it says

g.drawLine(x1, y1, x2, y2);

swap the order of x and y values.


Try swapping the X and Y coordinates


You can easily swap the values of x and y. This will result in changing the graph coordinates hence if its horizontal before it'll become vertical and vice verse.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜