PDA

View Full Version : Flocking with Polygons. Possible?



aarons
08-21-2015, 12:13 PM
Fellow LW users,

I am trying to setup an animation using something like the attached model image. The idea is to organically fly the plate parts of the sphere around and have them end up in the shape of the sphere at the end. Have been trying to use flocking on the sphere model (all parts one layer currently), but no luck.

Any thoughts or suggestions would be greatly appreciated.

Thanks,
Aaron

Farhad_azer
08-21-2015, 12:33 PM
first set ur particle system and then use the model as arrive agent. then u can use instancer to replace particles with falt polys.

- - - Updated - - -

forgot to ask why u insist on flocking? it seems that morphing is a better option.

pinkmouse
08-21-2015, 12:57 PM
My first thoughts are DPkit part move...

jeric_synergy
08-21-2015, 01:47 PM
forgot to ask why u insist on flocking? it seems that morphing is a better option.
Every individual morph moves in a straight line, so without complicated chains of morphs, swooping and trajectories natural to flocking would be impossible via morphing.

Farhad_azer
08-21-2015, 02:02 PM
I did not mean morphing the shapes dear jeric_synergy. I meant morphing particles and attaching falt polys by instance and then taking advantage of rotation options in instancing. I guess this approach is a lot better bec at least does not require calculating every time we want to do some change IMO.

prometheus
08-21-2015, 02:42 PM
My first thoughts are DPkit part move...



yes...


unweld the object, save it send to layout, go to deform tab...nodes and add dpont part move, dpont part node isnīt native..
http://dpont.pagesperso-orange.fr/plugins/nodes/nodes/Download.htm
http://dpont.pagesperso-orange.fr/plugins/nodes/Additionnal_Nodes_2.html


plug som procedural textures in to the part move node maybe position..and the part move node output to the displacement node, but add a speed time nod and plug that to the proceduarl opacity input and see what happens..experiment..do some thinking, and then search for bryphi77 on youtube and watch some tutorials.

jeric_synergy
08-21-2015, 03:15 PM
I did not mean morphing the shapes dear jeric_synergy. I meant morphing particles and attaching falt polys by instance and then taking advantage of rotation options in instancing.
My apologies for my simplistic interpretation: that is indeed a possible approach.

pinkmouse
08-21-2015, 03:25 PM
As always, in this situation, I'll point you towards my Part move example:

http://forums.newtek.com/showthread.php?136524-house-building&p=1337613&viewfull=1#post1337613

MonroePoteet
08-21-2015, 03:43 PM
The DPKit Part Move works great with flocking. Here's a sample scene. The trickier parts were to use the LW-supplied Particle Info node rather than the DP Kit one with the Polygon layer of the sphere parented to the Point generator, and to subtract the original Particle position from the current position to get an offset. I've never had any luck getting flocking agents to spread evenly over a target mesh Goal director, so I think you'll have better luck generating the flock from the center points of the sphere parts (I used Make Pole to get the center points for the generator), render it forward, and then reverse the animation in post.

Remember you need to push the "Calculate Flocking" button in the Flocking panel to generate and move the flock.

mTp

dpont
08-21-2015, 11:48 PM
...The trickier parts were to use the LW-supplied Particle Info node rather than the DP Kit one with the Polygon layer of the sphere parented to the Point generator...


...The trickier parts were to use the DP Kit Particle Info node rather than the LW-supplied one with the Polygon layer of the sphere parented to the Point generator...

Denis.

dpont
08-22-2015, 12:01 AM
Sometimes you may need also a lscript for generating point centered for each polygon


/*
center_part.ls
by Denis Pontonnier 2009.
*/

@version 2.3
@warnings
@script modeler

