I’m a newcomer to this forum, and first it looks like a right time to introduce my self. I’m a postgraduate student studying traffic and transportation engineering, more specifically traffic simulation in China. I got to know blender quite early in 2003/2004 when I’m undergraduate but didn’t use it heavily until recently.
Unlike most people in this forum, I’m a sort of tech guy more than a artist(I am even not sure whether I’m a technique guy :o ). So my main use of blender is visualize data set of various kind.
Current I’ve finished a mesoscopic traffic simulation package and with it I can simulate the vehicle traffic in a large road network in Shanghai, China(100000+ vehicles in an area of 16km*16km). The result is huge vehicle trajectory data set and I’m looking for a way to visualize it. Although the simulation package has a GUI that visualize the moving of vehicles using OpenGL but the result is not impressive at all (remember I’m a tech guy:eyebrowlift2:).
But I need to impress my advisor and more importantly the bureaucrats who control our research budgets. Here blender comes as a rescure. The basic idea is import vehicle trajectory data in blender and then have my friend(he is a good artist as you guys:yes:) add some fancy things like shining car model, bright sky, trees, grass, buildings, roads… This way I’m sure I can give them an impressive presentation.
Enough introduction, here comes the real tech problem.
Currently I’ve done some preliminary work use blender 2.4x and python script:
the basic idea of the script is that for every vehicle in the simulation output an object is add in blender with ipo curves of location, rotation, layer. The location, rotation ipo controls the moving and turing of vehicle object; the layer ipo controls the emerge and disappear of vehicle object. That is, for a specific vehicle object, the layer ipo puts it on layer1 when it’s traveling in the road network and layer2 before the time entering and after the time leaveing the road network .
I repost the screen shot here, the above description should make more sense with it.
full size version:http://i29.tinypic.com/mwqs91.jpg
This method is working in my experiment but has two fundamental flaws.
First,the above mention object+ipo method needs a object in blender for every vehicle in my data set even its not entering or already leaving the road network. It’s not a problem in my experimental scene with 1000+ vehicles and no fancy things like buildings, roads… I’m not quite sure how it will work with the real scene with 100000+ vehicles and all kinds of fancy things.
Second, and more importantly, it’s very hard for my friend(still remember him? the art guy:eyebrowlift2:) to manipulate all vehicles as a whole. For example, some times he wants to scale and translate all the vehicles to match the underlying road meshes. Now he has to choose every vehicle objects in the scene and then do the manipulation, this process is not only tedious but also error prone . It’s quite hard for him to choose exactly all vehicles with no missing vehicles and no extra objects. Even worse it’s practically impossible for him to adjust the time factors of vehicle moving(like for a fast forward effect).
I’m now considering to use particles system as the solution. Indeed, the particle system should be an idea solution for my problem. Although I’m not familiar with the blender particle system, but my experience with particle system in real time graphical engine like Ogre tell me that particle system will only generate a particle when it comes to life and will “recycle” it after its death. That’s exactly the solution to the first problem above mention.
As for the second problem, we can solve it elegantly by put all particles(vehicles) in the local coordinate system of the object which the particle system stick to. Then we can manipulate all vehicles as a whole through manipulate the object that has the particle system. The time factor and time translation could be represented as parameters to the particle system.
If I understand right, with current particle system I cannot do what I want to do, because there is no way I can specify the precise emerging time, dead time, emerging position, moving trajectory for a specific particle. All I can do is specify the number of particles I want, the spacial and temporal distribution of particle generation, particle moving rules(physics like newtonian, boids, …) then let blender particle system to “simulate”(or bake) the particle emerging time, dead time, emerging position, moving trajectory into the cache.
If you think vehicles as a particle my simulation package did the same thing as blender particle system, so basicly all I need is a method to put my simulation result directly in the cache. I think this wouldn’t need a major change in the blender particle code, just a new physics type(maybe call it keyframed physics:yes:) or even better some kind of python api deaper into particle system will do. I think if this can be done, all my needs in my current project will be satisfied.
I fully appreciate that all blender Dev guys are busy coding 2.5 (I’m eagerly looking forward to its final form, thank you guys), and I also want to take my part in by adding this small piece. I‘m a decent c++ and python programmer(the dev language for my traffic simulation system) but has no previous experience in blender source code could anyone give me some direction as where should I started(doc is good, code is better), thank you.
Any comments are welcome, not only about the idea its self but also about the way I carry it out, even comments on my grammar error is helpful.(As you can see, I’m chinese, and trying to translate my paper in chinese into english for international conference of course for traffic not for blender:p.)
p.s. Thank you for you patient for such a long and verbose post. In fact there is some further thought on particle system with animated object, not quite related to my current project but interesting. Although I’m not sure if it’s original, but I’ll try to explain if someone is interested.