Skip to content

rexmalebka/hydra-threejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hydra example for three js mesh texture

hydra hack for flok, etc

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)
})

Hydra standalone

for hydra standalone

  • git clone this repo inside hydra/app/extensions

git clone https://github.com/rexmalebka/hydra-threejs

  • add this to hydra/public/index.html
 <script>require("./../app/extensions/hydra-threejs/threejs-embedded/index.js")</script>

Hydra for atom package

  • 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 into lib/

  • on lib/main.js put this line:

import three from "./three-js.js"

Docs

instanciate three js and save this into a variable

t = new three()

the three object has:

  • t.scene a threejs scene
  • t.renderer a THREE.WebGLRenderer
  • t.camera for a THREE.PerspectiveCamera
  • t.ambienLight for THREE.AmbientLight
  • t.DracoGLTFLoader for a DracoGLTFLoader loader

this library puts THREE library on global, so you can use it as you want

three js docs

issues

of course, post them in issues or even better, make a PR :).

About

hydra example for three js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published