#### Archived

This topic is now archived and is closed to further replies.

# sloooooowwwwwwww

This topic is 5915 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

how much would it downgrade speed drawing 850 cubes to the screen and checking for collisions with all of them? i mean would it be heaps or just a little?

##### Share on other sites
It depend on your CPU speed.
On mine, it would be nothing at all,
on a celery 100, it will be slow.

[ my engine ][ my game ][ my email ]
SPAM

##### Share on other sites
ACUALY, i forgot to mention you are dealing with 2^850 check here, that is 7.5075168288047002299711576955093e+255 ... hmm, i sound wrong. well, it will be somthing exponention :?

[ my engine ][ my game ][ my email ]
SPAM

##### Share on other sites
my computer is a amd k-6-2 400 and i have a voodoo 3.

##### Share on other sites
Excuse me, I don''t know much about collision checking, and maybe I''m totally wrong, but:

Wouldn''t the number of checks be

850+849+848...+1 = (850+1)*(850/2) = 361675 ?

That''s a little bit less than 2^850...

/John

##### Share on other sites
psudocode:
for all cubes as FOCUSCUBE{    for eatch cube as CHECKCUBE{    FOCUSCUBE->check(CHECKCUBE)}}

that looks like 850 loops with eatch loop having 849 loops thats 849*580 }= 721650

[ my engine ][ my game ][ my email ]
SPAM

##### Share on other sites
and i mean checking each cube against eatch cube.

[ my engine ][ my game ][ my email ]
SPAM

##### Share on other sites
FunkyTUNE!!! is correct. By doing 850*849 you're repeating *alot* of checks. Take this example, you have objects A, B and C.

What your loop will do is this:
1st interation of outer loop:
(A,B), (A,C)
2d interation of outer loop:
(B,A), (B,C)
3rd interation of outer loop:
(C,A), (C,B)

However notice that in the 2nd interation we've already checked AB, and in the third interation we've already checked AC and BC.

You want to do this:

1st
(A,B), (A,C)
2nd
(B,C)

This can be accomplished with this code (Assuming areas are Low to High):
for I=Low to High-1   for J=I+1 to High      Compare(I,J)   next Jnext I

[EDIT]: Correct horrible insult to FunkyToon, ...eer tune

[edited by - michalson on May 6, 2002 8:27:08 AM]

##### Share on other sites
It is FunkyTUNE, but that''s ok

##### Share on other sites
WTF?!?!?!?!
Thats what I said, not funkytune !!!

[ my engine ][ my game ][ my email ]
SPAM

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 29
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631740
• Total Posts
3001962
×