force.cursorInView
The cursor on an image relief, applied where each particle appears on screen.
force.cursorInView(
layout: ReliefLayout,
cfg: {perspK: number},
): (homeW: d.v2f, off: d.v2f, z: number) => d.v3f
Import sim from shaders/std and use sim.agentForces.force.cursorInView.
Parameters
| Name | Type | Notes |
|---|---|---|
layout | ReliefLayout | |
cfg | {perspK: number} |
Example
integrator.relief(fieldLayout, {channel: channel.luminance, cursor: force.cursorInView(fieldLayout, {perspK: 0.9}), stiffness: 18, maxSpeed: 4, minAlpha: 0.02, name: 'reliefUpdate'})
See also
integrator.relief— Particles standing on the child's image, rising by a color channel, springing home.channel— Which part of the child's color drives a particle:luminance,luminanceInverted,red,green,blue,saturationoralpha, each a number in 0–1.