OZONE Asylum
Forums
DHTML/Javascript
points in polygon test
This page's ID:
31745
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Slime said: After a brief look at your script, everything looks ok except for the line j = i++; This modifies i, which might affect the loop behavior and cause it to skip every other line segment. I think you probably want j = (i + 1) % xp.length; Thanks so much. That was the problem, I think. It now works on the correct rock. It's not perfect. I'm going to try isPointInPath() again, which was the first way i tried to do the hit test. Thanks for the help, everyone. I've been scratching my head for a few days on this. poi, would checking the color at the bullet positions require using getImageData? Or is there a method you could recommend using? Also, if using the colored poly method, would you set only the currently-being-tested polygon in that color? obviously, I don't want to literally fill the polygon, so I'd have to redraw the scene again if I filled the polygon. Did I misunderstand what you meant? Could you suggest an order of events to follow? Thanks again, everyone.
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »