Copy and run this:
fetch("https://raw.githubusercontent.com/rexmalebka/hydra-threejs/changes/hack/dist/hydra-three.js").then( x=> x.text() ).then(text=>{
let script = document.createElement("script")
script.innerHTML = text
document.body.appendChild(script)
})
for hydra standalone
- git clone this repo inside
hydra/app/extensions
- add this to
hydra/public/index.html
<script>require("./../app/extensions/hydra-threejs/threejs-embedded/index.js")</script>
-
locate your .atom package directory for
atom-hydra
, in my case~/.atom/packages/atom-hydra
-
on your .atom package directory for
atom-hydra
:
npm install three --save
-
copy
atom/three-js.js
intolib/
-
on
lib/main.js
put this line:
import three from "./three-js.js"
instanciate three js and save this into a variable
t = new three()
the three object has:
t.scene
a threejs scenet.renderer
aTHREE.WebGLRenderer
t.camera
for aTHREE.PerspectiveCamera
t.ambienLight
forTHREE.AmbientLight
t.DracoGLTFLoader
for aDracoGLTFLoader
loader
this library puts THREE
library on global, so you can use it as you want
of course, post them in issues or even better, make a PR :).