How to use @jscad/regl-renderer - 1 common examples

To help you get started, we’ve selected a few @jscad/regl-renderer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jscad / OpenJSCAD.org / packages / web / src / ui / views / viewer.js View on Github external
const html = require('bel')
// viewer data
// const makeCsgViewer = require('@jscad/csg-viewer')
const rendererStuff = require('@jscad/regl-renderer') // replace this with the correct import
const { prepareRender, drawCommands, cameras, entitiesFromSolids } = rendererStuff
const perspectiveCamera = cameras.perspective
const orbitControls = rendererStuff.controls.orbit

// params
const rotateSpeed = 0.002
const zoomSpeed = 0.08
const panSpeed = 1

// internal state
let initialized = false
let render
let viewerOptions
let camera = perspectiveCamera.defaults
let controls = orbitControls.defaults

let grid = { // grid data
  // the choice of what draw command to use is also data based
  visuals: {

@jscad/regl-renderer

Renderer for JSCAD Geometries

MIT
Latest version published 1 month ago

Package Health Score

90 / 100
Full package analysis

Popular @jscad/regl-renderer functions