Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Opengl 中制作了一个流动的水,现在希望它以瀑布的形式转换。对于水,我使用正弦波,对于瀑布,我想将那些水平正弦波转换为垂直正弦波。我尝试交换 x 和 y 的位置,但没有显示任何内容。
for(y=50;y<=-30;y+=inc)
上面的条件永远不会成立(如果inc大于零),所以你什么也看不到。
您应该检查 range 和inc,它可能应该如下所示:
for(y=-30;y<=50;y+=inc)