Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A growing collection of useful helpers and abstractions for react-three-fiber, saving you some boilerplate.
If you find yourself repeating set-up code often and if it's generic enough, add it here, everyone benefits!
yarn add drei
import { ... } from 'drei'
<PerspectiveCamera />
<OrbitControls />
<MapControls />
<TrackballControls />
<TransformControls />
<Detailed />
<PositionalAudio />
<StandardEffects />
<Sky />
<HTML />
<Stats />
draco()
<PerspectiveCamera />
A responsive, perspective camera that sets itself as the default. Can take children, which from then on move along.
<PerspectiveCamera
makeDefault // Registers it as the default camera system-wide (default=true)
{...props} // All THREE.PerspectiveCamera props are valid
>
<mesh />
</PerspectiveCamera>
If available controls have damping enabled by default, they manage their own updates, remove themselves on unmount, are compatible with the invalidateFrameloop
canvas-flag. They inherit all props from their underlying THREE controls.
<OrbitControls />
<MapControls />
<TrackballControls />
<TransformControls />
<Detailed
> A wrapper around THREE.LOD (Level of detail).
<Detailed
distances={[0, 10, 20]} // Camera distances, correspends to the # of the children
{...props} // All THREE.LOD props are valid
>
<mesh geometry={highDetail} />
<mesh geometry={mediumDetail} />
<mesh geometry={lowDetail} />
</Detailed>
<PositionalAudio />
A wrapper around THREE.PositionalAudio. Add this to groups or meshes to tie them to a sound that plays when the camera comes near.
<mesh>
<PositionalAudio
url="/sound.mp3" // Url of the sound file
distance={1} // Camera distance (default=1)
loop // Repat play (default=true)
{...props} // All THREE.PositionalAudio props are valid
/>
</mesh>
<StandardEffects />
Adds ambient-occlusion, bloom and SMAA using the postprocessing library.
<StandardEffects
smaa // Can be a boolean (default=true)
ao // Can be a boolean or all valid postprocessing AO props (default=true)
bloom // Can be a boolean or all valid postprocessing Bloom props (default=true)
edgeDetection = 0.1 // Optional, SMAA precision
bloomOpacity = 1 // Optional, Bloom blendMode opacity
effects // Optional, define your own effect: ([smaa, ao, bloom]) => [...effects]
/>
<Sky />
From: https://threejs.org/examples/webgl_shaders_sky.html
<Sky
distance={450000} // Camera distance (default=450000)
sunPosition={[0, 1, 0]} // Sun position normal (default=[0, 1, 0])
{...props} // All three/examples/jsm/objects/Sky props are valid
/>
<HTML />
Allows you to tie HTML content to any object of your scene. It will be projected to the objects whereabouts automatically.
<HTML
prepend = false // Will be projected in front of the canvas
center = false // Adds a -50%/-50% css transform
scaleFactor // Optional, scales children if set to a number (default=undefined)
zIndexRange // Optional, handles z-order (default=[16777271, 0])
portal // Optional reference to target container
{...groupProps} // All THREE.Group props are valid
{...divProps} // All HTMLDivElement props are valid
>
<h1>hello</h1>
<p>world</p>
</HTML>
<Stats />
Adds stats to document.body. It takes over the render-loop!
<Stats
showPanel={0} // Start-up panel (default=0)
{...props} // All stats.js props are valid
/>
draco()
Adds the Draco extension to your GLTFLoader.
useLoader(
GLTFLoader,
url,
draco(binUrl) // default='/draco-gtltf/'
)
FAQs
useful add-ons for react-three-fiber
The npm package drei receives a total of 1,454 weekly downloads. As such, drei popularity was classified as popular.
We found that drei demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.