---
title: "Make three.js fire and smoke sprites face the camera"
description: "Point three.js fire and smoke at the camera: THREE.Sprite turns to face it for you, and a Y-axis billboard keeps side-on flames upright from above."
canonical: https://appliedmanifold.com/guides/threejs-sprites-face-camera/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Guides](https://appliedmanifold.com/guides/)
3.  Sprites that face the camera

GUIDE // THREE.JS

# How to orient three.js fire and smoke sprites toward the camera

Use THREE.Sprite with a SpriteMaterial, and three.js turns the quad to face the camera on every render with no code from you. For fire and smoke filmed from the side, a plane that turns only around its vertical axis often looks better, because it keeps the flames upright when the camera looks down from above.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [See the examples →](https://appliedmanifold.com/docs/pyrofx/examples/)

-   Godot 4 Available
-   Unity Manual setup
-   Unreal Engine Manual setup
-   Roblox Studio Manual setup
-   **three.js** Available

A draft compile is from $0.05, and new accounts start with $5 of usage.

**FIREFINAL**

![First frame of the fire bake](/bakes/fire/poster.webp)

Fire, 4.1 x 7.0 m, compiled with Spatial Compiler. [Spec →](https://appliedmanifold.com/docs/pyrofx/examples/#ex-fire)

01 // THE OPTIONS

## Two ways to face the camera

-   `THREE.Sprite`: always square to the camera, from any angle. Rotate it in its own plane with `material.rotation`, and move its pivot with `sprite.center`, for example `sprite.center.set(0.5, 0)` to stand it on its bottom edge.
-   A plane mesh turned around the Y axis only (a cylindrical billboard) stays upright while it swivels toward the camera. It suits the side-on sheets from Spatial Compiler, whose camera is orthographic and level by default.

02 // HOW TO

## Keep a fire upright from any angle

1.  Make a `PlaneGeometry` the size of one frame and move it up by half its height with `geometry.translate`, so its origin sits on the ground.
2.  Give it your flipbook material and add it to the scene at the fire's base.
3.  Each tick, before rendering, call `faceCameraUpright` so the plane swivels toward the camera around Y.

faceCamera.js

```
const geometry = new THREE.PlaneGeometry(4, 4);
geometry.translate(0, 2, 0); // origin at the bottom edge
const fire = new THREE.Mesh(geometry, fireMaterial);
scene.add(fire);

function faceCameraUpright(mesh, camera) {
  const dx = camera.position.x - mesh.position.x;
  const dz = camera.position.z - mesh.position.z;
  mesh.rotation.set(0, Math.atan2(dx, dz), 0);
}
```

03 // REAL OUTPUT

## Smoke from the side

The smoke plume leans with the wind. A Y-axis billboard keeps that lean pointing the same way however the camera circles.

**SMOKE\_PLUMEFINAL**

![First frame of the smoke\_plume bake](/bakes/smoke_plume/poster.webp)

Smoke plume, 7.0 x 10.8 m, compiled with Spatial Compiler. [Spec →](https://appliedmanifold.com/docs/pyrofx/examples/#ex-smoke_plume)

04 // SIZE

## Match the frame's shape

Scale the sprite or plane in the same ratio as one frame of the sheet, or the fire stretches. Every tile from Spatial Compiler is square and framed to fit the whole clip, so x and y scale stay equal, set from `metres_per_tile` in `layout.json`.

Godot 4 gets a ready scene that relights the smoke. three.js uses the documented snippet. A native six-way material is not built yet.

05 // RELATED

## Related pages

-   [Particles facing the camera Godot 4Pick the right billboard mode in Godot 4 so particle quads face the camera, stay upright or lie on the ground.](https://appliedmanifold.com/guides/godot-billboard-particles/)
-   [Loop a flipbook in Unity UnityKeep a fire or smoke flipbook looping in a Unity Particle System by matching particle lifetime to whole cycles of the clip.](https://appliedmanifold.com/guides/unity-loop-flipbook/)
-   [Additive fire three.jsMake a three.js fire flipbook glow with additive blending and a ShaderMaterial that decodes flame color and brightness.](https://appliedmanifold.com/guides/threejs-additive-fire/)
-   [three.js fire three.jsA looping fire, from a burning wreck to a fire whirl or a window fire, played in three.js with a documented snippet.](https://appliedmanifold.com/effects/threejs-fire/)
-   [three.js VFX three.jsFire, smoke, explosion and dust effects in three.js: sprite sheets you play with a documented snippet, next to Godot 4's ready scene.](https://appliedmanifold.com/effects/threejs-vfx/)
-   [Billboard particlesBillboard particles are flat quads that turn toward your camera, so a flipbook frame of fire or smoke looks solid from any angle.](https://appliedmanifold.com/learn/billboard-particles/)
-   [OutputsWith the default export, each view writes four sheets, `<view>_pos.png`, `_neg.png`, `_colour.png` and `_aux.png`, plus `layout.json`, two still previews, the animated `preview_anim.png` and `bake_report.json`. Sheets are 8 x 8 tiles of 256 px by default.](https://appliedmanifold.com/docs/pyrofx/outputs/)

[All pages in Guides →](https://appliedmanifold.com/guides/)

[← Smoke blending](https://appliedmanifold.com/guides/threejs-smoke-blending/)[Frames for fire →](https://appliedmanifold.com/guides/frames-for-fire-effect/)

06 // FAQ

## three.js camera-facing sprite questions

[All questions →](https://appliedmanifold.com/faq/)

**README.THREEJS\_SPRITES\_FACE\_CAMERA**

### How do I keep an impact effect in proportion in three.js?

Keep the Sprite square because every tile is square. Set sprite.scale.set(s, s, 1) using the meters per tile from layout.json.

### Does three.js support sprite sheets?

Yes, through `texture.repeat` and `texture.offset`, which crop a texture to one cell. Nothing built in animates it, so your code updates the offset each tick.

### How do I prevent texture bleeding between adjacent frames in a three.js sprite sheet?

Leave transparent padding around each frame or disable mipmaps with `texture.generateMipmaps = false` and `texture.minFilter = THREE.LinearFilter` so small sprites do not average neighboring cells.

### How do I orient three.js fire and smoke sprites toward the camera?

Use THREE.Sprite with SpriteMaterial to face the camera automatically or rotate a plane mesh around its Y axis toward the camera each frame.

## Compile your first effect

You pay per compile and see the price before it runs. New accounts start with $5 of usage.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [Outputs →](https://appliedmanifold.com/docs/pyrofx/outputs/)

[All effects, guides and explainers →](https://appliedmanifold.com/effects/)
