surface3dviewer_react18
/
1.0.18
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
3D surface viewer basedupon three & fiber
npm install --save surface3dviewer
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>
Details
- surface3dviewer_react18
- equinor
- about 2 years ago
- MIT
- 33 dependencies
Assets
- surface3dviewer_react18-1.0.18.tgz
Download activity
- Total downloads 2
- Last 30 days 0
- Last week 0
- Today 0