silverlight 中的等距透视
如何在 Silverlight 中获得完美的等距透视?
我想在 Silverlight 中创建一个 3D 环境,它必须是等距视角。 如果我使用平面投影,我可以使网格类似于等距透视,但它不是完美的等距透视,因为网格单元不相等。
http://uwconcept.be/projects/uwconceptcity/grid_base_1.jpg
人们将会有能够沿着网格“滚动”;即在其上向前、向后、向左、向右移动。您可以将其视为飞越网格,但始终保持正确的等距视角。不会实现轮换(在第一个版本中)。即使实现了,旋转也将恰好是 90 度,以保持等轴测视角。
编辑:我还注意到,当我尝试在 Silverlight 中重现透视时,“正常”等距 x、y、z 坐标不适用。以下维基百科文章显示了“正常”转换: http://en.wikipedia .org/wiki/文件:Wikipedia_isometric_cube_3.jpg
How can I get a perfect isometric perspective in Silverlight ?
I want to create a 3D environment in Silverlight, which has to be in Isometric perspective.
If I use the planeprojection, I can make a grid resemble the Isometric perspective, but it is not a perfect Isometric perspective, as the gridcells are not equal.
http://uwconcept.be/projects/uwconceptcity/grid_base_1.jpg
People will have to be able to "scroll" along the grid; i.e. move forward, backward, left and right on it. You can see it as flying over the grid, but keeping the correct Isometric perspective at all times. Rotating will not be implemented ( in a first version ). And even if it would be implemented, the rotating would be exactly 90 degrees, as to keep the Isometric perspective.
Edit: I also noticed that the "normal" isometric x,y,z Coordinates do not apply when i tried to reproduce the perspective in Silverlight. The "normal" transformations are shown in the following Wikipedia article: http://en.wikipedia.org/wiki/File:Wikipedia_isometric_cube_3.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你可以等待SL5发布,它应该有3D API。 Silverlight 5 beta 宣布将于 2011 年上半年发布(现在应该是任何一天)。最终版本计划于 2011 年底发布。
我认为 SL API 应该类似于 WPF 的 3D API。根据我的随意理解,您可以使用正交相机(包含在 WPF 中)的正确角度来创建等角投影。
If you can wait for SL5 to be released, it is supposed to have a 3D API. Silverlight 5 beta was announced for release in the 1st half of 2011 (should be any day now). The final release is planned for the end of 2011.
I assume the SL API should be similar to WPF's 3D API. From my casual understanding, you can create an isometric projection with the correct angling of an OrthographicCamera (which is included in WPF).
SL4 中内置的 3D 投影支持可能不足以满足您的需求。它非常有限,通常仅适用于旋转简单的物体。
但您还有其他两个选择:
我自己曾经尝试过这样做,只是为了好玩。画平坦的风景很容易,但一旦你想支撑斜坡就变得困难了。
如果您最终这样做了,那么我希望您开源该项目,因为等距 3d 可以带来很多乐趣:-)
The built in 3d projection support in SL4 is probably not adequate for you needs. It is very limited and is generally only useful for rotating simple objects.
But you have two other options:
I tried to do that latter myself once, just for fun. It was quite easy to draw a flat landscape, but it gets tougher once you want to support slopes.
If you end up doing this, then I hope you open source the project, for there is so much fun you can do with isometric 3d :-)