Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Physics/Molecules
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AzureFire




PostPosted: Sun Dec 04, 2005 9:11 pm   Post subject: Physics/Molecules

Fist of all, please don't post entire code here, I just need help with the concept.

Here's what I'm trying to do. I want to make a screen, where there are about 20 - 30 randomly placed dots. They will start moving in random directions, but they will attract and orbit, then repel each other.

I don't really understand how to get them to orbit eachother, before they repell.

Any help would be greatly appriciated.

P.S. This is for my own personal gain, not for school.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Dec 04, 2005 9:55 pm   Post subject: (No subject)

well your particles have to exert a force on each other (gravity and/or electrical). Search for gravity in [Turing Source Code] for some examples.

For gravity just have each molecule pull towards all others.

The model is quite simple, but starting out with the right numbers for a pretty looking effect could take some guess work.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: