Autor Beitrag
hame50
Hält's aus hier
Beiträge: 1



BeitragVerfasst: So 27.04.08 14:16 
Hallo zusammen,

wahrscheinlich gibt's das schon mehrfach, aber ich hab einfach nicht das passende gefunden, als ich gesucht habe.
Gibt es in Delphi eine Funktion, die ich mit einem Punkt und einem Polygon fütter und die mir dann sagt, ob der Punkt im Polygon ist, oder nicht ?

Vielen Dank schonmal !
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: So 27.04.08 14:31 
Ich glaub nicht. Aber du könntest erst das Polygon auf einen Canvas zeichnen (mit z. B. Pinselfarbe schwarz) und dann testen, ob dein Punkt schwarz ist (==> TCanvas.Pixels, TCanvas.Polygon, TRect, Dynamische Arrays).
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: So 27.04.08 14:44 
Huch. Ich verweise grade zum 2. Mal an diesem Tag auf die Graphics32-Lib :shock:

Google findet deren Dokumentation: graphics32.org/docum...ines/PtInPolygon.htm

Die HP sieht hat sich ja ganz schön verändert, seit ich das letzte Mal da war.


Die Idee mit dem Hit-Test ist übrigens gar nicht mal so schlecht, so ähnlich hab ich das auch im Weihnachtsrätsel gemacht. Hätte mir fast die 3. Nuss gebracht, wenn ich Backtracking implementiert hätte...

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."