Free particle flocking plugin

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2012   #16
Ah. That's the ticket.
I haven't really done any C++ developing for R14 yet. That array code is something I'll definitely look into.

Just one more question.
When I use GeDynamicArray. It doesn't work unless I supply it an array size value. What do you suggest I use for the size of the arrays?
Example:
R14: c4d_misc::BaseArray<TargetData>targetData;
 R12: GeDynamicArray<TargetData>targetData(What array size do I use in here?);	
 
 R14: c4d_misc::BaseArray<RepellerData>repellerData;
 R12: GeDynamicArray<RepellerData>repellerData(What array size do I use in here?);  


For testing purposes. I just put 999 in the each array's size parameter as a hard coded value.
And it seems to run just fine and dandy in R12.
But of course. I don't want to leave the two arrays sizes hard coded like that.

*Edit-Never mind.
I forgot about the GeAutoDynamicArray option. That one doesn't require a size value.

-ScottA
__________________
My Gallery

Last edited by Scott Ayers : 10 October 2012 at 12:39 AM.
 
Old 10 October 2012   #17
Care to offer the R12 compiled version for download?

_mike
 
Old 10 October 2012   #18
^That depends on Frank. It's his plugin.

-ScottA
__________________
My Gallery
 
Old 10 October 2012   #19
It's OpenSource. You can compile it, change it, improve it and share it how and whereever you like, as long as you don't sell it. If you make your own build and publish it, you might want to add a line indicating your work to the console output in main.cpp -> PluginStart().
 
Old 10 October 2012   #20
Originally Posted by Scott Ayers: When I use GeDynamicArray. It doesn't work unless I supply it an array size value. What do you suggest I use for the size of the arrays?

...

For testing purposes. I just put 999 in the each array's size parameter as a hard coded value.
And it seems to run just fine and dandy in R12.
But of course. I don't want to leave the two arrays sizes hard coded like that.

*Edit-Never mind.
I forgot about the GeAutoDynamicArray option. That one doesn't require a size value.

No, it works without a given size. That's why it is the DynamicArray.

This code compiles fine here in R12 and R13:

struct foo
{
	Real _a;
	Bool _b;
	Vector _c;
};

GeDynamicArray<foo>bar;


I wouldn't use the GeAutoDynamic for this purpose.


Originally Posted by Troyan: That's great, Frank! Would it be possible to to post that file to take a look at your settings?

The scene files for all the three videos are included in the ZIP file (for the last scene with the worms, I have just added it and re-uploaded the ZIP on my server).
 
Old 10 October 2012   #21
Hy there,

here is a compile for R12+ Win! Just the binary though, would have to clean up my little test-project first, enjoy

Cheers,
André
Attached Files
File Type: zip Jacks Flock Modifier Win R12+.zip (170.2 KB, 75 views)
 
Old 10 October 2012   #22
Is any kind soul planning a r13 Mac compile? Pretty please...?
__________________
"...if you have faith as small as a mustard seed... Nothing will be impossible for you."
 
Old 10 October 2012   #23
Originally Posted by maxx981: Hy there,

here is a compile for R12+ Win! Just the binary though, would have to clean up my little test-project first, enjoy

Cheers,
André


thanks! c4d-jack and maxx981

works fine R13.
 
Old 10 October 2012   #24
I have to beg also for a Mac release! I am very curious what effects using this type of boids movement would have on a turbulence FD simulation.
 
Old 10 October 2012   #25
this looks wonderful. i'd love to see a working verion for mac r13, too.

would it be possible to restrict the simulation to a plane or a surface?
to animate ants for example ... even though they probably wouldn't behave like that.

i'm going to look into the code within the next days but i'm more familiar with python, not so much c++.
maybe i'll understand how the formula works ...

however, thaks for keeping it open source!

cheers, sebastian
 
Old 10 October 2012   #26
As a quick though, you could skip the Level Flight rule and then use e.g. a GeRayCollider to stick the particles to a surface.
 
Old 10 October 2012   #27
How do you gecollider something? (sorry for sounding simple)

Last edited by smurfted : 10 October 2012 at 06:17 PM.
 
Old 11 November 2012   #28
Take a look into the SDK documentation and read about the GeRayCollider class.

To make the boids stick to a surface, you could basically shoot a ray from each boid downwards onto the surface and then place the boid at the point of ray collision.
 
Old 11 November 2012   #29
GeRayCollider is nice. i already used it for something similar. but it feels kind of slow, or am i imagining this? i suppose with 200+ particles it will become pretty slow. how does dynamics handle these things? i mean if all the physics-calculations would use GeRayCollider for their collision-detection, it wouldn't run as fast as it does.

regarding my initial question, for my situation it will be enough to stick the boids to the xz-plane. so it's basicly a 2d calculation. didn't have time to check the code jet, but the easyest way would probably be to keep the Y-values always at 0.

since i'm not so familiar with particles yet, is it possiple to influence the standard-particles with expresso (to keep Y at 0) or use TP-stuff?
does your code also work with thinking particles?
 
Old 11 November 2012   #30
True, the GeRayCollider is not the fastest.
I can't tell how Dynamics does it, since this is internal stuff as well as very complex.

If you only need the boids to stick to a plane (even if it's not XZ but a tilted plane), there are easier ways to do it. But for an arbitrary surface, I would go for the GeRayCollider. Or you make the whole simulation 2D-based and calculate everything in UV space. But then again, it would only work on surfaces with perfect UV coordinates.

And as far as I know, it is not possible to influence the standard particles with XPresso. Also, my code does not work with TP.

Last edited by c4d-jack : 01 January 2013 at 09:38 AM.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:12 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.