View Full Version : Ray Cast Geometry & Flocking: what's this node doing?

06-08-2014, 07:23 PM
Hi all: in the excellent tutorial: http://www.youtube.com/watch?v=biH1f_wALB0

The presenter crafts this network, and inserts the Vector node but never talks about it. The default values of a Vector node are 1/1/1.

I don't understand why the node indicated by the arrow is necessary (it is):

why can't the Ray Cast Geometry node just accept the Agent Info:Position output directly?, and
use its own default 0/-1/0 Ray Direction value ?

to detect the Ground Plane?

Thanks for clarifying this for me.

06-09-2014, 11:00 AM
The ray direction is the direction want the ray to be fired. By default this is 0,-1,0 - or negative Y, which means by default you want it to find the ground object below it. If you want that to be anything else, than you put in another value. So basically - 'fire a ray towards (value) . find intersection point, place object here'. Without checking the video in depth, that's what it'll be for.

Ryan Roye
06-09-2014, 11:52 AM
9 times out of 10, you will never manually enter in the ray direction. You'll usually be plugging the coodinate values derived from an "info" node. If you want to use cameras, lights, and bones as ray origins, you'll probably need the DP kit to do that.

06-09-2014, 11:55 AM
Indeed, but what I'm not getting is: don't the Agent Info nodes give sufficient info to the ray cast geometry (can we start typing "rcg" now?? ;) ) node to do this without the extra plumbing?

Obviously, I'm confused/wrong: but this plumbing seems to be the kind you use to get a vector from one point to another.

Is the maker of that video here on the forum? Or I guess I could ask James W.

06-09-2014, 01:28 PM
Well remember it is ray-casting... it is literally firing a ray from the current position in the direction you specify, to hit a named piece of geometry, and return a value... That value is usually a scalar distance, telling the object how far it needs to go to hit said object...

Ok so object A fires a ray in negative Y (0,-1,0) towards object B... it returns a value (how far it is from B in metres) and then the node translates the object that distance, along that vector, so that it sits on B.

06-09-2014, 02:34 PM
I think one can omit the vector node if one were certain the flock is originally ABOVE the ground plane att all times. In this case he subtracts -1 on the Y axis, wich is the same as adding one unit on the Y axis as the ray's origin. In short: fire the ray downwards from a meter above the flock. Otherwise you might "miss" the ground.