DLG007

Dear All,

I am using DirectX to write application and I cannot figure out how to do this:

I have a polygon and I want to create inward contours offset of that polygon by giving number of contours that I want and the distance from one contour to another as well.

I would highly appreciate if anyone can advise me the algorithm of doing this

Regards,

LG



Re: Game Technologies: Graphics Contour offset of a polygon

BLANC Guillaume

Cel shading algorithms are all doing the technic you're decribing : extracting contours and rendering them with tunable parameters (thickness, ...).
I won't be able to explain you how to do, but you can easily find tutorials and samples around the net. You can try Nvidia and ATI developper pages, Nehe (but it's opengl), and of course google...





Re: Game Technologies: Graphics Contour offset of a polygon

DLG007

Dear BLANC Guillaume,

Thanks for your advice. I was trying to find any example on the net but I cannot find one. Could you please advise me the link or just provide a small example of sample codes so that I can learn to do this. You can provide in any language VB.NET or C#.

I look forward to hearing from you!

Regards,

LG





Re: Game Technologies: Graphics Contour offset of a polygon

BLANC Guillaume

A google seatch with "cel shading hlsl" keywords gives lots of results: You can try the one on this page to start with. Also I know there's a tutorial on nehe website. It is in OpenGl but it can help understand principles...





Re: Game Technologies: Graphics Contour offset of a polygon

DLG007

Dear Blanc Guillaume,

Thanks for your advice. I don't want to have a shadow of the polygon but I want to calculate something similiar in this link http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Straight_skeleton_2/Chapter_main.html in Figure : Offset contours of a sample polygon

Please let me know if you know how to draw offset contours of a polygon as in this link.

Regards,

LG





Re: Game Technologies: Graphics Contour offset of a polygon

BLANC Guillaume

Cel shading technics are using a "sort of "coutour extraction algorithm. So if you manage to understand how it works, maybe you coud do your effect.

Also, stencil shadows uses a real time contour extraction (from the point of view) to be rendered. This extraction can be done either on the cpu or using shader. So maybe this could be a good starting point for you. Once you have contour vertices (on the cpu side), then simply use line primitives.