Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
three-orbit-viewer
Advanced tools
Quick harness to create a runnable demo for ThreeJS scenes.
var createOrbitViewer = require('three-orbit-viewer')(THREE)
var app = createOrbitViewer({
clearColor: 0x000000,
clearAlpha: 1.0,
fov: 65,
position: new THREE.Vector3(1, 1, -2)
})
var geo = new THREE.BoxGeometry(1,1,1)
var mat = new THREE.MeshBasicMaterial({ wireframe: true, color: 0xffffff })
var box = new THREE.Mesh(geo, mat)
app.scene.add(box)
app.on('tick', function(dt) {
//.. handle pre-render updates
})
app.on('ready', function() {
//.. handle DOM ready
})
viewer = createViewer(THREE)([options])
This module exports a function which accepts the THREE instance, and returns a new function which creates the orbit viewer with the specified options.
fov
field of view, defaults to 50clearColor
the THREE.Color or hex code, default blackclearAlpha
the alpha, default 0position
THREE.Vector3 for the initial camera position, defaults to [1, 1, -2]target
THREE.Vector3 for the initial orbit controller's targetviewer.on('tick')
Listens for tick events, dispatched with dt
as the first and only parameter.
viewer.on('resize')
Listens for resize events, dispatched with width, height
as parameters. Camera aspect, renderer viewport, and canvas retina scaling is already taken into account.
viewer.renderer
Instance of THREE.WebGLRenderer
viewer.scene
Instance of THREE.Scene
viewer.camera
Instance of THREE.PerspectiveCamera
viewer.controller
Instance of three-orbit-controller.
viewer.engine
Instance of canvas-app which you can call stop()
and start()
on, or access for current width/height/fps/etc.
Because of ThreeJS's versioning, the safest choice is to use --save-exact
when installing this module (no tilde or caret). The minor version should line up with major ThreeJS releases, e.g. 0.69.0
=> r69
. Please submit a PR or issue if you notice any issues going forward.
MIT, see LICENSE.md for details.
FAQs
quick harness for viewing a mesh with orbit viewer
The npm package three-orbit-viewer receives a total of 4,980 weekly downloads. As such, three-orbit-viewer popularity was classified as popular.
We found that three-orbit-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.