| Re: Polygon filling oddities [message #27065 is a reply to message #26946] |
Thu, 04 October 2001 18:14  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mark Hadfield (m.hadfield@niwa.cri.nz) writes:
>> I can reproduce your results. But I can also
>> get the PolyFillV code to work by making this
>> change:
>>
>> p = polyfillv(0 > x < (!D.X_Size-1), 0 > y < (!D.Y_Size-1), 500, 500)
>
> Two comments/questions:
>
> 1. Do you think you need !D.X_Size and !D.Y_Size in there? What has the
> current graphics device got to do with it? (Not arguing just curious.)
Oh, I was trying to be general. But 10 milliseconds
after I hit the Send button I realized there wasn't
much point with those damn 500s in there. :-)
In this case "499" would have worked just as
well, and would maybe have been clearer too.
> 2. Clipping x and y before calculating the filled polygon generally won't
> give the same answer as clipping the polygon, at least not when the vertex
> spacing is large. Eg think of replacing the circle in my example with a
> triangle.
Humm. I guess you're right. You might have to
do some interpolation in this case. Although,
in practice I've never worked with objects
where this mattered much.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|