开发者

Converting equations of motion to pixels for display on Silverlight canvas

开发者 https://www.devze.com 2022-12-21 23:53 出处:网络
Can anyone point me in the direction of some information to understand this. I have a Canvas that displays an ellipse. I can move the ellipse around using the keyboard but I want to simulate a \"jump\

Can anyone point me in the direction of some information to understand this. I have a Canvas that displays an ellipse. I can move the ellipse around using the keyboard but I want to simulate a "jump", s开发者_如何学编程o I thought I'd use Newtons equations of motion to move the ellipse up and then down when the user presses the up arrow. All these equations are defined in metres where as the TranslateTransform on the UserControl is in pixels.

Can I get the resolution in SL to convert from metres to pixels?


Not really, no. Silverlight doesn't understand pixels.

There are 96 units in an inch (no matter the dpi of the display). That suggests there are 3779.5 silverlight units in a metre. I'd think about applying a ScaleTransform to any area you're displaying so you can give Silverlight metres and get the right visuals out if that matters to you.

0

精彩评论

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

关注公众号