Subject Re: Filling with TBitmapPolygonFiller
From Lynn C. Ormond <>
Date Tue, 27 Apr 2010 13:33:17 -0700
Newsgroups graphics32.general
Attachment(s) P&G.jpgP&G ThreeD.jpg

Hi, Simon,

I've been looking at something similiar recently and can outline what is
needed, I think.
I haven't actually started coding, just getting the concept clear in my

    1. You need one of two things with your fill image.  Either it should be
tileable, without
        visible line, or you need to treat it as if it is stretched for fill
the area of your cloth
        when it is flat.
    2. Determine Z order of your fill areas, back to front, skipping those
that are hidden by
        nearer folds of the cloth, or just drawing them first.
    3. Calculate the size of each rectangle (flattened) and the copy that
portion, with
        suitable transforms for fit the shape of your cloth, in is display

It's gonna be fun!, but once you get it, particularly if you add light and
shading, it should
look fabulous.

I've recently added 3D effects to my Infinite Fascination project.  Attached
are samples,
without shading and with.

"Simon Beesley" <> wrote in message
> Hi,
> I have got a cloth simulation that offers a number of different drawing
> modes. In one of them, it uses TBitMapPolygonFiller to fill the cloth with
> a
> floral (clothlike) pattern from a JPG image.   The attached pictures show
> the cloth with and without the pattern.
> Unfortunately this doesn't look as good as I hoped it would, since the
> cloth
> pattern doesn't get rescaled to fit the cloth outline. I've seen cloth
> simulations in Flash with Actionscript that fit the image to the cloth
> using
> some kind of triangulation technique, but so far I haven't been able to
> work
> out how it's done.
> Is there any way to do this with GR32 (with or without
> TBitmapPolygonFiller)?
> Simon