meshcat-dev / meshcat

Remotely-controllable 3D viewer, built on top of three.js
MIT License
256 stars 48 forks source link

NPM build and changing parameters #45

Closed mnovitzky closed 5 years ago

mnovitzky commented 5 years ago

Thank you for such a great tool!

We are trying to increase the draw distance by changing the camera to draw out to 1000 vs the 100: let camera = new THREE.PerspectiveCamera(75, 1, 0.01, 1000)

When I re-run meshcat-python -- the changes do not seem to be taking effect.

How do I compile the changes? Using npm run build.....Thank you.

rdeits commented 5 years ago

You're welcome! To edit the source, you'll need to do the following:

  1. Install yarn
  2. In the meshcat folder, run:
    • yarn
    • npm run build

This should start up a webpack process that will update the bundled javascript code and also watch for any future changes until you kill that process.

A couple of warnings:

  1. It will take several seconds after you make a change for the bundle to be generated (we're bundling up all of three.js, which is a lot of code)
  2. You may need to force your browser to refresh its cache by using shift + F5 or cntrl + shift + R when reloading the page.

Please let me know if that doesn't work.

rdeits commented 5 years ago

I've just added some instructions to the readme as well: https://github.com/rdeits/meshcat/pull/46

mnovitzky commented 5 years ago

Thank you for your quick response and adding text to the readme as well! I have been able to increase the draw distance and compile to see that it works.