Example files for an A-Frame workshop. View it live here
-
Clone this repository into a project folder on your computer.
-
Install node.js
-
Open a terminal and run the following from the project folder:
npm install
-
Open a terminal and run the following from the project folder:
npm start
or
npm run serve
-
Access http://localhost:3000 or http://YOUR_IP:3000 where
YOUR_IP
is the IP address of your computer on your network. If you're running Windows, check that Windows Firewall is set to allow incoming connections over port 3000 over your network, or you may not be able to access the server from another computer.
Optionally, you can run a local HTTPS server to test WebRTC or native WebVR functionality. These APIs are not usually available for non-secure origins.
-
Run the following command to generate a self-signed SSL cert.
npm run generate-cert
-
Run the following to launch the https server:
npm run serve-https
-
A browser window will automatically launch with the default index page. Optionally, you can access the server via https://localhost:3000 or https://YOUR_IP:3000 where
YOUR_IP
is the IP address of your computer on your network.You may be presented with a warning before viewing the apge. You can safely ignore this.
-
Install Git
-
Install XCode
-
Run the following command from the project folder:
cd bin git clone https://github.com/google/draco.git
-
Follow the build instructions for Draco OR if on OSX follow these instructions:
-
Run the following commands:
cd draco cmake ./ -G Xcode open draco.xcodeproj
-
When XCode opens go to Product -> Build
-
-
Run the following command:
npm run obj2drc -- -i PATH_TO_OBJ -o OUTPUT_PATH
Where
PATH_TO_OBJ
is the path to your obj file to convert, andOUTPUT_PATH
is the path where the converted drc file will be written.
-
Run the following command:
npm run imagemin PATH_TO_IMAGES OUTPUT_PATH
where
PATH_TO_IMAGES
is the path to the image or images you wish to convert e.g.images/*.{jpg,png}
andOUTPUT_PATH
is the output folder you wish to save the converted images to (images will be saved with the same source filenames)
-
Models should be compressed using gzip. Your web server and client should automatically pass and accept the correct headers to decode the gzipped model. Use the following command
gzip PATH_TO_MODEL
This will remove the source model and place a
.gz
file in its place. Reference this compressed.gz
file in your code instead of the original model.