Three Vue3Three Vue3
Guide
Demo
AI Agents
  • English
  • 简体中文
GitHub
Guide
Demo
AI Agents
  • English
  • 简体中文
GitHub
    • Getting Started
    • Scene
    • Parameter Bus
    • SkyBox
    • Model Loader

      • Component Loader
      • Function Loader
    • Popup
    • Callout
    • Movable Element
    • Animation
    • Model Rotator
    • Picker
    • Fit Camera
    • Mesh

      • Wave Circle Mesh
      • Flow Line Mesh
    • Effect

      • Nature

        • Rain
        • Snow
        • Water
        • Water Pool
        • Sandy Beach
      • Sky & Atmosphere

        • Sky Dome
        • HeightFog
        • Nebula Galaxy
      • Light

        • Bloom
        • Sweep Light
        • Light Gradient
        • Light Pillar
        • Radar Sweep
        • Signal Wave
          • Default Usage
          • Options
          • Class usage
        • Force Shield
      • Particles & Sprites

        • Fireworks
        • Text Fireworks
        • Glow Sprite
    • GIS

      • Geographic Reference
      • GeoObject
      • GeoJsonLayer
      • Tile Layer

type

Class

SignalWave renders a broadcast ping. A billboarded quad paints one soft-edged arc in the fragment shader; grow the mesh scale while life runs from 0 to 1 and each pulse reads as a signal that spreads outwards and dies away.

In automatic mode, pass travel and the wave animates itself along bearing from origin on its own clock — position, scale, billboard and life are all driven by the same clock. count adds staggered pulses as children, so one object renders a whole stream of pings.

Omit travel for manual mode: position, scale and billboard the quad yourself, then drive life yourself and aim the arc with setDirection() and faceCamera().

Default Usage

Click me to view the codes
<template>
  <tv-scene class="scene" bg-color="rgb(40, 42, 54)" @created="created"></tv-scene>
</template>

<script lang="ts" setup>
import { onBeforeUnmount } from 'vue'
import { SignalWave } from 'three-vue3'

let effect: SignalWave | undefined

const created = (scene, { camera }) => {
  if (!camera) return

  camera.position.set(0, 3.2, 11)
  camera.lookAt(0, 5, 0)

  // `travel` makes the pulses climb the bearing on their own and `count`
  // spreads six of them out in phase; no animation loop required.
  effect = new SignalWave({
    bearing: [0.24, 1, 0],
    travel: 26,
    period: 26 / 7,
    count: 6,
    startScale: 0.45,
    endScale: 3.4
  })
  scene.add(effect)
}

onBeforeUnmount(() => {
  effect?.dispose()
  effect = undefined
})
</script>

<style>
.scene {
  margin-top: 10px;
  margin-bottom: 16px;
  width: 100%;
  height: 300px;
}
</style>

Options

NameTypeDefaultDescription
innerColornumber0x2985ffoptional Color of the arc where it is faint.
outerColornumber0xbdeaffoptional Color of the arc where it is dense.
direction[number, number][1, 0]optional In-plane bearing the arc opens towards.
lifenumber0optional Initial life in the 0-1 range.
bearing[number, number, number][0, 1, 0]optional World-space bearing the pulse travels and the arc opens along. Automatic mode.
origin[number, number, number][0, 0, 0]optional Start point of the travel in world space.
travelnumber—optional World distance covered in one cycle. When set, the wave animates itself.
periodnumber2.4optional Seconds per cycle in automatic mode.
phasenumber0optional Phase offset in the 0-1 range used to stagger pulses.
countnumber1optional Number of staggered pulses created as children.
startScalenumber0.45optional Scale at the start of a cycle.
endScalenumber3.4optional Scale at the end of a cycle.

Class usage

import { SignalWave } from 'three-vue3'

const signal = new SignalWave({
  travel: 26,
  period: 26 / 7,
  count: 6,
  bearing: [0.24, 1, 0]
})
scene.add(signal)

// The pulse travels on its own; dispose it on teardown:
signal.dispose()
Edit this page on GitHub
Last Updated:
Contributors: Shing Rui
Prev
Radar Sweep
Next
Force Shield