naver / egjs-view3d

Fast & customizable 3D model viewer for everyone
https://naver.github.io/egjs-view3d
MIT License
180 stars 26 forks source link

How to access THREE(three.js instance)? #64

Open hxgqh opened 1 year ago

hxgqh commented 1 year ago

Description

Is it possible to write three.js code with view3d?

WoodNeck commented 1 year ago

Hello @hxgqh, we don't export internal three.js at the moment, as it can increase the bundle size. You can import and use the three.js normally as it's a dependency of View3D, but in some environments, it can throw error when if you don't explicitly define it as a dependency of your project.

As we're using three@~0.134 as our dependency, you can try installing the exact same version and use it.

npm i --save three@~0.134
import * as THREE from "three";