高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】hatch gradients
hatch & gradients
hatch & gradients
i've been trying to figure out how the gradients and hatches work in dwgdirect, so far i've come to the conclusion it is with the dbhatch.h header but it is the how to implement it that interests me, looking at the documentation gives me nothing, it just tells me what is the function, not how it is done. is there anyone that have experiemented on gradients & hatches and willing to share the knowledge?
update
i've been trying to fiddle with "gradientfilltriangles" as in the example of exgigdigeometry without any signs of success... now every color shows but the colors that are in "gradient" are simply not shown. is there something else i need to implement to work with the gradientfilltriangles, is there a whole other way to do it that works better? can anyone help me out on this, it is any drawing with any gradient that does this. if i remove the code for the gradientfilltriangles every colors show but no gradients at all (just one solid color)
last edited by clisk; 18th march 2004 at 11:00 amfff">.
does odamfcapp show gradients correctly in wingdi device? not all systems support wingdi gradients. for example it does not work on nt4.
sergey slezkin
what is your task?
gradient hatch rendering works in dwgdirect in that way. first, we tesselate hatch, breaking it on triangles. then colors in triangles' vertexes are calculated. then we verify is triangle with linear interpolated color satisfactory approximates gradient color, and if no - triangle is broken (it is done for each triangle, until all of them are "good"). resulting set of triangles is passed to giworldgeometry by worlddraw() method, as shell primitive with non-null pvertexdata parameter.
then this shell goes through gi rendering pipeline, where it can be clipped. in the end, device receives the shellproc primitive (at this point shell can contain not only triangles). it is finally tesselated and rendered using appropriate methods (glshademodel(gl_smooth) in opengl and function gradientfill in wingdi).
sincerely yours,
george udov
we have decided to put the gradient implementation on the ice for now, since its somewhat a new feature, we will concentrate on basic features intead of gradient, but it will be implemented in the future.
thx for the replies, i keep it in note and going to implement it in due time.
as for what my task is, it is simply to render drawings into a viewer that we implement into another of our application.
|