Jump to content


-Simple- 3D flocking using Javascript?


3 replies to this topic

#1 bigkahuna

    Member

  • Members
  • PipPip
  • 32 posts

Posted 08 October 2006 - 02:04 AM

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!

#2 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 09 October 2006 - 01:52 AM

Have you already read Craig Reynold's website?
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*

#3 bigkahuna

    Member

  • Members
  • PipPip
  • 32 posts

Posted 09 October 2006 - 01:59 AM

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.

#4 GroundKeeper

    Valued Member

  • Members
  • PipPipPip
  • 110 posts

Posted 10 October 2006 - 11: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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users