-
Notifications
You must be signed in to change notification settings - Fork 55
McDisplay WebGL: Development, debugging and deployment
Theodor Guttesen edited this page Jul 4, 2024
·
5 revisions
The following is about the React + ThreeJS based solution for visualising instruments.
Open McCode/tools/Python/mcdisplay/webgl in an IDE, VSCode is recommended.
You can test webgl without going through mcgui(saving time) by doing the following:
- You will need instrument.json and particles.json, get these by using mcgui to run the trace for the instrument and find them in the directory you used. Then copy instrument.json and particles.json into McCode/tools/Python/mcdisplay/webgl. Do not commit instrument.json and particles.json.
- To run code use the command "npm run dev" in the terminal. This will open a localhost in the browser, use developer tools for debugging.
- Run the command "npm run build" this generates the "dist" directory, that contains "index.html" and a directory "assets" that holds minified js and css files. Commit dist.
- Run the command "npm install" in the terminal, this will update and download the dependencies specified in package.json, by generating the "node_modules" directory. Commit node_modules. Committing node_modules is unconventional, but is necessary here to ensure that trace can be run without internet access.