查看单个帖子
旧 2009-05-06, 02:52 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】how to improve precision

how to improve precision
how to improve precision
take circle for example, a circle will be simplified as polyline. in other words, a circle will be simplified into a lot of short arcs on screen. but if i zoom in the circle. it will looks like a polygon.
so i want to know if there exist some variable to control the precision of a circle or an ellipse. if i want to make the circle more smooth, which function can i use.
my client class is derived from odgigeometrysimplifier and odgsbasevectorizedevice. just like the class exgssimpledevice portrayed in odvectorizeex.
thanks for any answer.
i had similar problem once and solved it by overriding these 2 virtual member functions:
double myview::deviation(const odgideviationtype, const odgepoint3d&) const
{
return 0.01;
}
double myview::modeldeviation(const odgideviationtype /*type*/, const odgepoint3d& /*modelpoint*/) const
{
return 0.01;
}
the stuff looks smooth enough. however, you can change this constants or even make them depending on the current zoom factor.
myview is derived from odgsbasevectorizeview and odgigeometrysimplifier
best regards
chudomir

quote:
originally posted by xbull
my client class is derived from odgigeometrysimplifier and odgsbasevectorizedevice. just like the class exgssimpledevice portrayed in odvectorizeex.
odgigeometrysimplifier::setdeviation should be used for this purpose. exgigdigeometry.cpp and gsopenglvectorizer.cpp contains examples of using this method.
sincerely yours,
george udov
done!
thanks very much!
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)