main
{


selmode(GLOBAL);


fg=lyrfg();
emptylay=lyrempty();
lyrsetfg(fg);

cntlay = emptylay[1];

editbegin();
allpntcount=pointcount();
editend();

moninit(allpntcount,"");
count = 0;

selmode(USER);

while(true)
{
if (count >= allpntcount)
break;

selpolygon(SET,POLYNDX,1);
selpolygon(SET,CONNECT);

editbegin();


partcnt = <0,0,0>;

pntcount=pointcount();

for(y=1;y<=pntcount;y++)
{
vert = pointinfo(points[y]);
partcnt += vert;
count++;

if (monstep())
return;
}


partcnt /= pntcount;


editend();

selhide(SELECTED);

lyrsetfg(cntlay);
editbegin();
addpoint(partcnt);
editend();

lyrsetfg(fg);
}//End while

selunhide();
monend();
}


Denis.

pinkmouse
08-22-2015, 02:38 AM
Had a quick play before the FI practice this morning:

129386

That took about 1/2 an hour to do, modelling included, you could spend much more time tweaking to get exactly what you want.

edit: added correct zip...

edit: You'll also need the db&w free nodes: http://db-w.com/products/dbwtools/docs

MonroePoteet
08-22-2015, 04:35 AM
...The trickier parts were to use the DP Kit Particle Info node rather than the LW-supplied one with the Polygon layer of the sphere parented to the Point generator...

Denis.

No, I used the LW provided Particle Info node. The DPKit node seemed to reassign the parts between particles when they passed each other or got close enough or something during the flock movements. Not sure why. The original Particle Info set to "Parent Item" was simpler to set up and worked just fine.

Thanks for the script to put points at the center of each node. I selected all the polygons and used the Multiple => Subdivide => More... => Make Pole, then switched to point mode, copied the points (conveniently selected by Make Pole) to another layer. I didn't bother undoing the Make Pole after copying the points, but I could have.

mTp

dpont
08-22-2015, 06:03 AM
No, I used the LW provided Particle Info node. The DPKit node seemed to reassign the parts between particles when they passed each other or got close enough or something during the flock movements. Not sure why. The original Particle Info set to "Parent Item" was simpler to set up and worked just fine...

May be something that I didn't understand in your sample scene,
it didn't work for me in 2015.3,
but I get it to work with DPKit Particle Info node
and a different setup, Index Mode and Part Info Index plugged
in the Index input of the Particle Info node.

129390

Denis.

MonroePoteet
08-22-2015, 08:05 AM
May be something that I didn't understand in your sample scene,
it didn't work for me in 2015.3,
but I get it to work with DPKit Particle Info node
and a different setup, Index Mode and Part Info Index plugged
in the Index input of the Particle Info node.

129390

Denis.

OK, thanks. Both my original scene and your modified scene work on my LW 11.6.3. I missed the additional setup step of feeding the Part Info index into the Particle Info index for the DPKit node.

mTp


mTp

Farhad_azer
08-22-2015, 11:53 AM
No problem jeric_synergy.

I also did not know about dpkit part and going to experiment it now. it also seems to be a more difficult approach. am I right?

ernpchan
08-22-2015, 12:12 PM
If find dpkit very easy to use actually. You just have to get familiar with it.

erikals
08-22-2015, 03:09 PM
dpkit is straight forward...

but learning 3D and using nodes can take time

you'll get there, just experiment with some settings  http://erikalstad.com/backup/misc.php_files/smile.gif

MonroePoteet
08-23-2015, 03:35 AM
I also did not know about dpkit part and going to experiment it now. it also seems to be a more difficult approach. am I right?

