Skip to main content

Look at Boundary with Falloff

Overview

Look at Boundary with Falloff allows you to rotate items to look at the nearest Include spline's boundary edge with additional controls to specify a falloff range so that only items within a certain distance of the edge are affected. To use it.

  1. Make sure you use Splines as include areas (can be used in combination with surfaces).

  2. Use the Effects > distanceToEdge parameter to specify the falloff for the look-at effect.

Effect Script

vector v = fpItem.areaIncNearest - fpItem.Position;
fpItem.rotation.z = easein(fpItem.areaIncDistance,DistanceToEdge,0,fpItem.rotation.z, -atan2(v.x, v.y));

You can find this Effect within the Forest Effects Library.

This Effect Uses

Parameters

  • distanceToEdge

    Type: Scene Units

Attributes

  • fpItem.position

    Minimum Z rotation as set in the Transform rollout.

  • fpItem.areaIncNearest

    Position of the nearest point of include areas (splines only)

  • fpItem.areaIncDistance listance to nearest include area

  • fpItem.rotation.z

    Rotation of Forest Item on Z axis in local coordinates.

Functions

  • easeIn(x,x1,x2,y1,y2)

    Returns an ease-in interpolation between y1 and y2. Returns y1 when x < x1.

  • atan2(x,y)

    Returns the principal value of the arc tangent of y/x, expressed in radians