PDA

View Full Version : Flocking in 11.6, no RayCaster?



raw-m
09-09-2013, 06:46 AM
Got an object in 11.5.1 but it's crash city whenever I add Object Properties/Custom Object/Raycaster, so thought I'd try it in 11.6.

I'm trying to get some Flocking to stick to geometry. Looking at the 11.6 addendum (p85) there's a screen grab on the RayCaster in the drop down. I don't have it here on the Mac version. I know theres new Raycasting functions in 11.6 but not sure if theres a new approach to applying to surfaces with Flocking. Anyone tried it?

jameswillmott
09-09-2013, 07:19 AM
Got an object in 11.5.1 but it's crash city whenever I add Object Properties/Custom Object/Raycaster, so thought I'd try it in 11.6.

I'm trying to get some Flocking to stick to geometry. Looking at the 11.6 addendum (p85) there's a screen grab on the RayCaster in the drop down. I don't have it here on the Mac version. I know theres new Raycasting functions in 11.6 but not sure if theres a new approach to applying to surfaces with Flocking. Anyone tried it?

Use the new Raycast node, it replaces the Flocking one and should behave the same way in order to push agents onto geometry...

raw-m
09-09-2013, 07:46 AM
Thanks James.

Just to be clear, all I really need in 11.6 is a Flock generator in my Flock_Master window and nothing else, as by surface planes are all added in the Ray Cast Geometry node?

If I want the flock to stick to a wall (as opposed to a ground), would I feed a Vector constant (set to 0,0,1) into the Ray Direction? Not having much joy at the moment!

jameswillmott
09-09-2013, 04:04 PM
Thanks James.

Just to be clear, all I really need in 11.6 is a Flock generator in my Flock_Master window and nothing else, as by surface planes are all added in the Ray Cast Geometry node?

Yes.



If I want the flock to stick to a wall (as opposed to a ground), would I feed a Vector constant (set to 0,0,1) into the Ray Direction? Not having much joy at the moment!

Yes that's right, what is it that they are doing wrong?

raw-m
09-10-2013, 03:39 AM
After hitting the Calculate button, after a couple of frames the particles all jump to 0 co-ords. If I tick the Multithread button I get a slightly different behaviour in that half the particles stay where they are and the other half jump to 0 co-ords. It's almost like the Ray Cast Geometry in Flocking is having no effect, nothing I select or patch seems to have an effect (mac 10.8.4/LW11.6 August version).

jameswillmott
09-10-2013, 05:14 AM
Can you send the scene to FogBugz please?

- - - Updated - - -

Can you send the scene to FogBugz please?

Ivan_B
09-10-2013, 05:16 AM
Hi James,

Could you please explain how it is you setup the raycast node (an updated video for 11.6 would be nice)...Is it on the flock itself or the terrain whats looking at what?. I tried a whole heap of ways and couldn't get it to work.

I imagine the raycast node is setup and enabled via the flocking master panel to see the terrain...I know Im missing something.

Ivan.

raw-m
09-10-2013, 05:57 AM
Hope you don't mind, thought I'd post it here first in case I'm doing something daft!

Just to note, first time I open up LW and Calculate Flocks, particles all zoom to the origin of the object. Second time I Calculate Flock without changing anything, particles zoom to 0 co-ords in World space.

jameswillmott
09-10-2013, 06:16 AM
Hi James,

Could you please explain how it is you setup the raycast node (an updated video for 11.6 would be nice)...Is it on the flock itself or the terrain whats looking at what?. I tried a whole heap of ways and couldn't get it to work.

I imagine the raycast node is setup and enabled via the flocking master panel to see the terrain...I know Im missing something.

Ivan.

That should be right, you set it all up in the flocking panel, and select the object you want to 'see' from the raycast node interface.

jameswillmott
09-10-2013, 08:38 AM
Ah, I see. What's happening is that the ray origin for the raycast node is 0,0,0, you need to supply the location of the agent in question to raycast from the proper place, using the Agent Info node. Proper node flow is attached. It's a little awkward, sorry.

Sensei
09-10-2013, 09:17 AM
James, update RayCast/RayTrace nodes with Offset input parameter that will be doing origin-direction*offset automatically.

Ivan_B
09-10-2013, 06:19 PM
Thank you for the node setup!...There is NO way I would have figured that out :(

Its working perfectly now!!

Is there a way to add to the node setup so the agents pitch & bank rotation is also effected..flocking takes care of the heading?

stib
09-10-2013, 08:09 PM
This setup doesn't work for me. I have a ground plane as my ray cast object and the particles not only don't stick, they shoot straight through it.

117017

The vector constant is [0,-1,0], pointing straight down.

jameswillmott
09-10-2013, 08:19 PM
Thank you for the node setup!...There is NO way I would have figured that out :(

Its working perfectly now!!

Is there a way to add to the node setup so the agents pitch & bank rotation is also effected..flocking takes care of the heading?

Yes, but it's non-intuitive involving some vector math to get exactly what you want. I can post it here but it's not pleasant, we're looking at ways of nice-ifying it.

raw-m
09-11-2013, 01:17 AM
Thanks James. I wouldn't have figured it out, either. Think the docs need updating (although I'm sure you already have :D).

Ivan_B
09-11-2013, 11:47 PM
Thanks James...No need to post that, proly wouldn't understand it any way...I'll just wait for the magic "conform to ground node" lol! Is there a "nodes for idiots" guide, I could use it. :(

Stib: Its a bit hit and miss, try placing the generator at the edge of the ground plane and down slightly (I know it needs to be above the ground) but it works for me if the agents need to move up to the ground. I wish they kept the 11.5 setup, just seemed so easy compared to this.

Ivan_B
09-12-2013, 12:00 AM
Hey Stib...I checked your scene, and it works fine.

I also noticed the -1 for the Y vector, whereas mine is set to 1, that's proly why mine wants to jump up.

Your also right about the second calculation...it does go silly and merges to the origin (0,0,0).


117066

stib
09-13-2013, 01:26 AM
maybe it's a mac thing..?
Edit: No, maybe it's just a "Lightwave didn't feel like playing nice thing". Because now it works.

O.K. Now how do I get the particles to stick to say, a sphere? I need some flocks of fish swimming on a globe. I tried using the DPKit "align to" node for the ray direction, but nothing. I'd be happy with the rays just pointing at the origin, but my vector maths is too fuzzy to get that to work.

Ivan_B
11-01-2013, 02:06 AM
Just Updated to the final release of 11.6, tried this out again and it still doesn't work...flock merges to one point and thats it :(