Utilities for converting model files to the Three.js JSON format. It's necessary to install the esm npm package before you can use the converters.
Usage:
node -r esm obj2three.js model.obj
| Graphics Feature Status | |
| Canvas: Hardware accelerated | |
| Canvas out-of-process rasterization: Disabled | |
| Direct Rendering Display Compositor: Disabled | |
| Compositing: Hardware accelerated | |
| Multiple Raster Threads: Enabled | |
| OpenGL: Enabled | |
| Rasterization: Hardware accelerated | |
| Raw Draw: Disabled | |
| Video Decode: Hardware accelerated |
| /** | |
| * @author mrdoob / http://mrdoob.com/ | |
| */ | |
| function WebAudio( context ) { | |
| if ( context === undefined ) { | |
| context = WebAudio.context; |
| <html> | |
| <head> | |
| <style> | |
| body { | |
| margin: 0; | |
| padding: 10px; | |
| color: #ffffff; | |
| background: #222222; | |
| font-family: sans-serif; | |
| font-size: 7px; |
| echo "import { Matrix4 } from './src/math/Matrix4.js'" | npx rollup -f es |
Utilities for converting model files to the Three.js JSON format. It's necessary to install the esm npm package before you can use the converters.
Usage:
node -r esm obj2three.js model.obj
| data:text/html,<canvas id=R style=width:99%;background:navy><script>setInterval("s=Math.sin;q= Math.sqrt;d=(N,M,O,a)=>1/q((N-x+50-a/2)**2+(M-y+50-a%2)**2+(O-z+o)**2);f=a=>d(i,j,k,a)+d(j,-i,i,a)+d(k,i,-j,a)-.1-A;O=R.getContext('2d');i=s(n/2)* o;j=s(n+=.1)*o;k=s(n/3)*o;for(y=h;y--;)for(x=h;x--;){B=m=z=-o;for(r=9;m++;z+=r)A=0,A=f(0),A*B<0&&(r/=-2),B=A;z++;Z=f(0);z--;C=f(2)/Z;D=f(1)/Z;O.fillStyle='rgb('+s(n)*o/q(C*C+D*D)+',0,'+(C*h+n^D*h+n)+')';O.fillRect(x+h,y+o,1,1)}",n=o=25,h=99)</script> |
| // @mrdoob: Can't believe image maps aren't responsive | |
| window.onload = function () { | |
| var image = document.getElementById( 'image' ); | |
| var delta = image.clientWidth / 1024; | |
| var map = document.getElementById( 'map' ); | |
| var areas = map.getElementsByTagName( 'area' ); |
| for i in *.obj; do ../../draco/draco_encoder -i "$i"; done | |
| for i in *.jpg; do sips -Z 2048 -s format png "$i" --out "$i".png; done | |
| for i in *.png; do ../../basis/basisu -file "$i"; done |
| try { throw new Error; } | |
| catch(e) { | |
| console.log(e.stack); | |
| } |
| /** | |
| * @author mrdoob / http://mrdoob.com/ | |
| */ | |
| function html2canvas( element ) { | |
| var range = document.createRange(); | |
| function Clipper( context ) { |