---
contentHash: sha256:8ec83e2077dcbe1647dfec427ac7a9db0736de4248926821a80ca2885523b0cd
documentId: guide:for-agents-example-fields
kind: guide
schemaVersion: 1
skenraVersion: 0.1.0-alpha.1
---
# Fields

<a id="overview"></a>

## Overview

Fields are place-anywhere by-id resources that emit a per-point weight — they are masks, not sample positions. Here an animated spherical gradient field weights a point constraint's lift, so clones bulge where the field passes.

Demonstrates: by-id field resource, field-weighted point constraint, field animation.

<a id="scene"></a>

## Scene

```sk
<sk-scene style="width: 100%; height: 420px;">
    <sk-camera-orbit-control fit-targets="auto" fit-margin="0.2"
        azimuth="30deg" elevation="32deg" orient-toward-pivot></sk-camera-orbit-control>
    <sk-perspective-camera focal-length="30"></sk-perspective-camera>
    <sk-directional-light intensity="1" p="70deg" h="30deg"></sk-directional-light>

    <sk-plain-material id="dot-mat" base-color="#7fa8d8"></sk-plain-material>

    <!-- Fields are place-anywhere by-id resources: declare once, reference by
         #id from any consumer. The animation lives inside the field element
         because the field owns the animated x property. -->
    <sk-spherical-gradient-field id="bubble" inner-radius="0.4" outer-radius="2.4">
        <sk-animation duration="4000ms" iterations="Infinity"
            direction="alternate" easing="ease-in-out">
            <sk-keyframe offset="0" x="-2.5"></sk-keyframe>
            <sk-keyframe offset="1" x="2.5"></sk-keyframe>
        </sk-animation>
    </sk-spherical-gradient-field>

    <!-- The constraint weights its per-point deltas by the field's value at
         each point: spheres near the field's center lift, the rest stay. -->
    <sk-cloner>
        <sk-sphere radius="0.22"></sk-sphere>
        <sk-grid-points-source count-x="9" count-y="1" count-z="9"
            spacing-x="0.8" spacing-z="0.8"></sk-grid-points-source>
        <sk-simple-point-constraint field="#bubble" dy="1.4"></sk-simple-point-constraint>
        <sk-surface-paint material="#dot-mat"></sk-surface-paint>
    </sk-cloner>
</sk-scene>
```

---

Related records: [`element:sk-animation`](elements/sk-animation.md), [`element:sk-camera-orbit-control`](elements/sk-camera-orbit-control.md), [`element:sk-cloner`](elements/sk-cloner.md), [`element:sk-directional-light`](elements/sk-directional-light.md), [`element:sk-grid-points-source`](elements/sk-grid-points-source.md), [`element:sk-keyframe`](elements/sk-keyframe.md), [`element:sk-perspective-camera`](elements/sk-perspective-camera.md), [`element:sk-plain-material`](elements/sk-plain-material.md), [`element:sk-scene`](elements/sk-scene.md), [`element:sk-simple-point-constraint`](elements/sk-simple-point-constraint.md), [`element:sk-sphere`](elements/sk-sphere.md), [`element:sk-spherical-gradient-field`](elements/sk-spherical-gradient-field.md), [`element:sk-surface-paint`](elements/sk-surface-paint.md), [`guide:for-agents`](guides/for-agents.md)
