canvas

Fluid Simulation

A physics-based fluid simulation with pointer interaction.


Installation

Install the component

Run the following command to install the component and its dependencies:
npx @motion-core/cli add fluid-simulation

Import the component

Import the component into your Svelte file:
import { FluidSimulation } from "$lib/motion-core";
import { FluidSimulation } from "$lib/motion-core";

Usage

<script lang="ts">
	import { FluidSimulation } from "motion-core";
</script>

<FluidSimulation class="h-full min-h-96 w-full" />

Props

FluidSimulation

PropTypeDefault
dissipation
number 0.96
pointerSize
number 0.005
color
THREE.ColorRepresentation "#ff6900"
velocityDissipation
number 0.96
pressureIterations
number 10
class
string ""