请帮我翻译一下!!!

i_doit 2002-05-20 09:34:34
下面是Programing Windows Fifth Edition---Chapter 5 ---Drawing Filled Areas中的一段话,
我实在理解不了。请帮我翻译一下。

At first, the difference between alternate and winding modes seems rather simple. For alternate mode, you can imagine a line drawn from a point in an enclosed area to infinity. The enclosed area is filled only if that imaginary line crosses an odd number of boundary lines. This is why the points of the star are filled but the center is not.

The example of the five-pointed star makes winding mode seem simpler than it actually is. When you're drawing a single polygon, in most cases winding mode will cause all enclosed areas to be filled. But there are exceptions.

To determine whether an enclosed area is filled in winding mode, you again imagine a line drawn from a point in that area to infinity. If the imaginary line crosses an odd number of boundary lines, the area is filled, just as in alternate mode. If the imaginary line crosses an even number of boundary lines, the area can either be filled or not filled. The area is filled if the number of boundary lines going in one direction (relative to the imaginary line) is not equal to the number of boundary lines going in the other direction.



...全文
52 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Last_Dodo 2002-05-21
  • 打赏
  • 举报
回复
第一次做英文翻译而且基本上没有window programming经验,译得不好请原谅。

首先,“交替”和“迂回”状态间的区别相当简单。
对于“交替”状态,你可以假想从一个封闭区域中的一个点向无限远处划条线。当那条假想的线和奇数条边界线相交时,这个区域是填满(颜色)的。这就是为什么那个星的所有的角是填满而其中心是空的。
五角星的例子可能会让你觉得“迂回”状态比较简单。当你用此状态来画多边形时,多数情况下封闭区域会被填满。当然,有特例。
你一样可以用上面的划线方法来确定一个封闭区域在“迂回”状态下是否被填充。和“交替”状态一样,如果此线和奇数条边界线相交,这个区域就是被填满的。
如果是偶数,只有和那条假想线的方向相同和相反的边界线数目不相等时此区域才被填满。
delphihero 2002-05-21
  • 打赏
  • 举报
回复
请看一样的问题:
http://www.csdn.net/expert/topic/653/653727.xml?temp=.2428247
brapler(快了) 的书上不对,是穿过逆时针线和顺时针线的区别,不是简单的奇偶数线
i_doit 2002-05-21
  • 打赏
  • 举报
回复
to: delphihero(阿蒙(C++))

对于winding模式的说明我还是不太明白,请详细解释一下,谢谢!!
brapler 2002-05-21
  • 打赏
  • 举报
回复
这是我从书上给你抄的,我和你一样,学这段时看了好几遍,中文,英文,还是不懂,最会还是看图看懂了,你可以顺着思路看图,这样才好懂.

首先,alternate和winding方式之间的区别很容易察觉.对于alternate方式,你可以设想从一个无穷大的封闭区域内部的点画线,只有假想的线穿过了奇数条边界线时,才填充封闭区域.这就是星的角被填充而中心没被填充的原因.
五角星的例子使得winding方式看起来比实际上更简单一些.在绘制单个的多边形时,大多数情况下,winding方式会填充所有封闭的区域.但是也有例外.
在winding方式下要确定一个封闭区域是否被填充,你仍旧可以设想从那个无穷大的区域画线.如果假想的线穿过了奇数条边界线,则区域被填充,这和alternate方式一样.如果假想的线穿过了偶数条边界线,则区域可能被填充也可能不被填充.如果一个方向(相对于假想线)的边界线数与另一个方向的边界线数不相等,就填充区域.


你要注意五角星下面的那个图!
i_doit 2002-05-20
  • 打赏
  • 举报
回复
如果有中文版的,请帮我把这段话的中文抄下来吧!!

69,369

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