I'd call it a much simpler approach, myself. The approach you suggested of morphing a set of points still requires assigning the polygons of the sphere to the points and having them follow the morphed points, as well as adding some sort of rotation so they don't retain their original orientation as the points "flock" about. With flocking and the DPKit Part Move node (with DPKit Part Info's index as input to ParticleInfo), this is done with a few drag-n-drops.

mTp

P.S. I just redid the entire scene in 7 minutes, including modeling. If I wanted to do another similar scene with a completely different geometry, it'd be about the same.

Farhad_azer
08-23-2015, 04:48 AM
I am sorry but I created the whole scene in about 1 min and 54 seconds and if we add the required time to download (and learn) dpkit then I am still way ahead. lol.

I am just kidding.

The sad thing is that my polys all rotate in the same direction and if you have them rotating randomly then you might be winner. BUT this contest is not over yet and I am going to explore more using nodes or perhaps even jolt.

P.S. of course it is not my intention to argue or debate about our approaches. we just are trying to learn more and discover new possibilities. enjoy.

prometheus
08-23-2015, 06:47 AM
I am sorry but I created the whole scene in about 1 min and 54 seconds and if we add the required time to download (and learn) dpkit then I am still way ahead. lol.

I am just kidding.

The sad thing is that my polys all rotate in the same direction and if you have them rotating randomly then you might be winner. BUT this contest is not over yet and I am going to explore more using nodes or perhaps even jolt.



P.S. of course it is not my intention to argue or debate about our approaches. we just are trying to learn more and discover new possibilities. enjoy.


I havenīt got it clear how your poly plates are supposed to rotate?
I think it might be possible to do with the right connections without adding additional points.
check out make vector node, you can add the time speed node in to one of those and decide vector rotating or movement etc, and if you put a procedural node in there between you then have random strenght of that displacement, theres a lot of options to displace the parts with normal direction etc.

Farhad_azer
08-23-2015, 07:25 AM
It is so simple Michael. I have a null object which is animated and stops at the center of the hemisphere points ( the shape that our friend has uploaded) and under rotation I set mode to target item and target mode to look at and then point to the animated null object.

sadly I am very inexperienced in nodes and I did not understand fully what u said but it is worth thinking and I will try to find out and share my results.

erikals
08-23-2015, 07:50 AM
but how are your poly plates supposed to rotate?

maybe you should make the animation backwards, then mdd it, then reverse the mdd playback

MonroePoteet
08-23-2015, 08:05 AM
The fundamental issue is how to separate the plates of the sphere into separate flight paths. Thinking about how to do it without PartMove, I think you could:

1) In Modeler, create a different weight map and a skelegon for each plate
2) In Layout, Convert Skelegons into bones and assign the appropriate weight map to each bone
3) Animate the bones in some sort of flocking manner, including rotation.

A lot of work creating the skelegons and weight map for each plate, IMO. But I think it'd work.

RE: learning DPKit, DPKit is *very* extensive. Dozens of nodes, each with many options. A "depth-first" learning approach is probably appropriate: only learn the node or nodes required to do a particular job based upon tutorials, suggestions, samples, etc. In this case, the sample scene uploaded by Denis (DPont) shows the simple node setup to do the job. It's under the Object => Properties => Displacement Tab => Edit Nodes button.

mTp

erikals
08-23-2015, 08:23 AM
are you trying to do something like this, only in reverse ?
https://www.youtube.com/watch?v=da40mHS1YgI

dpont
08-23-2015, 09:00 AM
May be that Rotating the particle is more easy in Particle FX
than in Flock Generator.

But procedurally in Part Move,
for separate animation of parts,
you should use the Part Info Index output,
i.e for offsetting a 3D procedural, plug it in position input,
since you start with static polygons,
an envelope in a Vector Scale node may be usefull
for fading in the effect.


Same sample scene as above,
procedural rotation (but without shader) randomization per part
(should be improved, rotation isn't noticable when parts go fast).
129426



Denis.

prometheus
08-23-2015, 09:51 AM
Farhad_azer..you should load your simple setup up here, so we at least can see how you have set that scene up.
as erikals mentioned..it doesnīt reveal how individual polyplates are supposed to rotate.

the most simple motion on a partmove displacement, that would be to keep it simple at first, so by simply adding a turbulence procedural texture, and a part move, the part move delta output goes to the displacement input.
feed the turbulence bump output in to partmove rotate and move input...thatīs the simplest one...and if you have a null ref object, you go to the turbulence procedural texture and select the null as a reference.
with this you can go to the end frame and drag the null and move around or scale it to see some effect going on...but that is just the simple stuff, and the ref null is there only to change the procedural texture position,scale and rotation which then will affect the parts to move, but it wonīt be there to use as a motion path to follow.

Farhad_azer
08-23-2015, 01:04 PM
you guys, I don't have any screen recorder and it is a shame that I don't know how to upload a file in forum. (I saw once sth named pai..buck or sth that does it but sorry, very busy these days)

here is the step by step of what I do.

1) in modelr I make a sphere (hemisphere for this particular example) and kill the polys.
2) I make a morph object and scale the points of the hemisphere.
3) in the second layer I create a flat poly.
4)save, send to layout, having the hemi selected I apply my morph.
5) I assign instance to points. point to the flat poly.
6) I make a null object and animate it. it moves from some place towards the center of hemi and stops there.
7) under rotation I set mode to target item and target mode to look at and then point to the animated null object.
8) I stop the chronometer :)
and the winner isssssssssssss Monroepoteeeeeeeeeet bec my polies all rotate and move in the same direction.

