index
Last updated
Last updated
+ +
Needle Engine provides an easy-to-use web component that can be used to display rich, interactive 3D scenes directly in HTML with just a few lines of code. It's the same web component that powers our integrations.
Once you outgrow the configuration options of the web component, you can extend it with custom scripts and components, and full programmatic scene graph access.
:::tip Use the integrations! For complex 3D scenes and fast iteration, we recommend using Needle Engine with one of our integrations. They provide a powerful creation workflow, including a live preview, hot reloading, and an advanced build pipeline with 3D optimizations. :::
::: code-tabs @tab index.html @
@tab Result
You can add a complete, prebundled version of Needle Engine to your website with just a line of code. This includes our core components, physics, particles, networking, XR, and more. Use this if you're not sure!
If you know your project doesn't require physics features, you can also use a smaller version of Needle Engine, without the physics engine. This will reduce the total downloaded size.
If you want to work with Needle Engine without any integration, then you'll likely want to run a local server for your website. Here's how you can do that with Visual Studio Code:
Open the folder with your HTML file in Visual Studio Code.
Activate live-server (there's a button "Go Live" in the footer of VSCode)
Open http://localhost:5500/index.html
in your web browser, if it doesn't open automatically.
:::
You can work directly with Needle Engine without using any Integration. Needle Engine uses as scene graph and rendering library, so all functionality from three.js is available in Needle as well.
You can install Needle Engine from by running:
npm i @needle-tools/engine
While our default template uses , Needle Engine can also be used directly with vanilla Javascript – without using any bundler.
Many examples can be found on .
For quick experiments, we provide a convenient link to create a new project ready to start: A large collection of examples are also available in our
Install the .
Since Needle Engine uses as scene graph and rendering library, all functionality from three.js is available in Needle as well and can be used from component scripts. We're using a fork of three.js that includes additional features and improvements, especially in relation to WebXR, Animation, and USDZ export.
::: tip
Make sure to update the <needle-engine src="myScene.glb">
path to an existing glb file
or and put it in the same folder as the index.html, name it myScene.glb
or update the src path.
:::
@