Skip to content

Commit a0b1555

Browse files
committed
introduction
1 parent 58ca1a0 commit a0b1555

File tree

10 files changed

+73
-108
lines changed

10 files changed

+73
-108
lines changed

docs/getting-started/introduction.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Introduction
3+
description: Useful helpers for react-three-fiber
4+
nav: 0
5+
---
6+
7+
[![logo](../logo.jpg)](https://codesandbox.io/s/bfplr)
8+
9+
[![Version](https://img.shields.io/npm/v/@react-three/drei?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/@react-three/drei)
10+
[![Downloads](https://img.shields.io/npm/dt/@react-three/drei.svg?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/@react-three/drei)
11+
[![Discord Shield](https://img.shields.io/discord/740090768164651008?style=flat&colorA=000000&colorB=000000&label=discord&logo=discord&logoColor=ffffff)](https://discord.com/channels/740090768164651008/741751532592038022)
12+
[![Open in GitHub Codespaces](https://img.shields.io/static/v1?&message=Open%20in%20%20Codespaces&style=flat&colorA=000000&colorB=000000&label=GitHub&logo=github&logoColor=ffffff)](https://github.com/codespaces/new?template_repository=pmndrs%2Fdrei)
13+
14+
A growing collection of useful helpers and fully functional, ready-made abstractions for [@react-three/fiber](https://github.com/pmndrs/react-three-fiber). If you make a component that is generic enough to be useful to others, think about [CONTRIBUTING](CONTRIBUTING.md)!
15+
16+
```bash
17+
npm install @react-three/drei
18+
```
19+
20+
> [!IMPORTANT]
21+
> this package is using the stand-alone [`three-stdlib`](https://github.com/pmndrs/three-stdlib) instead of [`three/examples/jsm`](https://github.com/mrdoob/three.js/tree/master/examples/jsm).
22+
23+
## Basic usage
24+
25+
```jsx
26+
import { PerspectiveCamera, PositionalAudio, ... } from '@react-three/drei'
27+
```
28+
29+
## React-native
30+
31+
```jsx
32+
import { PerspectiveCamera, PositionalAudio, ... } from '@react-three/drei/native'
33+
```
34+
35+
The `native` route of the library **does not** export `Html` or `Loader`. The default export of the library is `web` which **does** export `Html` and `Loader`.

logo.jpg renamed to docs/logo.jpg

File renamed without changes.

docs/misc/face-landmarker.mdx

Lines changed: 38 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,47 @@
11
---
22
title: FaceLandmarker
3-
nav: 0
43
---
54

65
![](https://img.shields.io/badge/-suspense-brightgreen)
76

8-
A @mediapipe/tasks-vision [](https://developers.google.com/mediapipe/api/solutions/js/tasks-vision.facelandmarker) provider, as well as a hook.
7+
A @mediapipe/tasks-vision [`FaceLandmarker`](https://developers.google.com/mediapipe/api/solutions/js/tasks-vision.facelandmarker) provider, as well as a `useFaceLandmarker` hook.
98

10-
It will instanciate a FaceLandmarker object with the following defaults:
11-
12-
You can override defaults, like for example self-host tasks-vision's and model in you directory:
13-
14-
Version: ImageMagick 7.1.1-36 Q16-HDRI aarch64 22352 https://imagemagick.org
15-
Copyright: (C) 1999 ImageMagick Studio LLC
16-
License: https://imagemagick.org/script/license.php
17-
Features: Cipher DPC HDRI Modules OpenMP(5.0)
18-
Delegates (built-in): bzlib fontconfig freetype gslib heic jng jp2 jpeg jxl lcms lqr ltdl lzma openexr png ps raw tiff webp xml zlib zstd
19-
Compiler: gcc (4.2)
20-
Usage: import [options ...] [ file ]
9+
```tsx
10+
<FaceLandmarker>{/* ... */}</FaceLandmarker>
11+
```
2112

22-
Image Settings:
23-
-adjoin join images into a single multi-image file
24-
-border include window border in the output image
25-
-channel type apply option to select image channels
26-
-colorspace type alternate image colorspace
27-
-comment string annotate image with comment
28-
-compress type type of pixel compression when writing the image
29-
-define format:option
30-
define one or more image format options
31-
-density geometry horizontal and vertical density of the image
32-
-depth value image depth
33-
-descend obtain image by descending window hierarchy
34-
-display server X server to contact
35-
-dispose method layer disposal method
36-
-dither method apply error diffusion to image
37-
-delay value display the next image after pausing
38-
-encipher filename convert plain pixels to cipher pixels
39-
-endian type endianness (MSB or LSB) of the image
40-
-encoding type text encoding type
41-
-filter type use this filter when resizing an image
42-
-format "string" output formatted image characteristics
43-
-frame include window manager frame
44-
-gravity direction which direction to gravitate towards
45-
-identify identify the format and characteristics of the image
46-
-interlace type None, Line, Plane, or Partition
47-
-interpolate method pixel color interpolation method
48-
-label string assign a label to an image
49-
-limit type value Area, Disk, Map, or Memory resource limit
50-
-monitor monitor progress
51-
-page geometry size and location of an image canvas
52-
-pause seconds seconds delay between snapshots
53-
-pointsize value font point size
54-
-quality value JPEG/MIFF/PNG compression level
55-
-quiet suppress all warning messages
56-
-regard-warnings pay attention to warning messages
57-
-repage geometry size and location of an image canvas
58-
-respect-parentheses settings remain in effect until parenthesis boundary
59-
-sampling-factor geometry
60-
horizontal and vertical sampling factor
61-
-scene value image scene number
62-
-screen select image from root window
63-
-seed value seed a new sequence of pseudo-random numbers
64-
-set property value set an image property
65-
-silent operate silently, i.e. don't ring any bells
66-
-snaps value number of screen snapshots
67-
-support factor resize support: > 1.0 is blurry, < 1.0 is sharp
68-
-synchronize synchronize image to storage device
69-
-taint declare the image as modified
70-
-transparent-color color
71-
transparent color
72-
-treedepth value color tree depth
73-
-verbose print detailed information about the image
74-
-virtual-pixel method
75-
Constant, Edge, Mirror, or Tile
76-
-window id select window with this id or name
77-
root selects whole screen
78-
79-
Image Operators:
80-
-annotate geometry text
81-
annotate the image with text
82-
-colors value preferred number of colors in the image
83-
-crop geometry preferred size and location of the cropped image
84-
-encipher filename convert plain pixels to cipher pixels
85-
-extent geometry set the image size
86-
-geometry geometry preferred size or location of the image
87-
-help print program options
88-
-monochrome transform image to black and white
89-
-negate replace every pixel with its complementary color
90-
-quantize colorspace reduce colors in this colorspace
91-
-resize geometry resize the image
92-
-rotate degrees apply Paeth rotation to the image
93-
-strip strip image of all profiles and comments
94-
-thumbnail geometry create a thumbnail of the image
95-
-transparent color make this color transparent within the image
96-
-trim trim image edges
97-
-type type image type
98-
99-
Miscellaneous Options:
100-
-debug events display copious debugging information
101-
-help print program options
102-
-list type print a list of supported option arguments
103-
-log format format of debugging information
104-
-version print version information
13+
It will instanciate a FaceLandmarker object with the following defaults:
10514

106-
By default, 'file' is written in the MIFF image format. To
107-
specify a particular image format, precede the filename with an image
108-
format name and a colon (i.e. ps:image) or specify the image type as
109-
the filename suffix (i.e. image.ps). Specify 'file' as '-' for
110-
standard input or output.
15+
```tsx
16+
{
17+
basePath: "https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/wasm", // x.y.z will value the @mediapipe/tasks-vision version, eg: 0.10.2
18+
options: {
19+
baseOptions: {
20+
modelAssetPath: "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",
21+
delegate: "GPU",
22+
},
23+
runningMode: "VIDEO",
24+
outputFaceBlendshapes: true,
25+
outputFacialTransformationMatrixes: true,
26+
}
27+
}
28+
```
29+
30+
You can override defaults, like for example self-host tasks-vision's `wasm/` and `face_landmarker.task` model in you `public/` directory:
31+
32+
```sh
33+
$ ln -s ../node_modules/@mediapipe/tasks-vision/wasm/ public/tasks-vision-wasm
34+
$ curl https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task -o public/face_landmarker.task
35+
```
36+
37+
```tsx
38+
import { FaceLandmarkerDefaults } from '@react-three/drei'
39+
40+
const visionBasePath = new URL("/tasks-vision-wasm", import.meta.url).toString()
41+
const modelAssetPath = new URL("/face_landmarker.task", import.meta.url).toString()
42+
43+
const faceLandmarkerOptions = { ...FaceLandmarkerDefaults.options };
44+
faceLandmarkerOptions.baseOptions.modelAssetPath = modelAssetPath;
45+
46+
<FaceLandmarker basePath={visionBasePath} options={faceLandmarkerOptions}>
47+
```

docs/portals/fisheye.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Fisheye
3-
nav: 0
43
---
54

65
<Grid cols={4}>

docs/portals/hud.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Hud
3-
nav: 0
43
---
54

65
<Grid cols={4}>

docs/portals/mask.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Mask
3-
nav: 0
43
---
54

65
<Grid cols={4}>

docs/portals/mesh-portal-material.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: MeshPortalMaterial
3-
nav: 0
43
---
54

65
<Grid cols={4}>

docs/portals/render-cube-texture.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: RenderCubeTexture
3-
nav: 0
43
---
54

65
This component allows you to render a live scene into a cubetexture which you can then apply to a material, for instance as an environment map (via the envMap property). The contents of it run inside a portal and are separate from the rest of the canvas, therefore you can have events in there, environment maps, etc.

docs/portals/render-texture.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: RenderTexture
3-
nav: 0
43
---
54

65
<Grid cols={4}>

docs/portals/view.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: View
3-
nav: 0
43
---
54

65
<Grid cols={4}>

0 commit comments

Comments
 (0)