Skip to content

surface3dviewer_react18 1.0.18

Install from the command line:
Learn more about npm packages
$ npm install @equinor/surface3dviewer_react18@1.0.18
Install via package.json:
"@equinor/surface3dviewer_react18": "1.0.18"

About this version

surface-3d-viewer

3D surface viewer basedupon three & fiber

NPM JavaScript Style Guide

Install

npm install --save surface3dviewer

Usage

import React from 'react'

import { Canvas, useLoader } from '@react-three/fiber'
import { Object3D, Vector3, TextureLoader } from "three";

import { Grid, Surface } from 'surface3dviewer'

Object3D.DefaultUp.set(0, 0, 1);

const scale = new Vector3(1, 1, 1)
const domains = {x: [0, 1], y: [0, 1], z: [0, 1]}

const SurfaceContainer = () => {

    const [map, depth] = useLoader(TextureLoader, ['./sinc.png', './sinc_gray.png'] )

    return <Suspense fallback={null}>
        <Grid scale={scale} domains={domains} ticks={15} />
        <Surface map={map} depth={depth} scale={scale} />
    </Suspense>
}

const App = ({scale, ticks, domains}: any) => {

    return <Canvas frameloop="demand" linear flat >
        <SurfaceContainer />
    </Canvas>

Example

Github Pages

Details


Assets

  • surface3dviewer_react18-1.0.18.tgz

Download activity

  • Total downloads 2
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all