|
|

楼主 |
发表于 2005-9-15 23:04:00
|
显示全部楼层
Re: Re:可配置笔触的勾边截图
azureyes: Re:可配置笔触的勾边截图
你那个查找边缘的算法,就和找Shadow Volume的算法的一样, 如果模型复杂了,极其消耗性能的.
不知道你截图用的模型,是多复杂的.
我截图上的模型就是DirectX SDK带的tiger.x,大概500来面吧。
dot(N,V) == 0检测,遍历所有顶点一次,复杂度O(n)
sign(dot(N1,V1)) != sign(dot(N2,V2)),遍历所有边一次,复杂度同样是O(n),只不过多一次点击运算而已。这应该是几何上准确的勾边定义。
以下取自Art-based Modeling and Rendering for Computer Graphics, by Lee Markosian:
A polygon is front-facing if the dot product of its outward normal and a vector from a point on the polygon to the camera position is positive. Otherwise the polygon is back-facing. A silhouette edge is an edge adjacent to one front-facing and one back-facing polygon.
不过勾边计算确实是跟模型复杂度有关,这也是勾边的特性之一吧:)如果实在吃不消可以把渲染的模型和检测勾边的模型分开。渲染的模型面数可以高些,检测勾边的模型面数限制在某一范围内。 |
|