Quote:> Hi All,

> I need a help from you. I am very new to the graphics.

> My task is to draw an ellipse hatched. ie., I have to fill the ellipse

> region full of vertical lines ( /* ||||| */). I am constructing the

> ellipse using Bezier curves. How to calculate the elliptical region so

> that I can fill the area.

The circumference of an ellipse is calculated using an elliptical integral.

However, knowing the circumference will not help you to cross hatch it.

To fill an ellipse, it will depend on what sort of notions you are using.

If you have vectors, then it may be simplified. If you have pixels, then

you will need to know if a pixel is inside or outside of the ellipse.

The CGA FAQ has the following:

Subject 5.08: How do I find the intersection of a ray and a Bezier surface?

Joy I.K. and Bhetanabhotla M.N., "Ray tracing parametric surfaces

utilizing numeric techniques and ray coherence", Computer

Graphics, 16, 1986, 279-286

Joy and Bhetanabhotla is only one approach of three major method

classes: tessellation, direct computation, and a hybrid of the

two. Tessellation is relatively easy (you intersect the polygons

making up the tessellation) and has no numerical problems, but can

be inaccurate; direct is cheap on memory, but very expensive

computationally, and can (and usually does) suffer from precision

problems within the root solver; hybrids try to blend the two.

Reference:

[Glassner:RayTracing]

Maybe this will be helpful. Of course, you only have a line and not a

surface. Maybe this reference from the CGA FAQ could help:

Directory of Computational Geometry Software,

Nina Amenta is maintaining a WWW directory to computational

geometry software. The directory lives at The Geometry Center.

It has pointers to lots of convex hull and voronoi diagram programs,

triangulations, collision detection, polygon intersection, smallest

enclosing ball of a point set and other stuff.

http://www.geom.umn.edu/software/cglist/

You might also look at the Graphics Gems stuff. They have plenty of

clipping and intersection algorithms in there.

Foley and Van Dam's "Computer Graphics" on page 488 talks about bezier

curves. They suggest using a convex hull for clipping. Certainly, if

nothing else, you can derive it from the basic mathematics.

--

C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html

"The C-FAQ Book" ISBN 0-201-84519-9

C.A.P. FAQ: ftp://cap.connx.com/pub/Chess%20Analysis%20Project%20FAQ.htm