View Full Version : -Simple- 3D flocking using Javascript?
bigkahuna
10-07-2006, 08:04 PM
I'm using a game engine that uses Javascript as it's programming/scripting language and I'd like to create a very simple 3D flocking (boids) script to move 3D objects within a given area. I've searched the net and read a bunch of articles, and probably because I'm not much of a programmer, most of it is over my head.
Does anyone know of a super simple sample or tutorial that might get me started?
Many thanks in advance!
monjardin
10-08-2006, 07:52 PM
Have you already read Craig Reynold's website (http://www.red3d.com/cwr/boids/)?
bigkahuna
10-08-2006, 07:59 PM
Yes, thank you, I have. I understand the general principles involved, but not the code as I don't know any C. In fact the full extent of my programming is limited to some Javascript and a little HTML, PHP and Python. The engine I'm using (Unity) uses Javascript, so I'm hoping to find something that will help me put together something in that.
GroundKeeper
10-10-2006, 05:52 AM
The general idea is linear algebra. Move you boids towards the center of mass. This can be done by using vector operations which is very affordable in simulation. If the linear algebra is the problem try reading up on it before. Other than that I would recommend to start looking at biods from the mathematical point of view first to not become confused with the indexes of vectors and stuff like that. If you understand the general mathematical principal the implementation is no problem.
vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.