@threlte/extras
<Stars>
This component is a port of drei’s <Stars>
component, which adds a blinking shader-based starfield to your scene.
<script lang="ts">
import { Canvas } from '@threlte/core'
import Scene from './Scene.svelte'
</script>
<div>
<Canvas>
<Scene />
</Canvas>
</div>
<style>
div {
height: 100%;
}
</style>
<script lang="ts">
import { T } from '@threlte/core'
import { OrbitControls, Grid, Stars } from '@threlte/extras'
</script>
<Stars />
<T.PerspectiveCamera
makeDefault
position.y={1}
position.z={8}
fov={90}
on:create={({ ref }) => {
ref.lookAt(0, 0, 0)
}}
>
<OrbitControls
enableDamping
enablePan={false}
enableZoom={false}
autoRotate
/>
</T.PerspectiveCamera>
<Grid
sectionThickness={0}
infiniteGrid
cellColor="#dddddd"
cellSize={2}
/>
Examples
Basic Example
Billboard.svelte
<script lang="ts">
import { Stars } from '@threlte/extras'
</script>
<Stars />