Click here to Skip to main content

Algorithms

    RSS: RSS Feed

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
QuestionCrowd detection (people), how to? PinmemberGamma_ace16:53 12 Nov '09  
AnswerRe: Crowd detection (people), how to? Pinmemberkaushik_acharya21:03 5 Nov '11  
QuestionAlgorithm to C# [modified] PinmemberVS newbie8:05 11 Nov '09  
AnswerRe: Algorithm to C# PinmemberRichardM112:29 11 Nov '09  
QuestionCollision Detection with a Quad tree PinmemberSK Genius17:22 5 Nov '09  
AnswerRe: Collision Detection with a Quad tree PinmvpLuc Pattyn17:40 5 Nov '09  
AnswerRe: Collision Detection with a Quad tree Pinmemberely_bob13:05 18 Nov '09  
Alternative solution:
re-structure your "tree" and use a radial(gross) test
 

radial:
if((dist(a,b)^2-RadiusSqrd)<0)
{
//inside circle might be a collision canidate
}
 

(pathagarean therum with a bit of inside/outside circle, with small error...) it is fast.
 

Gross:
 
or iterativly restructure your list...
public static int blah(point P, point Q)//IComparer
{
     if(P.X>Q.x){ return 1;}
     else if(P.X==Q.x){return 0}
     else{return-1}
}
 
this way you would only need to "check" against neighbors in the tree structure.
 
alternativly you could use a float type(but that is basically the radial method of above)
 
using this method you basically only ever have a few checks,
 
there is one other way off hand..
 
I lik eto use the System.Drawing.Region (i forget the name) but it will give the union or difference of two "polygon"(regions) which is on the gpu and crazy fast.. in which case you may be able to do it brute force.. cus it is fast.. if you like this, or need more reference send me a ping and I will scrounge up the code for you.. leaving work --Hurray Smile | :)
Questionorder of algorithm Pinmemberkhomeyni21:30 4 Nov '09  
QuestionRe: order of algorithm Pinmemberharold aptroot2:32 5 Nov '09  
AnswerRe: order of algorithm Pinmemberkhomeyni5:45 5 Nov '09  
GeneralRe: order of algorithm Pinmemberharold aptroot6:10 5 Nov '09  
GeneralRe: order of algorithm Pinmemberkhomeyni6:26 5 Nov '09  
GeneralRe: order of algorithm Pinmemberharold aptroot6:30 5 Nov '09  
GeneralRe: order of algorithm Pinmemberkhomeyni6:49 5 Nov '09  
GeneralRe: order of algorithm Pinmemberharold aptroot7:45 5 Nov '09  
GeneralRe: order of algorithm Pinmemberkhomeyni20:35 5 Nov '09  
GeneralRe: order of algorithm Pinmemberharold aptroot2:00 6 Nov '09  
GeneralRe: order of algorithm PinmemberRichardM112:33 11 Nov '09  
AnswerRe: order of algorithm PinmemberRichardM112:58 11 Nov '09  
GeneralRe: order of algorithm Pinmemberkhomeyni3:20 12 Nov '09  
GeneralRe: order of algorithm PinmemberRichardM116:20 13 Nov '09  
GeneralRe: order of algorithm Pinmemberharold aptroot3:40 12 Nov '09  
GeneralRe: order of algorithm PinmemberRichardM116:19 13 Nov '09  
GeneralRe: order of algorithm PinmemberRichardM113:58 12 Nov '09  
GeneralRe: order of algorithm Pinmemberharold aptroot1:34 14 Nov '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.5.120210.1 | Last Updated 14 Feb 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid