Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cameras

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cameras

Cameras for 3D rendering.

  • 3.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by12.5%
Maintainers
1
Weekly downloads
 
Created
Source

cameras

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Cameras for 3D rendering.

paypal coinbase twitter

Installation

npm install cameras

Usage

See the demo and its source.

import { PerspectiveCamera } from "cameras";

const perspectiveCamera = new PerspectiveCamera({
  fov: Math.PI / 2,
  near: 1,
  far: 1000,
  position: [3, 3, 3],
  target: [0, 1, 0],
});

// Create controls
const perspectiveCameraControls = new Controls({
  element: regl._gl.canvas,
  camera: perspectiveCamera,
});

// Update controls and set camera with controls position/target
perspectiveCameraControls.update();
perspectiveCamera.position = perspectiveCameraControls.position;
perspectiveCamera.target = perspectiveCameraControls.target;

// Update view matrices (call when changing position/target/up)
perspectiveCamera.update();

// Update projection matrix  (call when changing near/far/view and other camera type specific options)
perspectiveCamera.updateProjectionMatrix();

API

See the documentation and Typescript types.

License

MIT. See license file.

Keywords

FAQs

Package last updated on 12 Nov 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc