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
          • Default Usage
          • Options
          • Methods
          • Class usage
        • Radar Sweep
        • Signal Wave
        • Force Shield
      • Particles & Sprites

        • Fireworks
        • Text Fireworks
        • Glow Sprite
    • GIS

      • Geographic Reference
      • GeoObject
      • GeoJsonLayer
      • Tile Layer

type

Class

A conical light pillar built from a translucent outer cone, a brighter inner core, a breathing glow at the tip and two pulse rings diffusing on the ground. It is commonly used as a data marker: map a normalized value to the height option so taller pillars mean larger values. The breathing glow and the pulse rings run from the pillar's own animation loop.

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 { LightPillar } from 'three-vue3'

const pillars: LightPillar[] = []

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

  camera.position.set(0, 2.4, 6)
  camera.lookAt(0, 1, 0)

  const data: Array<{ x: number; z: number; value: number; color: number }> = [
    { x: -2.2, z: 0, value: 0.35, color: 0x00ffff },
    { x: 0, z: -0.6, value: 1, color: 0x36e0a0 },
    { x: 2.2, z: 0, value: 0.62, color: 0xffb347 }
  ]

  data.forEach(({ x, z, value, color }) => {
    const pillar = new LightPillar({
      color,
      // Map a normalized data value to the pillar height
      height: 1 + value * 2.4,
      radius: 0.22
    })
    pillar.position.set(x, 0, z)
    scene.add(pillar)
    pillars.push(pillar)
  })
}

onBeforeUnmount(() => {
  pillars.forEach((pillar) => pillar.dispose())
  pillars.length = 0
})
</script>

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

Options

NameTypeDefaultDescription
colornumber0x00ffffoptional Pillar color.
heightnumber3optional Pillar height along the Y axis, the base sits on y = 0.
radiusnumber0.3optional Radius of the cone base.
opacitynumber1optional Global opacity multiplier (0-1).
speednumber1optional Animation speed multiplier.
segmentsnumber32optional Radial segment count of the cones and rings.
glowbooleantrueoptional Render the breathing glow at the top of the pillar.
ringbooleantrueoptional Render the two diffusing pulse rings at the base.
ringRadiusnumberradius * 3optional Outer radius the pulse rings expand to.

Methods

NameParametersDescription
constructor(options?: LightPillarOptions)Create a light pillar. It extends THREE.Group, so add it to the scene and move it with position.
dispose() => voidDispose the pillar and remove it from the scene.

Class usage

import { LightPillar } from 'three-vue3'

const pillar = new LightPillar({ color: 0x36e0a0, height: 3, radius: 0.22 })
pillar.position.set(0, 0, 0)
scene.add(pillar)

// The glow and rings run from the pillar's own animation loop; on teardown:
pillar.dispose()
Edit this page on GitHub
Last Updated:
Contributors: Shing Rui
Prev
Light Gradient
Next
Radar Sweep