but if I add some random nodes in node editor (I can not do it under rotation bec it is set to target mode) then I might still have chance :)

Farhad_azer
08-23-2015, 01:57 PM
Check this one too.

I make a sphere. then do multishift to expand polies and copy/paste to second layer (1st layer can now be deleted).
then I set my morph map and change the polies and rotathe some of them and do whatever I want.
after sending to layout I can use normal displacement (shame on me I still can not use node based morphing I am so terrified of lw's nodes) and I animate it by gradient.

I think this techniques is a lot faster and simpler than all of the ways we all mentioned.

there is just small problem. I should rotate and change the morph targets one by one. is there a tool/script that rotates all polies randomly? jitter might work but it deforms shape and is not good at all.

I really am embaressed of myself for not using dp-kit till now. thank you all for sharing it. I am going to test it in these days. great great thanks to Denis himself bec he is very supportive and participates in discussion and troubleshooting.

prometheus
08-23-2015, 03:27 PM
Check this one too.

I make a sphere. then do multishift to expand polies and copy/paste to second layer (1st layer can now be deleted).
then I set my morph map and change the polies and rotathe some of them and do whatever I want.
after sending to layout I can use normal displacement (shame on me I still can not use node based morphing I am so terrified of lw's nodes) and I animate it by gradient.

I think this techniques is a lot faster and simpler than all of the ways we all mentioned.

there is just small problem. I should rotate and change the morph targets one by one. is there a tool/script that rotates all polies randomly? jitter might work but it deforms shape and is not good at all.

I really am embaressed of myself for not using dp-kit till now. thank you all for sharing it. I am going to test it in these days. great great thanks to Denis himself bec he is very supportive and participates in discussion and troubleshooting.

itīs okay..donīt be embaressed, everyonce and a while..most of us do at some points I guess...so your in the family :)

I think you are overcomplicating it with morphs, points etc...you should just try and displace a sphere with textures fed in to move and rotate, that will infact give random motion..then theres a multitude of ways to change direction, normal movement or rotations etc or follow a null reference.
so with part move if fed correctly the poly parts will not deform itīs unconnected parts as they are in shape..only their position and face rotation.

for uploading..itīs quite simple, you first need to save your object and scenefile in one content folder, right click and send it to compressed zip folder.
to upload...go to advanced reply and click the attachement gem in the buttons above your reply. then add files..then upload.

will try If I have the time tomorrow to record or post something...if I get the time.

aarons
08-24-2015, 08:02 AM
Thank you for all your comments and ideas! I am digging through them and trying to get a grasp of DPKit Part Move and the sample scenes you provided. Never used Part Move before, but looks very cool.

Thanks again!

Aaron

MonroePoteet
08-24-2015, 08:04 AM
Yes, no reason to be embarrassed! I didn't really mean it to be a contest with a "winner," just a demonstration of saving time and frustration by using "the right tool for the right job." Using morphs for this type of problem would require LOTS of morphs to simulate independent motion of each piece of the sphere. I tried it after your post, and got sick of moving and rotating each of the 72 pieces for the *first* flocking morph. The idea of having a point array with an instanced flat poly has the problem of transitioning into the sphere at the end. I did a similar type of "trick" years ago with a flock of books that was supposed to end up in a stack, but I could never get the transition from the particle based flock to the pile to look natural.

I can definitely recommend learning nodal system. There are many, many nodes written by both LW and independent contributors which supply lots of advanced capabilities over raw LW. Once you understand hooking up a node graph, then it's a matter of plowing through the huge libraries of nodes available to find what you need. I use Google search a lot, and there are lots of tutorials and sample scenes available. And, of course, asking for guidance in the forums works very well!

The LW created nodes are documented in the Lightwave 10 Surface and Rendering manual, with new nodes documented in the V11 updates. For whatever bizarre reason the comprehensive manual doesn't appear to be available on the Lightwave3D.com website. Maybe I'm just missing it somewhere. Here's a 3rd party pointer to the Version 10 manual:

http://www.pierce.ctc.edu/staff/bmartin/ddsgn141/SurfaceandRendering_LightWave_10.pdf

Also, here's a really old "Introduction to the Node Editor" video, which gives a very basic overview:

https://www.youtube.com/watch?v=lv1BTsTx4ts

Note that there have been updates to the Node Editor since this video was put out in 2010, but it doesn't appear that LW has produced an updated tutorial on Node Editor basics.

mTp

Farhad_azer
08-24-2015, 08:42 AM
There is nothing complicated my friend Micheal and everything works fine.

I totally agree MonroePoteet and I am sure u know that I was just joking about contest stuffs. I did not have that much difficulty making morph targets. I am also working on another approach and as u mentioned we discuss these issues to find a better solution. It has always been proved to me that sth which might not be perfect for current tasks will be life-saving solution on another occasions.

About nodes I definitely should start sooner or later. thank you for mentioning.

I promise to make a video of what I did for this task as soon as i find some extra time. these days sadly i am in difficult conditions and hope it will be over soon.

It would be great aaron if you share your results with us.

thank you everybody.

jeric_synergy
08-24-2015, 03:03 PM
Much scratching my head here: is Farhad sort of assembling flat plates and BUILDING a new sphere by attaching the plates to animated points? Even then, I don't know how you'd do that without nodes.

MonroePoteet
08-24-2015, 05:41 PM
Based upon the description Farhad posted, I think it's as shown in the attached scene. Pretty cool effect, IMO, and could be enhanced with some work at the procedural displacement, etc.. By having the points displaced through a large world-coordinate procedural, and having the Null target item for the Instance rotation channel orbit about the pivot point, it has some nice flocking characteristics. It's still a "sphere" of sorts rather than independent flock "agents", but still, a nice effect. The instant dissolve from the displaced flock to the fixed sphere between frames 110-111 is a little awkward, but could probably be improved. Good idea, Farhad!

mTp

Farhad_azer
08-25-2015, 12:59 AM
Thank you mTp, actually my approach was a little different than urs but we are in the same track. as I said I have found another solution but it is not perfect yet. as soon as I find a free and decent screen recorder and finish my 3rd solution then I will post my mini tutorial here. so stay tuned plz.

Is it possible to upload a video here bec for some reason I have no utube account and don't like to have it for now.

prometheus
08-25-2015, 01:17 AM
Based upon the description Farhad posted, I think it's as shown in the attached scene. Pretty cool effect, IMO, and could be enhanced with some work at the procedural displacement, etc.. By having the points displaced through a large world-coordinate procedural, and having the Null target item for the Instance rotation channel orbit about the pivot point, it has some nice flocking characteristics. It's still a "sphere" of sorts rather than independent flock "agents", but still, a nice effect. The instant dissolve from the displaced flock to the fixed sphere between frames 110-111 is a little awkward, but could probably be improved. Good idea, Farhad!

mTp

that effect is sort of what I did too and explained too before, though I havenīt checked your scene, will have to do that when I get home...and check differences.

ivanze
08-25-2015, 11:20 AM
If you are making motion graphics in Lightwave, DPKit Part Move is a must. Thanks Denis for that.