OZONE Asylum
Forums
DHTML/Javascript
20 Liners - July 08 - Your favorite video game
This page's ID:
30391
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
[quote] [b]poi said:[/b] smoff + esskay: any progress guys ? Can I, or anyone else, help in any way ? [/quote] I was working on my entry but as said I had two other compos on my worklist :/ (one lame gamedev compo and some vector thingy for assembly exec. gfx). I hope I've more time on next month. EDIT Ok, I'll try to make something very fast (eventhough I won't have enough time) PS. I made some point-in-triangle math, is it allowed to replace this [code]function InTri (xp, yp, x1, y1, x2, y2, x3, y3) { var divisor = (x3-x2)*(y2-y1)-(x2-x1)*(y3-y2); if (divisor==0) //Divided by 0, for triangles we can just: return InTri (xp, yp, x2, y2, x3, y3, x1, y1); var s=((yp-y1)*(x3-x2)-(xp-x1)*(y3-y2))/divisor; var t=(xp-x1-s*(x2-x1))/(x3-x2); return ((0<=t)&&(t<=s)&&(s<=1)); }[/code] with something like this [code]function InTri (xp, yp, x1, y1, x2, y2, x3, y3) { var divisor = (x3-x2)*(y2-y1)-(x2-x1)*(y3-y2); if (divisor==0) //Divided by 0, for triangles we can just: return InTri (xp, yp, x2, y2, x3, y3, x1, y1); //Dirty 3 lines to one line "optimizing" return ((0<=(xp-x1-s*(x2-x1))/(x3-x2))&&(t=( ... lots of stuff in 1 return ..); }[/code] [small](Edited by [url=http://www.ozoneasylum.com/user/6818]smoff[/url] on 07-31-2008 19:48)[/small] [small](Edited by [url=http://www.ozoneasylum.com/user/6818]smoff[/url] on 07-31-2008 21:19)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »