开发者

Ripple Tank in VB2010 forms

开发者 https://www.devze.com 2023-02-04 22:10 出处:网络
I\'m attempting to make a ripple tank such as this in VB 2010. I\'m not trying to make it as complicated as that, at the moment I am making each wavefront from an e.graphics.DrawEllipse. The problem I

I'm attempting to make a ripple tank such as this in VB 2010. I'm not trying to make it as complicated as that, at the moment I am making each wavefront from an e.graphics.DrawEllipse. The problem I am having at the moment is making the e开发者_如何学Gollipse expand properly. I'm using a timer to add one the the ellipse's radius on every tick. Another problem following that is how to make it continuously fire wavefronts so that more than one is on the form at a time. Can anybody help? Thanks Nick


Just in case you're thinking of pushing pixels around, that's not going to work. You need to make a mathematical model of the wave propagation first. Ten-thousand feet view is a class Ripple that can model the propagation of a wave. Then a List(Of Ripple) that stores the state of the box. Every time the timer ticks, update the state of the ripples. And draw the image to go with that.

Key point is that the image gets recreated from scratch on each tick. One important reason why the web site's image is so small.

0

精彩评论

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

关注公众号