Three Vue3Three Vue3
Guide
  • English
  • 简体中文
GitHub
Guide
  • English
  • 简体中文
GitHub
    • Getting Started
    • Scene
      • Default Usage
      • Color As Background
      • Image As Background
      • Props
      • Methods
    • SkyBox
    • Model Loader

      • Component Loader
      • Function Loader
    • Popup
    • Movable Element
    • Animation
    • Mesh

      • Wave Circle Mesh
    • Effect

      • Bloom

type

Component

Default Usage

Click me to view the codes
<template>
  <tv-scene class="scene"></tv-scene>
</template>

<script lang="ts" setup></script>

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

Color As Background

Click me to view the codes
<template>
  <tv-scene class="scene" bg-color="#98F5F9"></tv-scene>
</template>

<script lang="ts" setup></script>

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

Image As Background

Click me to view the codes
<template>
  <tv-scene class="scene" bg-image="/images/examples/bg.jpg"></tv-scene>
</template>

<script lang="ts" setup></script>

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

Props

NameTypeDefaultDescription
v-modelTHREE.SceneTHREE.Sceneoptional The value will be the THREE.Scene instance from undefined after the components mounted.
v-model:rendererTHREE.WebGLRendererTHREE.WebGLRendereroptional
clearColorStringoptional The clear color of the scene.
v-model:cameraTHREE.CameraTHREE.PerspectiveCameraoptional Defaults to a PerspectiveCamera.
v-model:lightTHREE.LightTHREE.HemisphereLightoptional Defaults to a HemisphereLight.
v-model:axesHelperTHREE.AxesHelper | booleanTHREE.AxesHelperoptional Defaults to a AxesHelper, false to hide it.
v-model:controlsOrbitControls | booleanOrbitControlsoptional Defaults to a OrbitControls, false to disable it.

Methods

NameParametersDescription
created(scene, {camera, light, axesHelper, controls }) => voidCalled when the component is mounted and the scene is created.
callbackFrame(renderer: THREE.WebGLRenderer, scene: THREE.Scene, components: {camera, light, axesHelper, controls }) => voidThe callback function of the render loop.
Edit this page on GitHub
Last Updated:
Contributors: Shing, Shing Rui
Prev
Getting Started
Next
SkyBox