简体   繁体   English

自定义 WP7 Silverlight 控件与动态 3D 内容

[英]Custom WP7 Silverlight control with dynamic 3D content

Ideally I need to implement a WP7 control that can be added to any XAML and which displays a dynamic, interactive 3D scene.理想情况下,我需要实现一个 WP7 控件,该控件可以添加到任何 XAML 并显示动态的交互式 3D 场景。

Currently I have this implemented via XNA in shared mode, and the UI is rendered on top of the scene using UIElementRenderer .目前我在共享模式下通过 XNA 实现了这个,并且 UI 使用UIElementRenderer在场景顶部呈现。 However this solution is sub-optimal because然而,这个解决方案是次优的,因为

  1. The application must render the whole screen because in shared mode, Silverlight does not draw anything by itself.应用程序必须渲染整个屏幕,因为在共享模式下,Silverlight 不会自己绘制任何内容。

  2. I couldn't find any way of detecting that a Silverlight control needs to change its presentation, be it due to user interaction or animation.我找不到任何方法来检测 Silverlight 控件需要更改其表示,无论是由于用户交互还是 animation。 Controls are rendered only when the 3D scene changes because of this, and so they lack the slick look and feel of the native WP7 applications.只有当 3D 场景因此发生变化时才会呈现控件,因此它们缺乏原生 WP7 应用程序的流畅外观。

So, is there a way of rendering a 3D scene inside one control, and letting Silverlight manage the rest of the UI?那么,有没有办法在一个控件内渲染 3D 场景,并让 Silverlight 管理 UI 的 rest?

I couldn't find any way of detecting that a Silverlight control needs to change its presentation, be it due to user interaction or animation.我找不到任何方法来检测 Silverlight 控件需要更改其表示,无论是由于用户交互还是 animation。 Controls are rendered only when the 3D scene changes because of this, and so they lack the slick look and feel of the native WP7 applications.只有当 3D 场景因此发生变化时才会呈现控件,因此它们缺乏原生 WP7 应用程序的流畅外观。

Make something that always changes in the scene, not necessarily something visible or noticeable, this way you keep rendering the scene all the time without problems.制作场景中总是变化的东西,不一定是可见或引人注目的东西,这样你就可以一直渲染场景而不会出现问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM