Difference between revisions of "RENDER3D LATEST DRAFT"
Jump to navigation
Jump to search
(Created page with "<pre> // 0-9 for animation trigger // SHIFT+0-9 for animation trigger once // simple sphere RENDER3D( [ ["type" ], ["sphere"] ] ) "" // simple color RENDER3D( [...") |
|||
| Line 2,273: | Line 2,273: | ||
// dna in double helical format | // dna in double helical format | ||
| + | // d1="ATCG"; | ||
| + | // d2="TAGC"; | ||
| + | // dna=(1..100@(function (){var r=RANDINT(4);return([d1[r],d2[r]])}) )~; | ||
| + | |||
| + | d1="ATCG"; | ||
| + | d2="TAGC"; | ||
| + | d=(1..100@(function (){var r=RANDINT(4);return([d1[r],d2[r]])}) )~; | ||
| + | dna=(d[0]~);//.print() | ||
| + | |||
helix1=HELICALPOINTS(118,100); | helix1=HELICALPOINTS(118,100); | ||
helix2=ROTATEPOINTS(helix1,Math.PI); | helix2=ROTATEPOINTS(helix1,Math.PI); | ||
| Line 2,349: | Line 2,358: | ||
// points | // points | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material"], | ||
| + | ["points", "red",[1,30,30], | ||
| + | 1..100@(x=>[x,1,x]), [["size"],[0.05]] ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // points | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material"], | ||
| + | ["points", "red",[1,30,30], | ||
| + | 1..100@(x=>[x,1,x]) .map(x=>x[0]) , [["size"],[0.5]] ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // line test | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["line", "red",[1,30,30],[[0,0,0][1,1,1],[4,4,2]]] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // lines | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],[[[1,1,2],[2,3,4]],[12,3,4],[4,5,5]]], | ||
| + | ["lines", "yellow",[4,30,30],[[[3,3,2],[4,4,4]],[1,3,4],[14,5,15]]] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // lines from stem to sphere | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],SPHERICALPOINTS(118,800).rays()] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // not showing anything. why? lines from stem to sphere | ||
| + | // is it radius? The group is being made etc. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],SPHERICALPOINTS(18,5).rays()] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // lines from stem to sphere | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],HELICALPOINTS(118,800).rays()] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // lines from conical tree with scale | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],SCALEPOINTS(HELICALPOINTS(118,800),1..118.map(x=>1/x)).rays()] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // try subpoints using add | ||
| + | // lines from stem to sphere | ||
| + | // did not work | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],ADDPOINTS(HELICALPOINTS(118,800),1..118.map(x=>-x)).rays()] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // try subpoints using add | ||
| + | // lines from stem to sphere | ||
| + | // did not work | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>-x))] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // rayscale etc | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>-x))] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // rayscale etc | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>1/x))] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // rayscale etc conical christmas tree | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // rayscale etc with many colors | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "rainbow",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // rayscale etc with many colors like a fruit | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates"], | ||
| + | ["lines", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // rayscale etc with many colors like a fruit with center | ||
| + | // like a flower. note [[]] on material not to split settings array | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material"], | ||
| + | ["lines", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118),"center"), | ||
| + | [ | ||
| + | [ | ||
| + | ["type","linewidth"], | ||
| + | ["line",3] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // rayscale etc with many colors like a fruit with center | ||
| + | // like a flower. note [[]] on material not to split settings array | ||
| + | // line2 is not working well | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material"], | ||
| + | ["line2s", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118),"center"), | ||
| + | [ | ||
| + | [ | ||
| + | ["linewidth"], | ||
| + | [3] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // points with lookat | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material"], | ||
| + | ["points", "red",[1,30,30], | ||
| + | SPHERICALPOINTS(118,10).rayslookat(), [["size"],[0.1]] ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material"], | ||
| + | ["points", "red",[1,30,30], | ||
| + | SPHERICALPOINTS(118,10).rayslookat(), [["size"],[0.1]] ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // place rectangles at spherical points with lookat defined | ||
| + | pts=SPHERICALPOINTS(118,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat"], | ||
| + | ["cube", "red",[1,1,1], pts, "phong",pts.rayslookat() ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // sphere of cubes... | ||
| + | pts=SPHERICALPOINTS(118,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "red",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // small cubes did not seem to change | ||
| + | pts=SPHERICALPOINTS(118,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "red",[0.1,0.1,0.1], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // sphere from small balls | ||
| + | pts=SPHERICALPOINTS(30,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["sphere", "red",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | |||
| + | // random colors on spheres | ||
| + | pts=SPHERICALPOINTS(30,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["sphere", "random",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // interesting shape like a cross with stuff in the middle | ||
| + | pts=SPHERICALPOINTS(130,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "reds",[1,15,15], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // interesting sphere | ||
| + | pts=SPHERICALPOINTS(130,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "reds",[[1,15,15]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // random colors on spheres | ||
| + | pts=SPHERICALPOINTS(30,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["sphere", "random",[[1,10,10]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // random colors on spheres | ||
| + | pts=SPHERICALPOINTS(30,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["sphere", "random",[[1,1,1]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical cubes | ||
| + | pts=HELICALPOINTS(30,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "random",[[0.1,0.10,0.10]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical cubes | ||
| + | pts=HELICALPOINTS(5,2); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "random",[[1,10,10]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | |||
| + | // helical cubes | ||
| + | pts=HELICALPOINTS(5,20); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "random",[[0.1,1,1]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical cubes | ||
| + | pts=HELICALPOINTS(50,20); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "random",[[10,10,10]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical cubes around center at same level | ||
| + | pts=HELICALPOINTS(5,2,5,0); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical cubes | ||
| + | // (maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset) | ||
| + | pts=HELICALPOINTS(50,2,5,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // helical cubes in separate levels | ||
| + | pts=HELICALPOINTS(50,2,5,0,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical cubes rainbow colors with lookat | ||
| + | pts=HELICALPOINTS(50,20,5,0,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "rainbow",[[15.1,5,15]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical cubes | ||
| + | pts=HELICALPOINTS([50,100],20,5,0,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "rainbow",[[15.1,5,15]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical cubes in concentric circles | ||
| + | pts=HELICALPOINTS(20,[50,100],5,8,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["cube", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // helical sphere in concentric circles, with triangular shapes | ||
| + | pts=HELICALPOINTS(20,[5,15],5,8,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["sphere", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // helical spheres with random radii | ||
| + | pts=HELICALPOINTS(20,[50,100],5,8,10); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["sphere", "rainbow",x=>[RANDOM(5),10,5], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // simple sphere and viewport | ||
| + | // not working yet | ||
| + | // added controls and still has issues | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ], | ||
| + | ["sphere"], | ||
| + | ["viewport"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // flower like helical sphere in concentric circles, with triangular shapes | ||
| + | pts=HELICALPOINTS(20,5,20,0); | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count"], | ||
| + | ["sphere", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | //HELICALPOINTS(maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset,requirednumberofpoints) | ||
| + | |||
| + | // flowerlike helical sphere in concentric circles, with triangular shapes | ||
| + | pts=HELICALPOINTS(20,15,20,0); | ||
| + | angles=radpiby20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count","rotation"], | ||
| + | ["sphere", "rainbow",[[5,1,3]], pts, "phong",pts.rayslookat() ,pts.length,i=>[angles[i],0,0] ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | //HELICALPOINTS(maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset,requirednumberofpoints) | ||
| + | |||
| + | // flowerlike helical sphere in concentric circles, with triangular shapes with rotation | ||
| + | pts=HELICALPOINTS(20,15,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookat","count","rotation"], | ||
| + | ["sphere", "rainbow",[[5,1,3]], pts, "phong",pts.rayslookat() ,pts.length,i=>[angles[i],0,0] ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // flowerlike helical sphere in concentric tetrahedrons, with triangular shapes | ||
| + | // note lookatdeactivated so that it does not affect the set rotations | ||
| + | // could use this for the json object display from crockford | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","lookatdeactivated","count","rotation"], | ||
| + | ["tetrahedron", "rainbow",[[5]], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // flowerlike helical sphere with tubes to get json emblem. note the use of settings to define tube | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"], | ||
| + | ["tube", "rainbow",[[[-10,-10],[10,10],[0,0]]], [5], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // flowerlike helical sphere in concentric circles, with triangular shapes - try 2 | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"], | ||
| + | ["tube", "rainbow",[[[-10,-10],[10,10],[10,-10],[-10,10],[-10,-10]]], [5], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // flowerlike helical sphere in concentric circles, with triangular shapes - try 3 | ||
| + | // segments can be used for flower marigold | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"], | ||
| + | ["tube", "rainbow",[[[0,0],[6,0],[3,2.2427336738541745]]], [1], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // flowerlike helical sphere in concentric circles, with triangular shapes try 4 | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"], | ||
| + | ["tube", "rainbow",[[[0,0,0],[0,6,0],[0,3,2.2427336738541745],[0,0,0]]], [15,10,10], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,0,angles[i]]] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // flowerlike helical sphere in concentric circles, with triangular shapes try 5 | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"], | ||
| + | ["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [15,10,10], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | |||
| + | // flowerlike helical sphere in concentric circles, with triangular shapes try 5 | ||
| + | // size should be in two d array if i loop | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"], | ||
| + | ["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [[2,10,10]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // flowerlike helical sphere in concentric circles, with triangular shapes try 6 thin edges of tube | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"], | ||
| + | ["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [[5,0.1,5]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // crayon like tubes | ||
| + | pts=HELICALPOINTS(20,25,20,0); | ||
| + | angles=deg360by20; | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"], | ||
| + | ["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745]]], [[2,1,50,true]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // render download command | ||
| + | RENDER( | ||
| + | [ | ||
| + | ["type","cx", "cy", "r","coordinates","label","fill","stroke","stroke-width","font-size","format"], | ||
| + | ["circle",100,100,60,,,"purple","purple"], | ||
| + | ["circle",100,100,30,,,"white","white"], | ||
| + | ["text",,,,[90,65],"1",,"black",3,40], | ||
| + | ["download",,,,[90,65],"1",,"black",3,40,"png"] | ||
| + | ]); | ||
| + | "" | ||
| + | |||
| + | //A forest of trees | ||
| + | // RENDER3D( | ||
| + | // [ | ||
| + | // ["type" ,"fill", "size", "coordinates","material","count"], | ||
| + | // ["tree", "red",[1,30,30], | ||
| + | // 1..100@(x=>[x,1,x]), [["size"],[0.05]],15 ] | ||
| + | // ] | ||
| + | // ) | ||
| + | // "" | ||
| + | //1..100@(x=>[x,1,x]) would not work as it gives arrays within arrays | ||
| + | |||
| + | //A row of trees | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","count"], | ||
| + | ["tree", "red",[1,30,30], | ||
| + | (x=>[x,1,x]), [["size"],[0.05]],15 ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // forest of trees. notice [[size]] | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",[[1,30,30]], | ||
| + | ((x,y)=>[x,0,y]),IM(15) ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // forest of trees.trying different size | ||
| + | // this did not work as well | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",((x,y)=>[RANDINT(100),x,y]), | ||
| + | ((x,y)=>[x,0,y]),IM(15) ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | // forest of trees. works. trying different size | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",((x,y)=>[RANDINT(10)]), | ||
| + | ((x,y)=>[x*RANDINT(10),0,y*RANDINT(10)]),IM(15) ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // one big tree | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",((x,y)=>[RANDINT(100)]), | ||
| + | ,IM(15) ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // one big tree | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",((x,y)=>[RANDINT(100)]), | ||
| + | ,50 ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // one big tree - different height cover etc. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",[1..5,(50..1..-10)]~, | ||
| + | ,5 ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // loading different formats | ||
| + | // 3dm files | ||
| + | // loads though looks rotated on x axis. can expand on idea as in https://threejs.org/examples/webgl_loader_3dm.html | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/3dm/Rhino_Logo.3dm" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // 3dm files | ||
| + | // loads though looks rotated on x axis. can expand on idea | ||
| + | // need to see if colors normal etc load right or else get it loaded | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , | ||
| + | [ | ||
| + | ["url","normal"], | ||
| + | [ | ||
| + | "https://three.zcubes.com/examples/models/3ds/portalgun/portalgun.3ds" , | ||
| + | "https://three.zcubes.com/examples/models/3ds/portalgun/textures/normal.jpg" | ||
| + | ] | ||
| + | ] | ||
| + | , | ||
| + | [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | // 3mf files | ||
| + | // loads though looks rotated on x axis. can expand on idea | ||
| + | // other links to use | ||
| + | //"https://three.zcubes.com/examples/models/3mf/facecolors.3mf" | ||
| + | //"https://three.zcubes.com/examples/models/3mf/multipletextures.3mf" | ||
| + | //"https://three.zcubes.com/examples/models/3mf/vertexcolors.3mf" | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/3mf/cube_gears.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/3mf/multipletextures.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/3mf/truck.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // amf file load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/amf/rook.amf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // assimp file load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/assimp/octaminator/Octaminator.assimp" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // bvh file load - needed fitting. did that break other loads? | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/bvh/pirouette.bvh" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // dae file load - needed fitting. did that break other loads? collada | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/collada/elf/elf.dae" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | //need to do kinematics | ||
| + | //https://threejs.org/examples/webgl_loader_collada_kinematics.html | ||
| + | |||
| + | // dae file load - needed fitting. did that break other loads? collada with animation | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/collada/stormtrooper/stormtrooper.dae" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | // draco drc file load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/draco/bunny.drc" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // fbxfile load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/fbx/Samba Dancing.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // fbxfile load - nurbs | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/fbx/nurbs.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // gcode load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/gcode/benchy.gcode" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // kmz load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/kmz/Box.kmz" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // lwo load - change background to see the text which is in black | ||
| + | // or add screen background row | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | [0xf0f0f0] | ||
| + | ], , , , ,], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/lwo/Objects/LWO3/Demo.lwo" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // nrrd and vtk load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/nrrd/I.nrrd" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/liver.vtk" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // pcd | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/pcd/binary/Zaghetto.pcd" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // ply | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/ply/ascii/dolphins.ply" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/ply/binary/Lucy100k.ply" , [-20,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // prwm | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/prwm/smooth-suzanne.le.prwm" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/prwm/faceted-nefertiti.le.prwm" , [10,10,5] ,[10,10,10] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/prwm/vive-controller.le.prwm" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | |||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // stl | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/stl/ascii/slotted_disk.stl" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/stl/binary/pr2_head_pan.stl" , [10,10,5] ,[10,10,10] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/stl/binary/pr2_head_tilt.stl" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/stl/binary/colored.stl" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | |||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | //tilt | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/tilt/BRUSH_DOME.tilt" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | //tilt | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://github.com/mrdoob/three.js/blob/master/examples/models/tilt/BRUSH_DOME.tilt" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | // to test | ||
| + | //vox | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vox/monu10.vox" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | //vrm | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vrm/Alicia/AliciaSolid.vrm" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | //vrml | ||
| + | // other files to load | ||
| + | https://three.zcubes.com/examples/models/vrml/creaseAngle.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/crystal.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/house.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/elevationGrid1.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/elevationGrid2.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/extrusion1.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/extrusion2.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/extrusion3.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/lines.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/meshWithLines.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/meshWithTexture.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/pixelTexture.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/points.wrl | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vrml/house.wrl" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | // vtk and vtp | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/bunny.vtk" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/cube_ascii.vtp" , [3,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/cube_binary.vtp" , [10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/cube_no_compression.vtp" , [20,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | // x | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | //["load" , "https://three.zcubes.com/examples/models/xyz/helix_201.xyz" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ["load" , "https://three.zcubes.com/examples/models/xfile/SSR06_model.x" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | // xyz | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | //["load" , "https://three.zcubes.com/examples/models/xyz/helix_201.xyz" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ["load" , "../threefull/other/examples/helix_201.xyz" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , "klein" , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"] | ||
| + | ] | ||
| + | );"" | ||
| + | // mobius strip | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , "mobius" , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"] | ||
| + | ] | ||
| + | );"" | ||
| + | // torus structure with mesh function | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , | ||
| + | function mf(u,v,target) | ||
| + | { | ||
| + | //a=3; | ||
| + | //b=1; | ||
| + | //c=1; | ||
| + | //d=1; | ||
| + | a=10;//*Math.Pi(); | ||
| + | b=2;//*Math.Pi();//*Math.Pi() | ||
| + | var twopi=2*Math.PI; | ||
| + | |||
| + | var x=cos(u*twopi)*(a + b*cos(v*twopi)) | ||
| + | var y=sin(u*twopi)*(a + b*cos(v*twopi)) | ||
| + | var z=b*sin(v*twopi) | ||
| + | target.set(x,y,z) | ||
| + | } | ||
| + | |||
| + | , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , | ||
| + | function mf(x,y,target) | ||
| + | { | ||
| + | var xMin=-10; | ||
| + | var yMin=-10; | ||
| + | var xMax=10; | ||
| + | var yMax=10; | ||
| + | var a=1; | ||
| + | var b=1; | ||
| + | var xRange = xMax - xMin; | ||
| + | var yRange = yMax - yMin; | ||
| + | var x = xRange * x + xMin; | ||
| + | var y = yRange * y + yMin; | ||
| + | var z=sin(sqrt(a*x^2 + b*y^2)) | ||
| + | target.set(x,y,z) | ||
| + | } | ||
| + | |||
| + | , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"] | ||
| + | ] | ||
| + | );"" | ||
| + | // with zrange color | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , | ||
| + | function mf(x,y,target) | ||
| + | { | ||
| + | var xMin=-10; | ||
| + | var yMin=-10; | ||
| + | var xMax=10; | ||
| + | var yMax=10; | ||
| + | var a=1; | ||
| + | var b=1; | ||
| + | var xRange = xMax - xMin; | ||
| + | var yRange = yMax - yMin; | ||
| + | var x = xRange * x + xMin; | ||
| + | var y = yRange * y + yMin; | ||
| + | var z=sin(sqrt(a*x^2 + b*y^2)) | ||
| + | target.set(x,y,z) | ||
| + | } | ||
| + | |||
| + | , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "zrange" ,false , "phong"] | ||
| + | ] | ||
| + | );"" | ||
| + | // asbestoes https://sites.google.com/site/cgwith3js/home/parametric-geometry | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , | ||
| + | function mf(u,v,target) | ||
| + | { | ||
| + | //a=3; | ||
| + | //b=1; | ||
| + | //c=1; | ||
| + | //d=1; | ||
| + | /* | ||
| + | a=10;//*Math.Pi(); | ||
| + | b=2;//*Math.Pi();//*Math.Pi() | ||
| + | var twopi=2*Math.PI; | ||
| + | |||
| + | var x=cos(u*twopi)*(a + b*cos(v*twopi)) | ||
| + | var y=sin(u*twopi)*(a + b*cos(v*twopi)) | ||
| + | var z=b*sin(v*twopi) | ||
| + | //target.set(x,y,z) | ||
| + | */ | ||
| + | target.set(-100 + 200 * u, 3 * Math.sin(20 * (u + v)), -100 + 200 * v); | ||
| + | } | ||
| + | |||
| + | , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // lissajous | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , | ||
| + | function mf(u,v,target) | ||
| + | { | ||
| + | var A=1; | ||
| + | var B=2; | ||
| + | var a=2; | ||
| + | var b=2; | ||
| + | var delta=Math.PI/2;//2; | ||
| + | var xi=2; | ||
| + | |||
| + | |||
| + | var x=A*Math.sin(a*(u)+delta) | ||
| + | //var y=B*Math.sin(b*(v)+xi) | ||
| + | var y=B*Math.sin(b*(v)) | ||
| + | var z=0;//b*sin(v*twopi) | ||
| + | target.set(x,y,z); | ||
| + | } | ||
| + | |||
| + | , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | );"" | ||
| + | -not yet working | ||
| + | |||
| + | |||
| + | // Dinis Surface https://mathworld.wolfram.com/DinisSurface.html | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , | ||
| + | function mf(u,v,target) | ||
| + | { | ||
| + | var a=1; | ||
| + | var b=0.2; | ||
| + | u=u*4*(Math.PI) | ||
| + | v=v*2; | ||
| + | |||
| + | |||
| + | x = a*COS(u)*SIN(v) | ||
| + | y = a*SIN(u)*SIN(v) | ||
| + | z = MIN(MAX(a*(COS(v)+LN(TAN(1/2*v)))+b*u,-100),100); | ||
| + | |||
| + | target.set(x,y,z); | ||
| + | } | ||
| + | |||
| + | , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // Dinis Surface https://mathworld.wolfram.com/DinisSurface.html | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["parametricgeometry" , | ||
| + | function mf(u,v,target) | ||
| + | { | ||
| + | var a=1; | ||
| + | var b=0.2; | ||
| + | u=u*4*(Math.PI) | ||
| + | v=v*2; | ||
| + | |||
| + | |||
| + | x = a*COS(u)*SIN(v) | ||
| + | y = a*SIN(u)*SIN(v) | ||
| + | z = MIN(MAX(a*(COS(v)+LN(TAN(1/2*v)))+b*u,-100),100); | ||
| + | |||
| + | target.set(x,y,z); | ||
| + | } | ||
| + | |||
| + | , [1,3,3] ,[5,5,50,50] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | );"" | ||
| + | // trying walt with background | ||
| + | // need to see how the reflection etc. can be triggered | ||
| + | // as in https://threejs.org/examples/#webgl_materials_cubemap | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | [0xf0f0f0] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/examples/models/obj/walt/WaltHead.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // walt disney with normals - did not seem to trigger | ||
| + | // how to do this with obj async load? | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","normals" ,"tangents"], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | [0xf0f0f0] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/examples/models/obj/walt/WaltHead.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",5,15] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | //todo | ||
| + | // https://threejs.org/examples/#webgl_materials | ||
| + | -blending just field blending with THREE.AdditiveBlending etc | ||
| + | |||
| + | materials.push( new THREE.MeshLambertMaterial( { map: texture, transparent: true } ) ); | ||
| + | materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd } ) ); | ||
| + | materials.push( new THREE.MeshPhongMaterial( { color: 0xdddddd, specular: 0x009900, shininess: 30, flatShading: true } ) ); | ||
| + | materials.push( new THREE.MeshNormalMaterial() ); | ||
| + | materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, transparent: true, blending: THREE.AdditiveBlending } ) ); | ||
| + | materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd } ) ); | ||
| + | materials.push( new THREE.MeshPhongMaterial( { color: 0xdddddd, specular: 0x009900, shininess: 30, map: texture, transparent: true } ) ); | ||
| + | materials.push( new THREE.MeshNormalMaterial( { flatShading: true } ) ); | ||
| + | materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, wireframe: true } ) ); | ||
| + | materials.push( new THREE.MeshDepthMaterial() ); | ||
| + | materials.push( new THREE.MeshLambertMaterial( { color: 0x666666, emissive: 0xff0000 } ) ); | ||
| + | materials.push( new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x666666, emissive: 0xff0000, shininess: 10, opacity: 0.9, transparent: true } ) ); | ||
| + | materials.push( new THREE.MeshBasicMaterial( { map: texture, transparent: true } ) ); | ||
| + | |||
| + | -https://threejs.org/examples/#webgl_loader_gltf_extensions | ||
| + | -ducks etc. | ||
| + | -reflection steel balls etc. | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | // simple catmullromcurve3 with editor | ||
| + | // need to see how to remove the spline points on unselect etc. | ||
| + | // fit view does not work for spline points, with only position, not the actual center of the spline curve | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["curve" , , | ||
| + | [ | ||
| + | [1,3,3], | ||
| + | [2,3,3], | ||
| + | [3,1,3], | ||
| + | [1,3,3], | ||
| + | ] , | ||
| + | [5,20,20] , 0x00ff00 , "yellow" ,false , "phong" | ||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | |||
| + | |||
| + | // animations - rpm, tpm and opm (rotations, times and orbit) | ||
| + | // simple cube rpm | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", [["rpm"],[5]]] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // simple cube tpm animation on a path | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", | ||
| + | [ | ||
| + | ["rpm","tpm","points" ], | ||
| + | [5, 2, [[1,2,3],[2,3,4],[5,5,6]]] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // simple cube tpm animation on a path | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", [["tpm","points"],[20,[[10,2,3],[20,3,4],[50,5,6]]]]] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // orbit per minute | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", | ||
| + | [ | ||
| + | ["opm" ,"r" ], | ||
| + | [20 ,10 ] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // orbit per minute and rpm | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", | ||
| + | [ | ||
| + | ["opm" ,"r" ,"rpm"], | ||
| + | [20 ,10 , 100] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // jupiter orbit per minute and rpm | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong", | ||
| + | [ | ||
| + | ["opm" ,"r" ,"rpm"], | ||
| + | [20 ,100 , 100] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // jupiter orbit per minute and rpm title etc. scale and rotation (in degrees) | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" , "rotation","scale"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong", | ||
| + | [ | ||
| + | ["opm" ,"r" ,"rpm"], | ||
| + | [20 ,100 , 100] | ||
| + | ], | ||
| + | [0 ,23 , 0] , | ||
| + | [1 ,1 , 1] | ||
| + | |||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | // jupiter orbit per minute and rpm title etc. scale and rotation (in degrees) | ||
| + | // camera animation | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["camera" , | ||
| + | [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , , , , | ||
| + | [ | ||
| + | ["rpm"], | ||
| + | [ 100] | ||
| + | ] | ||
| + | |||
| + | ], | ||
| + | |||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong", | ||
| + | [ | ||
| + | ["rpm"], | ||
| + | [ 100] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // camera rotation | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["camera" , | ||
| + | [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , , , , | ||
| + | [ | ||
| + | ["rpm"], | ||
| + | [ 10] | ||
| + | ] | ||
| + | |||
| + | ], | ||
| + | |||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong", | ||
| + | [ | ||
| + | ["rpm"], | ||
| + | [ 5] | ||
| + | ] | ||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // get the camera on the scene here | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["camera" , | ||
| + | [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , , , , | ||
| + | [ | ||
| + | ["rpm"], | ||
| + | [ 10] | ||
| + | ] | ||
| + | |||
| + | ], | ||
| + | |||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong", | ||
| + | |||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | |||
| + | // get the camera on the scene here | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ], | ||
| + | ["camera" , | ||
| + | [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , , , , | ||
| + | [ | ||
| + | ["tpm","points"], | ||
| + | [2,[[1,2,3],[2,3,4],[5,5,6]]] | ||
| + | ] | ||
| + | ], | ||
| + | |||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong", | ||
| + | |||
| + | ] | ||
| + | ] | ||
| + | );"" | ||
| + | // simple sphere and mirror cube | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "mirror"], | ||
| + | ["sphere" , , [10,5,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // circular mirror | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["circle" , , [1,3,3] ,[50,50,50] , 0x00ff00 , "yellow" ,false , "mirror"], | ||
| + | ["sphere" , , [10,5,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | // grid and sphere | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // grid and sphere - zrange color like https://stemkoski.github.io/Three.js/Graphulus-Function.html | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "zrange" ,false , "phong"] | ||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | //zrange is not kicking in. | ||
| + | //zrange is not working on ParameterBufferGeometry. On https://stemkoski.github.io/Three.js/Graphulus-Function.html it was ParameterGeometry | ||
| + | -need to follow up | ||
| + | |||
| + | // grid and sphere uv color | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "uv" ,false , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // painting texture | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "painting" ,false , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | // jupiter, earth etc. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong"], | ||
| + | ["sphere" , , [12,3,3] ,[5,20,20] , 0x00ff00 , "earth" ,false , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // physics not working due to ammo issues. see how to resolve. the threeful copy of example is not working | ||
| + | // should we get from https://github.com/kripken/ammo.js? | ||
| + | or should we try https://schteppe.github.io/cannon.js/? | ||
| + | // should possibly switch to cannonjs | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ], | ||
| + | ["physics"], | ||
| + | ["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [1,150,130] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [10,300,230] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | |||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ], | ||
| + | ["physics"], | ||
| + | ["floorxy" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["flooryz" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["floorxz" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [1,15,13] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [10,30,23] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | |||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | |||
| + | // at least oriented right | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ], | ||
| + | ["physics"], | ||
| + | ["floor" , , [0,0,-3] ,[50,1,50] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [1,15,13] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [10,30,23] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | |||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["load" , "../threefull/examples/models/gltf/RobotExpressive/RobotExpressive.glb" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | // xbot | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["load" , "../threefull/examples/models/gltf/Xbot.glb" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // soldier test from config | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["load" , "soldier" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | // parrot | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["load" , "parrot" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["red"] | ||
| + | ], | ||
| + | ], | ||
| + | ["ground" , [ | ||
| + | ["type","width","height"], | ||
| + | ["checkerboard",1000,1000] | ||
| + | ], | ||
| + | ] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | //ground | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["red"] | ||
| + | ], | ||
| + | ], | ||
| + | ["ground" , [ | ||
| + | ["type","width","height"], | ||
| + | ["grass",1000,1000] | ||
| + | ], | ||
| + | ], | ||
| + | |||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["light" , | ||
| + | [ | ||
| + | ["type" , "color", "intensity", "width", "height"], | ||
| + | ["rectarealight" , "red", 0.6, 10, 10] | ||
| + | ] , | ||
| + | [1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | //rect light | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["red"] | ||
| + | ], | ||
| + | ], | ||
| + | |||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["light" , | ||
| + | [ | ||
| + | ["type" , "color", "intensity", "width", "height"], | ||
| + | ["rectarealight" , "red", 0.6, 10, 10] | ||
| + | ] , | ||
| + | [1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // fog | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["red"] | ||
| + | ], | ||
| + | ], | ||
| + | |||
| + | ["fog" , [ | ||
| + | ["color","near","far"], | ||
| + | ["red",10,2000] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | /* ["fog" , [ | ||
| + | ["color","density"], | ||
| + | ["red",0.1] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | */ | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["light" , | ||
| + | [ | ||
| + | ["type" , "color", "intensity", "distance", "decay"], | ||
| + | ["pointlight" , "red", 0.6, 100, 2] | ||
| + | ] , | ||
| + | [1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | |||
| + | //sphere and light works | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["red"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["light" , | ||
| + | [ | ||
| + | ["type" , "color", "intensity", "distance", "decay"], | ||
| + | ["pointlight" , "red", 0.6, 100, 2] | ||
| + | ] , | ||
| + | [1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | ["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | //text | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["red"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["text" , "ZCubes" , [3,3,3] ,[5,2,20] , 0x00ff00 , "yellow" ,true , "backgroundreflection"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // bevelled text | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["red"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["text" , "ZCubes" , [3,3,3] ,[5,2,20,true] , 0x00ff00 , "yellow" ,true , "backgroundreflection"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // background and sphere with reflection | ||
| + | // did not seem to work | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["pisa"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | //["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"], | ||
| + | ["sphere" , , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , "backgroundreflection"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // svg load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["white"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/examples/models/svg/tiger.svg" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | // pdb load | ||
| + | // it did not show the letters. did the css2d not work? | ||
| + | // need to figure out how CSS2DObject works to show the labels | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["white"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/examples/models/pdb/aspirin.pdb" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // pdb load | ||
| + | // it did not show the letters. did the css2d not work? | ||
| + | // need to figure out how CSS2DObject works to show the labels | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["transparent"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/examples/models/pdb/aspirin.pdb" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // svg monalisa load | ||
| + | //if monalisa svg was assigned, this was loaded, but was not visible until pisa was made background then could see it | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["white"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load.svg" , monalisa , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | -fbx load - had to change the path for mimetype allowed. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | /*["scene" , [ | ||
| + | ["background"], | ||
| + | ["pisa"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | */ | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [275/*60 */ ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | //["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"], | ||
| + | ["load" , "../threefull/examples/models/fbx/Samba Dancing.fbx" , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , ] | ||
| + | ] | ||
| + | ) | ||
| + | -fbx load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | /*["scene" , [ | ||
| + | ["background"], | ||
| + | ["pisa"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | */ | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [275/*60 */ ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | //["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/fbx/Samba Dancing.fbx" , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , ] | ||
| + | ] | ||
| + | ) | ||
| + | |||
| + | //RENDER3DDEV( | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ["pisa"] | ||
| + | ], | ||
| + | , , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3] | ||
| + | ], , , , ,], | ||
| + | |||
| + | //["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"], | ||
| + | ["sphere" , , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , "backgroundreflection"] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // multiple spheres | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"], | ||
| + | [75 ,"auto" ,0.1 ,1000 , [50,50,50] , 3] | ||
| + | ], , , , , ,], | ||
| + | |||
| + | ["sphere" , , i=>[3*i,i*3,3] ,[5,50,50] , 0x00ff00 , ["yellow","red"] ,true, , 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // simpler multiple spheres - size gets confusing. check next one. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[3*i,i*3,3] ,[5,50,50] , 0x00ff00 , ["yellow","red"] ,true, , 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // simpler multiple spheres - size better | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[3*i,i*3,3] ,i=>[5,50,50] , 0x00ff00 , "yellow" ,true, , 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | // smaller sphere | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[3*i,i*3,3] ,i=>[1,50,50] , 0x00ff00 , "yellow" ,true, , 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // smaller sphere normal colors | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[3*i,i*3,3] ,i=>[1,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // smaller sphere normal colors - varying radii | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[3*i,i*3,3] ,i=>[1*i,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // smaller sphere normal colors - varying radii slight - 0 radius defaults to 1 | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // smaller sphere normal colors - varying radii slight - 0 radius defaults to 1 adjusted by a small amount | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i+0.01,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // smaller sphere normal colors - varying colors from interpolate d3 | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i+0.01,50,50] , 0x00ff00 , i=>d3.interpolateInferno(i/10) ,true, "phong", 10] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // smaller sphere normal colors - varying colors from interpolate d3 2d | ||
| + | // looks like rocks | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , (i,j)=>[3*i,j*3,3] ,(i,j)=>[0.3*i+0,2*j+0.01,50,50] , 0x00ff00 , (i,j)=>d3.interpolateInferno((i+j)/10) ,true, "phong", |6,4|] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // varying size varying colors from interpolate d3 2d | ||
| + | // looks like rocks | ||
| + | // material can have other properties in subarray. how to loop this? | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , (i,j)=>[3*i,j*3,3] ,(i,j)=>[0.3*i+0.2*j+0.01,50,50] , 0x00ff00 , (i,j)=>d3.interpolateInferno((i+j)/10) ,true, "phong", |6,4|] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | // planets | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ], | ||
| + | ["sphere" , , i=>[10*i,0,0] ,(i,j)=>[5,50,50] , 0x00ff00 , PLANETS ,true, "phong", PLANETS.length] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // new items | ||
| + | |||
| + | //https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_video_webcam.html | ||
| + | // webcam | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size"], | ||
| + | ["sphere", "webcam",[1,30,30]] // user direction | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // load objects with ferrari, and do this to rotate the wheels. on #bg | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "name" , "animation" ], | ||
| + | ["change" , "wheel_fl" , [["rpmx"],[-60]] ], | ||
| + | ["change" , "wheel_fr" , [["rpmx"],[-60]] ], | ||
| + | ["change" , "wheel_rl" , [["rpmx"],[-60]] ], | ||
| + | ["change" , "wheel_rr" , [["rpmx"],[-60]] ] | ||
| + | ], | ||
| + | "#bg" | ||
| + | );"" | ||
| + | |||
| + | |||
| + | // rose 2 | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | [0xf0f0f0] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // gave black | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"aut" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/female/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // rose seems to work better | ||
| + | // mtl file needs to be moved around for values like each line in mtl | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | |||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "../threefull/other/female/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // gave black | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose2/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | //glb shows rose right. really tiny and had to be scaled. why? | ||
| + | // made scale to be 10 | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | //alien obj file | ||
| + | // why is it so far to the top? | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/alien/alien.obj" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | //cubes fbx file. did not work since this is old version | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cubes/cubes.fbx" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | //cubes glb file. did not work since this is old version | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cubes/cubes.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | |||
| + | //glb rendered, flb had issues with transparency | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower 2.gltf" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower 5.gltf" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | // physics started working after quaternion of plane was set 2:15 PM 12/8/2020 | ||
| + | // basics work in this | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ], | ||
| + | ["physics"], | ||
| + | ["floor" , , [0,0,-3] ,[500,1,500] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [0,10,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [10,10,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | |||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | -still some axis confusion, or camera confusion. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ], | ||
| + | ["physics"], | ||
| + | ["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [0,100,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [10,100,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | |||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | -look better | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ], | ||
| + | ["physics"], | ||
| + | ["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [0,10,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["sphere" , , [10,20,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10], | ||
| + | ["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"], | ||
| + | |||
| + | ] | ||
| + | );"" | ||
| + | |||
| + | |||
| + | // fruits | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/fruits/apple and orange.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // cups | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | ['../threefull/examples/textures/terrain/grasslight-big.jpg'] | ||
| + | ], , , , ,], | ||
| + | ["camera" , [ | ||
| + | ["fov" ,"aspect" ,"near" ,"far", "position" ], | ||
| + | [90 ,"auto" ,0.1 ,1000 , [0,0,30] ] | ||
| + | ], , , , ,], | ||
| + | |||
| + | ["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cups/cup.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | // nightsky | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["nightsky" , , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // annotation test | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["annotation" , | ||
| + | [ | ||
| + | ["title","description","camera"], | ||
| + | ["Test" ,"Description Text",[0,0,-15]] | ||
| + | ] | ||
| + | , [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | //["nightsky" , , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // annotation test | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["annotation" , | ||
| + | [ | ||
| + | ["title","description","camera"], | ||
| + | ["Test" ,"Description Text",[-11,9,5]] | ||
| + | ] | ||
| + | , [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | // shows annotation test -wip | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["annotation" , | ||
| + | [ | ||
| + | ["title","description","camera"], | ||
| + | ["Test" ,"Description Text",[-11,9,5]] | ||
| + | ] | ||
| + | , [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // annotation test | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["annotation" , | ||
| + | [ | ||
| + | ["title","description","camera"], | ||
| + | ["Test" ,"Description Text",[0,0,-15]] | ||
| + | ] | ||
| + | , [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["annotation" , | ||
| + | [ | ||
| + | ["title","description","camera"], | ||
| + | ["Test" ,"Description Text",[4,4,-2]] | ||
| + | ] | ||
| + | , [5,5,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // html - these positioning did not seem correct. see why. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["html" , | ||
| + | "<div>TEST</div>" | ||
| + | , [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["html" , | ||
| + | "<div>TEST2</div>" | ||
| + | , [2,2,2] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["html" , | ||
| + | "<div>TEST2</div>" | ||
| + | , [4,4,2] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // html - these positioning did not seem correct. see why. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["html" , | ||
| + | "<div style='font-size:8px'>TEST</div>" | ||
| + | , [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["html" , | ||
| + | "<div style='font-size:8px'>TEST2</div>" | ||
| + | , [20,2,20] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["html" , | ||
| + | "<div style='font-size:8px'>TEST2</div>" | ||
| + | , [40,4,42] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | LOAD("elements"); | ||
| + | els=ELEMENT(1..118) | ||
| + | // html - these positioning did not seem correct. see why. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , els.map(e=>e.toString()), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // this did not work correctly | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , els.map(e=>e.SYMBOL), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | // this is too large as font. need to see what to do to make it right | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , els.map(e=>"<div>"+e.SYMBOL+"</div>"), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | // this does not work find out why. | ||
| + | // el.add(elchild) seems to be undefined | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | "<div style='font-size:8px'>TEST</div>" | ||
| + | , SPHERICALPOINTS(20,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 20] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | "<div style='font-size:8px'>TEST</div>" | ||
| + | , SPHERICALPOINTS(20,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 20] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // works | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | "TEST" | ||
| + | , SPHERICALPOINTS(117,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 117] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | "TEST" | ||
| + | , HELICALPOINTS(118,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // element names in helical format | ||
| + | LOAD("elements", | ||
| + | function () | ||
| + | { | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | ELEMENT(1..118).map(e=>e+"") | ||
| + | , HELICALPOINTS(118,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | } | ||
| + | |||
| + | ) | ||
| + | |||
| + | // element names in double helical format with 90 deg rotation | ||
| + | helix1=HELICALPOINTS(118,100); | ||
| + | helix2=ROTATEPOINTS(helix1); | ||
| + | LOAD("elements", | ||
| + | function () | ||
| + | { | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | ELEMENT(1..118).map(e=>e+""), helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118], | ||
| + | ["html" , | ||
| + | ELEMENT(1..118).map(e=>e+""), helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | } | ||
| + | |||
| + | ) | ||
| + | |||
| + | // element names in double helical format | ||
| + | helix1=HELICALPOINTS(118,100); | ||
| + | helix2=ROTATEPOINTS(helix1,Math.PI); | ||
| + | LOAD("elements", | ||
| + | function () | ||
| + | { | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | ELEMENT(1..118).map(e=>e+""), helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118], | ||
| + | ["html" , | ||
| + | ELEMENT(1..118).map(e=>e+""), helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | } | ||
| + | |||
| + | ) | ||
| + | |||
| + | |||
| + | // dna in double helical format | ||
| + | // d1="ATCG"; | ||
| + | // d2="TAGC"; | ||
| + | // dna=(1..100@(function (){var r=RANDINT(4);return([d1[r],d2[r]])}) )~; | ||
| + | |||
| + | d1="ATCG"; | ||
| + | d2="TAGC"; | ||
| + | d=(1..100@(function (){var r=RANDINT(4);return([d1[r],d2[r]])}) )~; | ||
| + | dna=(d[0]~);//.print() | ||
| + | |||
| + | helix1=HELICALPOINTS(118,100); | ||
| + | helix2=ROTATEPOINTS(helix1,Math.PI); | ||
| + | LOAD("elements", | ||
| + | function () | ||
| + | { | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | dna[0], helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 100], | ||
| + | ["html" , | ||
| + | dna[1], helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 100] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | } | ||
| + | |||
| + | ) | ||
| + | |||
| + | |||
| + | // element names in helical format with conical angle | ||
| + | LOAD("elements", | ||
| + | function () | ||
| + | { | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"], | ||
| + | ["html" , | ||
| + | ELEMENT(1..118).map(e=>e+"") | ||
| + | , SCALEPOINTS(HELICALPOINTS(118,100),1..118@(x=>x/118)) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | } | ||
| + | |||
| + | ) | ||
| + | |||
| + | // annotation still wip | ||
| + | // annotation test | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["annotation" , | ||
| + | [ | ||
| + | ["title","description","camera"], | ||
| + | ["Test" ,"Description Text",[0,0,-15]] | ||
| + | ] | ||
| + | , [0,0,0] ,[1.5,1,1] , 0x00ff00 , ,true , "phong"], | ||
| + | ["annotation" , | ||
| + | [ | ||
| + | ["title","description","camera"], | ||
| + | ["Test" ,"Description Text",[4,4,-2]] | ||
| + | ] | ||
| + | , [5,5,0] ,[1.5,1,1] , 0x00ff00 , ,true , "phong"], | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | // how to get rid of the yellow area etc. and get the camera to zoom in right | ||
| + | |||
| + | // point | ||
| + | // sphere and cube - better looking | ||
RENDER3D( | RENDER3D( | ||
[ | [ | ||
["type" ,"fill", "size", "coordinates","material"], | ["type" ,"fill", "size", "coordinates","material"], | ||
["point", "red",[1,30,30], | ["point", "red",[1,30,30], | ||
| + | [ | ||
| + | [1,1,2], | ||
| + | [2,1,2], | ||
| + | [3,1,2] | ||
| + | ], [["size"],[0.1]] ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // points | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material"], | ||
| + | ["points", "red",[1,30,30], | ||
1..100@(x=>[x,1,x]), [["size"],[0.05]] ] | 1..100@(x=>[x,1,x]), [["size"],[0.05]] ] | ||
] | ] | ||
| Line 2,362: | Line 5,199: | ||
[ | [ | ||
["type" ,"fill", "size", "coordinates","material"], | ["type" ,"fill", "size", "coordinates","material"], | ||
| − | [" | + | ["points", "red",[1,30,30], |
1..100@(x=>[x,1,x]) .map(x=>x[0]) , [["size"],[0.5]] ] | 1..100@(x=>[x,1,x]) .map(x=>x[0]) , [["size"],[0.5]] ] | ||
] | ] | ||
| Line 2,927: | Line 5,764: | ||
]); | ]); | ||
"" | "" | ||
| + | |||
| + | //A forest of trees | ||
| + | // RENDER3D( | ||
| + | // [ | ||
| + | // ["type" ,"fill", "size", "coordinates","material","count"], | ||
| + | // ["tree", "red",[1,30,30], | ||
| + | // 1..100@(x=>[x,1,x]), [["size"],[0.05]],15 ] | ||
| + | // ] | ||
| + | // ) | ||
| + | // "" | ||
| + | //1..100@(x=>[x,1,x]) would not work as it gives arrays within arrays | ||
| + | |||
| + | //A row of trees | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","material","count"], | ||
| + | ["tree", "red",[1,30,30], | ||
| + | (x=>[x,1,x]), [["size"],[0.05]],15 ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // forest of trees. notice [[size]] | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",[[1,30,30]], | ||
| + | ((x,y)=>[x,0,y]),IM(15) ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // forest of trees.trying different size | ||
| + | // this did not work as well | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",((x,y)=>[RANDINT(100),x,y]), | ||
| + | ((x,y)=>[x,0,y]),IM(15) ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | // forest of trees. works. trying different size | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",((x,y)=>[RANDINT(10)]), | ||
| + | ((x,y)=>[x*RANDINT(10),0,y*RANDINT(10)]),IM(15) ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | |||
| + | // one big tree | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",((x,y)=>[RANDINT(100)]), | ||
| + | ,IM(15) ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // one big tree | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",((x,y)=>[RANDINT(100)]), | ||
| + | ,50 ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // one big tree - different height cover etc. | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" ,"fill", "size", "coordinates","count"], | ||
| + | ["tree", "red",[1..5,(50..1..-10)]~, | ||
| + | ,5 ] | ||
| + | ] | ||
| + | ) | ||
| + | "" | ||
| + | |||
| + | // loading different formats | ||
| + | // 3dm files | ||
| + | // loads though looks rotated on x axis. can expand on idea as in https://threejs.org/examples/webgl_loader_3dm.html | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/3dm/Rhino_Logo.3dm" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // 3dm files | ||
| + | // loads though looks rotated on x axis. can expand on idea | ||
| + | // need to see if colors normal etc load right or else get it loaded | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , | ||
| + | [ | ||
| + | ["url","normal"], | ||
| + | [ | ||
| + | "https://three.zcubes.com/examples/models/3ds/portalgun/portalgun.3ds" , | ||
| + | "https://three.zcubes.com/examples/models/3ds/portalgun/textures/normal.jpg" | ||
| + | ] | ||
| + | ] | ||
| + | , | ||
| + | [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | // 3mf files | ||
| + | // loads though looks rotated on x axis. can expand on idea | ||
| + | // other links to use | ||
| + | //"https://three.zcubes.com/examples/models/3mf/facecolors.3mf" | ||
| + | //"https://three.zcubes.com/examples/models/3mf/multipletextures.3mf" | ||
| + | //"https://three.zcubes.com/examples/models/3mf/vertexcolors.3mf" | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/3mf/cube_gears.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/3mf/multipletextures.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/3mf/truck.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // amf file load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/amf/rook.amf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // assimp file load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/assimp/octaminator/Octaminator.assimp" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // bvh file load - needed fitting. did that break other loads? | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/bvh/pirouette.bvh" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // dae file load - needed fitting. did that break other loads? collada | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/collada/elf/elf.dae" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | //need to do kinematics | ||
| + | //https://threejs.org/examples/webgl_loader_collada_kinematics.html | ||
| + | |||
| + | // dae file load - needed fitting. did that break other loads? collada with animation | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/collada/stormtrooper/stormtrooper.dae" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | |||
| + | // draco drc file load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/draco/bunny.drc" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // fbxfile load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/fbx/Samba Dancing.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // fbxfile load - nurbs | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/fbx/nurbs.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // gcode load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/gcode/benchy.gcode" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // kmz load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/kmz/Box.kmz" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // lwo load - change background to see the text which is in black | ||
| + | // or add screen background row | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["scene" , [ | ||
| + | ["background"], | ||
| + | [0xf0f0f0] | ||
| + | ], , , , ,], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/lwo/Objects/LWO3/Demo.lwo" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // nrrd and vtk load | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/nrrd/I.nrrd" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/liver.vtk" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // pcd | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/pcd/binary/Zaghetto.pcd" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // ply | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/ply/ascii/dolphins.ply" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/ply/binary/Lucy100k.ply" , [-20,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // prwm | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/prwm/smooth-suzanne.le.prwm" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/prwm/faceted-nefertiti.le.prwm" , [10,10,5] ,[10,10,10] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/prwm/vive-controller.le.prwm" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | |||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | // stl | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/stl/ascii/slotted_disk.stl" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/stl/binary/pr2_head_pan.stl" , [10,10,5] ,[10,10,10] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/stl/binary/pr2_head_tilt.stl" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/stl/binary/colored.stl" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | |||
| + | ] | ||
| + | ); | ||
| + | "" | ||
| + | |||
| + | //tilt | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/tilt/BRUSH_DOME.tilt" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | //tilt | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://github.com/mrdoob/three.js/blob/master/examples/models/tilt/BRUSH_DOME.tilt" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | // to test | ||
| + | //vox | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vox/monu10.vox" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | //vrm | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vrm/Alicia/AliciaSolid.vrm" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | //vrml | ||
| + | // other files to load | ||
| + | https://three.zcubes.com/examples/models/vrml/creaseAngle.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/crystal.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/house.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/elevationGrid1.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/elevationGrid2.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/extrusion1.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/extrusion2.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/extrusion3.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/lines.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/meshWithLines.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/meshWithTexture.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/pixelTexture.wrl | ||
| + | https://three.zcubes.com/examples/models/vrml/points.wrl | ||
| + | |||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vrml/house.wrl" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | // vtk and vtp | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/bunny.vtk" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/cube_ascii.vtp" , [3,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/cube_binary.vtp" , [10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"], | ||
| + | ["load" , "https://three.zcubes.com/examples/models/vtk/cube_no_compression.vtp" , [20,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | // x | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | //["load" , "https://three.zcubes.com/examples/models/xyz/helix_201.xyz" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ["load" , "https://three.zcubes.com/examples/models/xfile/SSR06_model.x" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | // teapot | ||
| + | RENDER3D( | ||
| + | [ | ||
| + | ["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ], | ||
| + | ["teapot" , , [-10,10,5] ,[20,5] , 0x00ff00 , "yellow" ,true , "phong"] | ||
| + | ] | ||
| + | ); | ||
| + | |||
| + | "" | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
</pre> | </pre> | ||
Revision as of 00:06, 28 December 2020
// 0-9 for animation trigger
// SHIFT+0-9 for animation trigger once
// simple sphere
RENDER3D(
[
["type" ],
["sphere"]
]
)
""
// simple color
RENDER3D(
[
["type" ,"fill"],
["sphere", "red"]
]
)
""
// simple color with helper
RENDER3D(
[
["type" ,"fill", "helper"],
["sphere", "red", true]
]
)
""
// planets
RENDER3D(
[
["type" ,"fill"],
["sphere", "jupiter"]
]
)
""
// planets - better looking
RENDER3D(
[
["type" ,"fill", "size"],
["sphere", "jupiter",[1,30,30]]
]
)
""
// sphere and cube - better looking
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["sphere", "jupiter",[1,30,30],[1,1,2]],
["cube", "jupiter",[1,30,30],[2,3,3]]
]
)
""
// sphere and cube flat earth - better looking
// and move them around and autorotate
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["sphere", "jupiter",[1,30,30],[1,1,2]],
["cube", "earth",[1,30,30],[2,3,3]]
]
)
""
// and move them around and autorotate
// on bg element
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["sphere", "jupiter",[1,30,30],[1,1,2]],
["cube", "earth",[1,30,30],[2,3,3]]
],"#bg"
)
""
// a set of spheres - color only for two - camera is not necessary
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[75 ,"auto" ,0.1 ,1000 , [50,50,50] , 3]
], , , , , ,],
["sphere" , , function t1(i){return([3*i,i*3,3])} ,[[5,50,50]] , 0x00ff00 , ["yellow","red"] ,true, , 10]
]
)
""
// a set of spheres - color only for two - camera is not necessary
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[75 ,"auto" ,0.1 ,1000 , [50,50,50] , 3]
], , , , , ,],
["sphere" , , function t1(i){return([3*i,i*3,3])} ,[[5,50,50]] , 0x00ff00 , "rainbow" ,true, , 10]
]
)
""
// colorsets to use (a few may need to be removed)
- reference https://github.com/d3/d3-scale-chromatic
12: "Rgb"
13: "RgbBasis"
14: "RgbBasisClosed"
15: "Hsl"
16: "HslLong"
17: "Lab"
18: "Hcl"
19: "HclLong"
20: "Cubehelix"
21: "CubehelixLong"
22: "Category10"
23: "Accent"
24: "Dark2"
25: "Paired"
26: "Pastel1"
27: "Pastel2"
28: "Set1"
29: "Set2"
30: "Set3"
31: "BrBG"
32: "BrBG"
33: "PRGn"
34: "PRGn"
35: "PiYG"
36: "PiYG"
37: "PuOr"
38: "PuOr"
39: "RdBu"
40: "RdBu"
41: "RdGy"
42: "RdGy"
43: "RdYlBu"
44: "RdYlBu"
45: "RdYlGn"
46: "RdYlGn"
47: "Spectral"
48: "Spectral"
49: "BuGn"
50: "BuGn"
51: "BuPu"
52: "BuPu"
53: "GnBu"
54: "GnBu"
55: "OrRd"
56: "OrRd"
57: "PuBuGn"
58: "PuBuGn"
59: "PuBu"
60: "PuBu"
61: "PuRd"
62: "PuRd"
63: "RdPu"
64: "RdPu"
65: "YlGnBu"
66: "YlGnBu"
67: "YlGn"
68: "YlGn"
69: "YlOrBr"
70: "YlOrBr"
71: "YlOrRd"
72: "YlOrRd"
73: "Blues"
74: "Blues"
75: "Greens"
76: "Greens"
77: "Greys"
78: "Greys"
79: "Purples"
80: "Purples"
81: "Reds"
82: "Reds"
83: "Oranges"
84: "Oranges"
85: "CubehelixDefault"
86: "Rainbow"
87: "Warm"
88: "Cool"
89: "Sinebow"
90: "Viridis"
91: "Magma"
92: "Inferno"
93: "Plasma"
// a set of spheres - color only for two - camera is not necessary - same but simpler function
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[75 ,"auto" ,0.1 ,1000 , [50,50,50] , 3]
], , , , , ,],
["sphere" , , (i,j)=>[3*i,j*3,3] ,[[[5,50,50]]] , 0x00ff00 , [["yellow","red"]] ,true, , |10,10|]
]
)
""
//working 2d
// how to make 3d array layout work - get this repaired
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[75 ,"auto" ,0.1 ,1000 , [50,50,50] , 3]
], , , , , ,],
["sphere" , , (i,j)=>[3*i,j*3,3] ,[[[5,50,50]]] , 0x00ff00 , [[colorbrewer.Reds[9]]] ,true, , |5,5,5|]
]
)
""
// 10 spheres, with better segmentation on spheres
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[275/*60 */ ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , ,],
["sphere" , , i=>[3*i+1,i*3+1,3] ,[[5,50,50]] , 0x00ff00 , colorbrewer.Reds[9] ,true, , 10]
//["sphere" , , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , ,]
]
)
""
// trying lion with background - need to see why scene background is stil black. could see after we changed environment
// needed to do ctrl+click but could not get the texture to change. maybe path? See why scene background did not work.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../objects3d/lion/lion.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// lion with scene grass background
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../objects3d/lion/lion.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// woman - need to work on selection etc
// as well as naming the object
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/examples/models/obj/female02/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// did not work
// render 3d
-need to figure this out
noofpoints=50;
pts=MAKEPOLYGONPOINTS(noofpoints,[100,100],[300,300],-90)
start=pts[0];
circlesat=
pts
.map(
p=>[p[0],p[1],SQRT(POWER(p[0]-start[0],2)+POWER(p[1]-start[1],2))]
)
RENDER3D(
[
["type","cx","cy","r","stroke","fill","stroke-width","count"],
["cube",circlesat.column(0),circlesat.column(1),circlesat.column(2), i=>d3.interpolateInferno(i/circlesat.length) ,i=>d3.interpolateInferno(i/circlesat.length),1,circlesat.length]
]
)
""
// extrude
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","extrude" ],
["path" , [[1,3,3],[2,3,3],[3,2,1]],[5,5,5] ,[50,50,50] , 0x00ff00 , "yellow" ,false , "phong",
[
["extrudePath"],
[[[1,2,0],[2,2,3],[3,3,0]]]
]
]
]
);""
// extrude testing heart
// did not work or moved into another one
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","extrude" ],
["heart" , , [[1,3,3],[2,3,3],[3,2,1]] ,[50,50,50] , 0x00ff00 , "yellow" ,false , "phong",
[
["extrudePath"],
[[[1,2,0],[2,2,3],[3,3,0]]]
]
]
]
);""
// extrude test // this worked with one curve
/*
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","extrude" ],
["extrudetest" , , [[1,3,3],[2,3,3],[3,2,1]] ,[50,50,50] , 0x00ff00 , "yellow" ,false , "phong",
[
["extrudePath"],
[[[1,2,0],[2,2,3],[3,3,0]]]
]
]
]
);""
*/
// extrude
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","extrude" ],
["extruder" ,[[1,3,3],[2,3,3],[3,2,1]], ,[1,1,1] , 0x00ff00 , "yellow" ,false , "phong",
[
["extrudePath"],
[[[1,2,0],[2,2,3],[33,3,0]]]
]
]
]
);""
// did not work
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material"],
["curve" ,"helix", ,[1,1,1] , 0x00ff00 , "yellow" ,false , "phong"
]
]
);""
// settings for curves can be any unique part of the name below
// size has scale as first parameter.
// curve gives you a line, know gives you a tube with material
/*
CinquefoilKnot
DecoratedTorusKnot4a
DecoratedTorusKnot4b
DecoratedTorusKnot5a
DecoratedTorusKnot5c
FigureEightPolynomialKnot
GrannyKnot
HeartCurve
HelixCurve
KnotCurve
TorusKnot
TrefoilKnot
TrefoilPolynomialKnot
VivianiCurve
*/
// grannyknot
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material"],
["knot" ,"granny", ,[1,1,1] , 0x00ff00 , "yellow" ,false , "phong"
]
]
);""
// trefoil knot and viviancurve
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material"],
["knot" ,"tre", ,[10,1,1] , 0x00ff00 , "yellow" ,false , "phong"],
["knot" ,"viv", ,[10,1,1] , 0x00ff00 , "red" ,false , "phong"]
]
);""
// visible and invisible object - marking objects to be invisible
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","visible"],
["knot" ,"tre", ,[10,1,1] , 0x00ff00 , "yellow" ,false , "phong",false],
["knot" ,"viv", ,[10,1,1] , 0x00ff00 , "red" ,false , "phong",true]
]
);""
// plane etc. may not work
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["planexy" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10]
]
);""
// with audio
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["audio" ,"../threefull/examples/sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg" , [1,3,3] ,[["loop","volume"],[true,0.8]] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// with positional audio
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["audio" ,"../threefull/examples/sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg" , [1,3,3] ,[["loop","volume","type","refdistance"],[true,0.8,"positional",20]] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// simple sphere
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
//https://stackoverflow.com/questions/15558418/how-do-you-save-an-image-from-a-three-js-canvas
// saving canvas to image
ReverseCanvasToImage
etc
// simple torusknot
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["torusknot" , , [1,3,3] ,[10,5,128,16,2,3] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// simple lathe // has issue
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["lathe" , [[0,0,0],[1,2,30],[2,20,3],[3,12,3],[10,10,2]] , [1,3,3] ,[10,0,6.28] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// need to pick bothside mesh material. how to make it default?
or at least for tube lathe etc.
// simple tube
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["tube" , [[0,0,0],[1,2,3],[2,2,3],[3,3,3],[10,10,2]] , [1,3,3] ,[20,2,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// simple icosahedron
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["icosahedron" , , [1,3,3] ,[10] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// sphere with normals and tangents
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","normals","tangents" ],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong",true,true]
]
);""
// tangents not showing with THREE.VertexTangentsHelper: geometry not an instance of THREE.BufferGeometry. error
// trying parametric geometry
// simple klein
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" , "klein" , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// mobius strip
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" , "mobius" , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// torus structure with mesh function
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
//a=3;
//b=1;
//c=1;
//d=1;
a=10;//*Math.Pi();
b=2;//*Math.Pi();//*Math.Pi()
var twopi=2*Math.PI;
var x=cos(u*twopi)*(a + b*cos(v*twopi))
var y=sin(u*twopi)*(a + b*cos(v*twopi))
var z=b*sin(v*twopi)
target.set(x,y,z)
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(x,y,target)
{
var xMin=-10;
var yMin=-10;
var xMax=10;
var yMax=10;
var a=1;
var b=1;
var xRange = xMax - xMin;
var yRange = yMax - yMin;
var x = xRange * x + xMin;
var y = yRange * y + yMin;
var z=sin(sqrt(a*x^2 + b*y^2))
target.set(x,y,z)
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// with zrange color
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(x,y,target)
{
var xMin=-10;
var yMin=-10;
var xMax=10;
var yMax=10;
var a=1;
var b=1;
var xRange = xMax - xMin;
var yRange = yMax - yMin;
var x = xRange * x + xMin;
var y = yRange * y + yMin;
var z=sin(sqrt(a*x^2 + b*y^2))
target.set(x,y,z)
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "zrange" ,false , "phong"]
]
);""
// asbestoes https://sites.google.com/site/cgwith3js/home/parametric-geometry
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
//a=3;
//b=1;
//c=1;
//d=1;
/*
a=10;//*Math.Pi();
b=2;//*Math.Pi();//*Math.Pi()
var twopi=2*Math.PI;
var x=cos(u*twopi)*(a + b*cos(v*twopi))
var y=sin(u*twopi)*(a + b*cos(v*twopi))
var z=b*sin(v*twopi)
//target.set(x,y,z)
*/
target.set(-100 + 200 * u, 3 * Math.sin(20 * (u + v)), -100 + 200 * v);
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// lissajous
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
var A=1;
var B=2;
var a=2;
var b=2;
var delta=Math.PI/2;//2;
var xi=2;
var x=A*Math.sin(a*(u)+delta)
//var y=B*Math.sin(b*(v)+xi)
var y=B*Math.sin(b*(v))
var z=0;//b*sin(v*twopi)
target.set(x,y,z);
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
-not yet working
// Dinis Surface https://mathworld.wolfram.com/DinisSurface.html
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
var a=1;
var b=0.2;
u=u*4*(Math.PI)
v=v*2;
x = a*COS(u)*SIN(v)
y = a*SIN(u)*SIN(v)
z = MIN(MAX(a*(COS(v)+LN(TAN(1/2*v)))+b*u,-100),100);
target.set(x,y,z);
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// Dinis Surface https://mathworld.wolfram.com/DinisSurface.html
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
var a=1;
var b=0.2;
u=u*4*(Math.PI)
v=v*2;
x = a*COS(u)*SIN(v)
y = a*SIN(u)*SIN(v)
z = MIN(MAX(a*(COS(v)+LN(TAN(1/2*v)))+b*u,-100),100);
target.set(x,y,z);
}
, [1,3,3] ,[5,5,50,50] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// trying walt with background
// need to see how the reflection etc. can be triggered
// as in https://threejs.org/examples/#webgl_materials_cubemap
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/examples/models/obj/walt/WaltHead.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// walt disney with normals - did not seem to trigger
// how to do this with obj async load?
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","normals" ,"tangents"],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/examples/models/obj/walt/WaltHead.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",5,15]
]
);
""
//todo
// https://threejs.org/examples/#webgl_materials
-blending just field blending with THREE.AdditiveBlending etc
materials.push( new THREE.MeshLambertMaterial( { map: texture, transparent: true } ) );
materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd } ) );
materials.push( new THREE.MeshPhongMaterial( { color: 0xdddddd, specular: 0x009900, shininess: 30, flatShading: true } ) );
materials.push( new THREE.MeshNormalMaterial() );
materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, transparent: true, blending: THREE.AdditiveBlending } ) );
materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd } ) );
materials.push( new THREE.MeshPhongMaterial( { color: 0xdddddd, specular: 0x009900, shininess: 30, map: texture, transparent: true } ) );
materials.push( new THREE.MeshNormalMaterial( { flatShading: true } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, wireframe: true } ) );
materials.push( new THREE.MeshDepthMaterial() );
materials.push( new THREE.MeshLambertMaterial( { color: 0x666666, emissive: 0xff0000 } ) );
materials.push( new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x666666, emissive: 0xff0000, shininess: 10, opacity: 0.9, transparent: true } ) );
materials.push( new THREE.MeshBasicMaterial( { map: texture, transparent: true } ) );
-https://threejs.org/examples/#webgl_loader_gltf_extensions
-ducks etc.
-reflection steel balls etc.
// simple catmullromcurve3 with editor
// need to see how to remove the spline points on unselect etc.
// fit view does not work for spline points, with only position, not the actual center of the spline curve
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["curve" , ,
[
[1,3,3],
[2,3,3],
[3,1,3],
[1,3,3],
] ,
[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"
]
]
);""
// animations - rpm, tpm and opm (rotations, times and orbit)
// simple cube rpm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", [["rpm"],[5]]]
]
);""
// simple cube tpm animation on a path
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong",
[
["rpm","tpm","points" ],
[5, 2, [[1,2,3],[2,3,4],[5,5,6]]]
]
]
]
);""
// simple cube tpm animation on a path
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", [["tpm","points"],[20,[[10,2,3],[20,3,4],[50,5,6]]]]]
]
);""
// orbit per minute
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong",
[
["opm" ,"r" ],
[20 ,10 ]
]
]
]
);""
// orbit per minute and rpm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong",
[
["opm" ,"r" ,"rpm"],
[20 ,10 , 100]
]
]
]
);""
// jupiter orbit per minute and rpm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
[
["opm" ,"r" ,"rpm"],
[20 ,100 , 100]
]
]
]
);""
// jupiter orbit per minute and rpm title etc. scale and rotation (in degrees)
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" , "rotation","scale"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
[
["opm" ,"r" ,"rpm"],
[20 ,100 , 100]
],
[0 ,23 , 0] ,
[1 ,1 , 1]
]
]
);""
// jupiter orbit per minute and rpm title etc. scale and rotation (in degrees)
// camera animation
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["camera" ,
[
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , , ,
[
["rpm"],
[ 100]
]
],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
[
["rpm"],
[ 100]
]
]
]
);""
// camera rotation
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["camera" ,
[
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , , ,
[
["rpm"],
[ 10]
]
],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
[
["rpm"],
[ 5]
]
]
]
);""
// get the camera on the scene here
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["camera" ,
[
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , , ,
[
["rpm"],
[ 10]
]
],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
]
]
);""
// get the camera on the scene here
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["camera" ,
[
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , , ,
[
["tpm","points"],
[2,[[1,2,3],[2,3,4],[5,5,6]]]
]
],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
]
]
);""
// simple sphere and mirror cube
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "mirror"],
["sphere" , , [10,5,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// circular mirror
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["circle" , , [1,3,3] ,[50,50,50] , 0x00ff00 , "yellow" ,false , "mirror"],
["sphere" , , [10,5,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// grid and sphere
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);
""
// grid and sphere - zrange color like https://stemkoski.github.io/Three.js/Graphulus-Function.html
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "zrange" ,false , "phong"]
]
);""
//zrange is not kicking in.
//zrange is not working on ParameterBufferGeometry. On https://stemkoski.github.io/Three.js/Graphulus-Function.html it was ParameterGeometry
-need to follow up
// grid and sphere uv color
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "uv" ,false , "phong"]
]
);
""
// painting texture
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "painting" ,false , "phong"]
]
);
""
// jupiter, earth etc.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong"],
["sphere" , , [12,3,3] ,[5,20,20] , 0x00ff00 , "earth" ,false , "phong"]
]
);
""
// physics not working due to ammo issues. see how to resolve. the threeful copy of example is not working
// should we get from https://github.com/kripken/ammo.js?
or should we try https://schteppe.github.io/cannon.js/?
// should possibly switch to cannonjs
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [1,150,130] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,300,230] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floorxy" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["flooryz" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["floorxz" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [1,15,13] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,30,23] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
// at least oriented right
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[50,1,50] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [1,15,13] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,30,23] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["load" , "../threefull/examples/models/gltf/RobotExpressive/RobotExpressive.glb" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"]
]
);
""
// xbot
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["load" , "../threefull/examples/models/gltf/Xbot.glb" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"]
]
);
""
// soldier test from config
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["load" , "soldier" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"]
]
);
""
// parrot
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["load" , "parrot" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
],
["ground" , [
["type","width","height"],
["checkerboard",1000,1000]
],
]
]
);
""
//ground
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
],
["ground" , [
["type","width","height"],
["grass",1000,1000]
],
],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["light" ,
[
["type" , "color", "intensity", "width", "height"],
["rectarealight" , "red", 0.6, 10, 10]
] ,
[1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
)
""
//rect light
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["light" ,
[
["type" , "color", "intensity", "width", "height"],
["rectarealight" , "red", 0.6, 10, 10]
] ,
[1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
)
""
// fog
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
],
["fog" , [
["color","near","far"],
["red",10,2000]
],
, , , , ,],
/* ["fog" , [
["color","density"],
["red",0.1]
],
, , , , ,],
*/
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["light" ,
[
["type" , "color", "intensity", "distance", "decay"],
["pointlight" , "red", 0.6, 100, 2]
] ,
[1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
)
""
//sphere and light works
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["light" ,
[
["type" , "color", "intensity", "distance", "decay"],
["pointlight" , "red", 0.6, 100, 2]
] ,
[1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
)
""
//text
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["text" , "ZCubes" , [3,3,3] ,[5,2,20] , 0x00ff00 , "yellow" ,true , "backgroundreflection"]
]
)
""
// bevelled text
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["text" , "ZCubes" , [3,3,3] ,[5,2,20,true] , 0x00ff00 , "yellow" ,true , "backgroundreflection"]
]
)
""
// background and sphere with reflection
// did not seem to work
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["pisa"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
//["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"],
["sphere" , , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , "backgroundreflection"]
]
)
""
// svg load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["white"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["load" , "../threefull/examples/models/svg/tiger.svg" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ]
]
)
""
// pdb load
// it did not show the letters. did the css2d not work?
// need to figure out how CSS2DObject works to show the labels
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["white"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["load" , "../threefull/examples/models/pdb/aspirin.pdb" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ]
]
)
""
// pdb load
// it did not show the letters. did the css2d not work?
// need to figure out how CSS2DObject works to show the labels
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["transparent"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["load" , "../threefull/examples/models/pdb/aspirin.pdb" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ]
]
)
""
// svg monalisa load
//if monalisa svg was assigned, this was loaded, but was not visible until pisa was made background then could see it
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["white"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["load.svg" , monalisa , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ]
]
)
""
-fbx load - had to change the path for mimetype allowed.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
/*["scene" , [
["background"],
["pisa"]
],
, , , , ,],
*/
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[275/*60 */ ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
//["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"],
["load" , "../threefull/examples/models/fbx/Samba Dancing.fbx" , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , ]
]
)
-fbx load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
/*["scene" , [
["background"],
["pisa"]
],
, , , , ,],
*/
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[275/*60 */ ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
//["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"],
["load" , "https://three.zcubes.com/examples/models/fbx/Samba Dancing.fbx" , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , ]
]
)
//RENDER3DDEV(
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["pisa"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
//["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"],
["sphere" , , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , "backgroundreflection"]
]
)
""
// multiple spheres
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[75 ,"auto" ,0.1 ,1000 , [50,50,50] , 3]
], , , , , ,],
["sphere" , , i=>[3*i,i*3,3] ,[5,50,50] , 0x00ff00 , ["yellow","red"] ,true, , 10]
]
)
""
// simpler multiple spheres - size gets confusing. check next one.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,[5,50,50] , 0x00ff00 , ["yellow","red"] ,true, , 10]
]
)
""
// simpler multiple spheres - size better
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[5,50,50] , 0x00ff00 , "yellow" ,true, , 10]
]
)
""
// smaller sphere
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[1,50,50] , 0x00ff00 , "yellow" ,true, , 10]
]
)
""
// smaller sphere normal colors
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[1,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10]
]
)
""
// smaller sphere normal colors - varying radii
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[1*i,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10]
]
)
""
// smaller sphere normal colors - varying radii slight - 0 radius defaults to 1
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10]
]
)
""
// smaller sphere normal colors - varying radii slight - 0 radius defaults to 1 adjusted by a small amount
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i+0.01,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10]
]
)
""
// smaller sphere normal colors - varying colors from interpolate d3
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i+0.01,50,50] , 0x00ff00 , i=>d3.interpolateInferno(i/10) ,true, "phong", 10]
]
)
""
// smaller sphere normal colors - varying colors from interpolate d3 2d
// looks like rocks
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , (i,j)=>[3*i,j*3,3] ,(i,j)=>[0.3*i+0,2*j+0.01,50,50] , 0x00ff00 , (i,j)=>d3.interpolateInferno((i+j)/10) ,true, "phong", |6,4|]
]
)
""
// varying size varying colors from interpolate d3 2d
// looks like rocks
// material can have other properties in subarray. how to loop this?
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , (i,j)=>[3*i,j*3,3] ,(i,j)=>[0.3*i+0.2*j+0.01,50,50] , 0x00ff00 , (i,j)=>d3.interpolateInferno((i+j)/10) ,true, "phong", |6,4|]
]
)
""
// planets
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[10*i,0,0] ,(i,j)=>[5,50,50] , 0x00ff00 , PLANETS ,true, "phong", PLANETS.length]
]
)
""
// new items
//https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_video_webcam.html
// webcam
RENDER3D(
[
["type" ,"fill", "size"],
["sphere", "webcam",[1,30,30]] // user direction
]
)
""
// load objects with ferrari, and do this to rotate the wheels. on #bg
RENDER3D(
[
["type" , "name" , "animation" ],
["change" , "wheel_fl" , [["rpmx"],[-60]] ],
["change" , "wheel_fr" , [["rpmx"],[-60]] ],
["change" , "wheel_rl" , [["rpmx"],[-60]] ],
["change" , "wheel_rr" , [["rpmx"],[-60]] ]
],
"#bg"
);""
// rose 2
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["load" , "../threefull/other/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// gave black
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"aut" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// rose seems to work better
// mtl file needs to be moved around for values like each line in mtl
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// gave black
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose2/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//glb shows rose right. really tiny and had to be scaled. why?
// made scale to be 10
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
//alien obj file
// why is it so far to the top?
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/alien/alien.obj" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
//cubes fbx file. did not work since this is old version
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cubes/cubes.fbx" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
//cubes glb file. did not work since this is old version
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cubes/cubes.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
//glb rendered, flb had issues with transparency
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower 2.gltf" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower 5.gltf" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
// physics started working after quaternion of plane was set 2:15 PM 12/8/2020
// basics work in this
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[500,1,500] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [0,10,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,10,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
-still some axis confusion, or camera confusion.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [0,100,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,100,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
-look better
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [0,10,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,20,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
// fruits
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/fruits/apple and orange.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// cups
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cups/cup.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// nightsky
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["nightsky" , , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// annotation test
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[0,0,-15]]
]
, [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
//["nightsky" , , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// annotation test
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[-11,9,5]]
]
, [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
// shows annotation test -wip
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[-11,9,5]]
]
, [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
// annotation test
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[0,0,-15]]
]
, [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[4,4,-2]]
]
, [5,5,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
// html - these positioning did not seem correct. see why.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["html" ,
"<div>TEST</div>"
, [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["html" ,
"<div>TEST2</div>"
, [2,2,2] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["html" ,
"<div>TEST2</div>"
, [4,4,2] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
// html - these positioning did not seem correct. see why.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["html" ,
"<div style='font-size:8px'>TEST</div>"
, [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["html" ,
"<div style='font-size:8px'>TEST2</div>"
, [20,2,20] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["html" ,
"<div style='font-size:8px'>TEST2</div>"
, [40,4,42] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
LOAD("elements");
els=ELEMENT(1..118)
// html - these positioning did not seem correct. see why.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" , els.map(e=>e.toString()), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118]
]
);
""
// this did not work correctly
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" , els.map(e=>e.SYMBOL), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118]
]
);
""
// this is too large as font. need to see what to do to make it right
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" , els.map(e=>"<div>"+e.SYMBOL+"</div>"), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118]
]
);
""
// this does not work find out why.
// el.add(elchild) seems to be undefined
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
"<div style='font-size:8px'>TEST</div>"
, SPHERICALPOINTS(20,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 20]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
"<div style='font-size:8px'>TEST</div>"
, SPHERICALPOINTS(20,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 20]
]
);
""
// works
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
"TEST"
, SPHERICALPOINTS(117,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 117]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
"TEST"
, HELICALPOINTS(118,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
// element names in helical format
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
ELEMENT(1..118).map(e=>e+"")
, HELICALPOINTS(118,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
}
)
// element names in double helical format with 90 deg rotation
helix1=HELICALPOINTS(118,100);
helix2=ROTATEPOINTS(helix1);
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
ELEMENT(1..118).map(e=>e+""), helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118],
["html" ,
ELEMENT(1..118).map(e=>e+""), helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
}
)
// element names in double helical format
helix1=HELICALPOINTS(118,100);
helix2=ROTATEPOINTS(helix1,Math.PI);
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
ELEMENT(1..118).map(e=>e+""), helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118],
["html" ,
ELEMENT(1..118).map(e=>e+""), helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
}
)
// dna in double helical format
// d1="ATCG";
// d2="TAGC";
// dna=(1..100@(function (){var r=RANDINT(4);return([d1[r],d2[r]])}) )~;
d1="ATCG";
d2="TAGC";
d=(1..100@(function (){var r=RANDINT(4);return([d1[r],d2[r]])}) )~;
dna=(d[0]~);//.print()
helix1=HELICALPOINTS(118,100);
helix2=ROTATEPOINTS(helix1,Math.PI);
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
dna[0], helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 100],
["html" ,
dna[1], helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 100]
]
);
""
}
)
// element names in helical format with conical angle
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
ELEMENT(1..118).map(e=>e+"")
, SCALEPOINTS(HELICALPOINTS(118,100),1..118@(x=>x/118)) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
}
)
// annotation still wip
// annotation test
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[0,0,-15]]
]
, [0,0,0] ,[1.5,1,1] , 0x00ff00 , ,true , "phong"],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[4,4,-2]]
]
, [5,5,0] ,[1.5,1,1] , 0x00ff00 , ,true , "phong"],
]
);
""
// how to get rid of the yellow area etc. and get the camera to zoom in right
// point
// sphere and cube - better looking
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["point", "red",[1,30,30],
[
[1,1,2],
[2,1,2],
[3,1,2]
], [["size"],[0.1]] ]
]
)
""
// points
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["points", "red",[1,30,30],
1..100@(x=>[x,1,x]), [["size"],[0.05]] ]
]
)
""
// points
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["points", "red",[1,30,30],
1..100@(x=>[x,1,x]) .map(x=>x[0]) , [["size"],[0.5]] ]
]
)
""
// line test
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["line", "red",[1,30,30],[[0,0,0][1,1,1],[4,4,2]]]
]
)
""
// lines
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],[[[1,1,2],[2,3,4]],[12,3,4],[4,5,5]]],
["lines", "yellow",[4,30,30],[[[3,3,2],[4,4,4]],[1,3,4],[14,5,15]]]
]
)
""
// lines from stem to sphere
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],SPHERICALPOINTS(118,800).rays()]
]
)
""
// not showing anything. why? lines from stem to sphere
// is it radius? The group is being made etc.
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],SPHERICALPOINTS(18,5).rays()]
]
)
""
// lines from stem to sphere
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).rays()]
]
)
""
// lines from conical tree with scale
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],SCALEPOINTS(HELICALPOINTS(118,800),1..118.map(x=>1/x)).rays()]
]
)
""
// try subpoints using add
// lines from stem to sphere
// did not work
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],ADDPOINTS(HELICALPOINTS(118,800),1..118.map(x=>-x)).rays()]
]
)
""
// try subpoints using add
// lines from stem to sphere
// did not work
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>-x))]
]
)
""
// rayscale etc
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>-x))]
]
)
""
// rayscale etc
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>1/x))]
]
)
""
// rayscale etc conical christmas tree
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))]
]
)
""
// rayscale etc with many colors
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "rainbow",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))]
]
)
""
// rayscale etc with many colors like a fruit
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))]
]
)
""
// rayscale etc with many colors like a fruit with center
// like a flower. note [[]] on material not to split settings array
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["lines", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118),"center"),
[
[
["type","linewidth"],
["line",3]
]
]
]
]
)
""
// rayscale etc with many colors like a fruit with center
// like a flower. note [[]] on material not to split settings array
// line2 is not working well
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["line2s", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118),"center"),
[
[
["linewidth"],
[3]
]
]
]
]
)
""
// points with lookat
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["points", "red",[1,30,30],
SPHERICALPOINTS(118,10).rayslookat(), [["size"],[0.1]] ]
]
)
""
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["points", "red",[1,30,30],
SPHERICALPOINTS(118,10).rayslookat(), [["size"],[0.1]] ]
]
)
""
// place rectangles at spherical points with lookat defined
pts=SPHERICALPOINTS(118,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat"],
["cube", "red",[1,1,1], pts, "phong",pts.rayslookat() ]
]
)
""
// sphere of cubes...
pts=SPHERICALPOINTS(118,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "red",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// small cubes did not seem to change
pts=SPHERICALPOINTS(118,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "red",[0.1,0.1,0.1], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// sphere from small balls
pts=SPHERICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "red",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
// random colors on spheres
pts=SPHERICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "random",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// interesting shape like a cross with stuff in the middle
pts=SPHERICALPOINTS(130,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "reds",[1,15,15], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// interesting sphere
pts=SPHERICALPOINTS(130,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "reds",[[1,15,15]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// random colors on spheres
pts=SPHERICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "random",[[1,10,10]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// random colors on spheres
pts=SPHERICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "random",[[1,1,1]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,0.10,0.10]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS(5,2);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[1,10,10]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS(5,20);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,1,1]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS(50,20);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[10,10,10]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes around center at same level
pts=HELICALPOINTS(5,2,5,0);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
// (maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset)
pts=HELICALPOINTS(50,2,5,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes in separate levels
pts=HELICALPOINTS(50,2,5,0,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes rainbow colors with lookat
pts=HELICALPOINTS(50,20,5,0,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "rainbow",[[15.1,5,15]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS([50,100],20,5,0,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "rainbow",[[15.1,5,15]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes in concentric circles
pts=HELICALPOINTS(20,[50,100],5,8,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical sphere in concentric circles, with triangular shapes
pts=HELICALPOINTS(20,[5,15],5,8,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical spheres with random radii
pts=HELICALPOINTS(20,[50,100],5,8,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "rainbow",x=>[RANDOM(5),10,5], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// simple sphere and viewport
// not working yet
// added controls and still has issues
RENDER3D(
[
["type" ],
["sphere"],
["viewport"]
]
)
""
// flower like helical sphere in concentric circles, with triangular shapes
pts=HELICALPOINTS(20,5,20,0);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
//HELICALPOINTS(maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset,requirednumberofpoints)
// flowerlike helical sphere in concentric circles, with triangular shapes
pts=HELICALPOINTS(20,15,20,0);
angles=radpiby20;
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count","rotation"],
["sphere", "rainbow",[[5,1,3]], pts, "phong",pts.rayslookat() ,pts.length,i=>[angles[i],0,0] ]
]
)
""
//HELICALPOINTS(maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset,requirednumberofpoints)
// flowerlike helical sphere in concentric circles, with triangular shapes with rotation
pts=HELICALPOINTS(20,15,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count","rotation"],
["sphere", "rainbow",[[5,1,3]], pts, "phong",pts.rayslookat() ,pts.length,i=>[angles[i],0,0] ]
]
)
""
// flowerlike helical sphere in concentric tetrahedrons, with triangular shapes
// note lookatdeactivated so that it does not affect the set rotations
// could use this for the json object display from crockford
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookatdeactivated","count","rotation"],
["tetrahedron", "rainbow",[[5]], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ]
]
)
""
// flowerlike helical sphere with tubes to get json emblem. note the use of settings to define tube
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"],
["tube", "rainbow",[[[-10,-10],[10,10],[0,0]]], [5], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes - try 2
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"],
["tube", "rainbow",[[[-10,-10],[10,10],[10,-10],[-10,10],[-10,-10]]], [5], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes - try 3
// segments can be used for flower marigold
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"],
["tube", "rainbow",[[[0,0],[6,0],[3,2.2427336738541745]]], [1], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes try 4
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,6,0],[0,3,2.2427336738541745],[0,0,0]]], [15,10,10], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,0,angles[i]]]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes try 5
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [15,10,10], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes try 5
// size should be in two d array if i loop
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [[2,10,10]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes try 6 thin edges of tube
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [[5,0.1,5]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]]
]
)
""
// crayon like tubes
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745]]], [[2,1,50,true]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]]
]
)
""
// render download command
RENDER(
[
["type","cx", "cy", "r","coordinates","label","fill","stroke","stroke-width","font-size","format"],
["circle",100,100,60,,,"purple","purple"],
["circle",100,100,30,,,"white","white"],
["text",,,,[90,65],"1",,"black",3,40],
["download",,,,[90,65],"1",,"black",3,40,"png"]
]);
""
//A forest of trees
// RENDER3D(
// [
// ["type" ,"fill", "size", "coordinates","material","count"],
// ["tree", "red",[1,30,30],
// 1..100@(x=>[x,1,x]), [["size"],[0.05]],15 ]
// ]
// )
// ""
//1..100@(x=>[x,1,x]) would not work as it gives arrays within arrays
//A row of trees
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","count"],
["tree", "red",[1,30,30],
(x=>[x,1,x]), [["size"],[0.05]],15 ]
]
)
""
// forest of trees. notice [[size]]
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",[[1,30,30]],
((x,y)=>[x,0,y]),IM(15) ]
]
)
""
// forest of trees.trying different size
// this did not work as well
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",((x,y)=>[RANDINT(100),x,y]),
((x,y)=>[x,0,y]),IM(15) ]
]
)
""
// forest of trees. works. trying different size
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",((x,y)=>[RANDINT(10)]),
((x,y)=>[x*RANDINT(10),0,y*RANDINT(10)]),IM(15) ]
]
)
""
// one big tree
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",((x,y)=>[RANDINT(100)]),
,IM(15) ]
]
)
""
// one big tree
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",((x,y)=>[RANDINT(100)]),
,50 ]
]
)
""
// one big tree - different height cover etc.
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",[1..5,(50..1..-10)]~,
,5 ]
]
)
""
// loading different formats
// 3dm files
// loads though looks rotated on x axis. can expand on idea as in https://threejs.org/examples/webgl_loader_3dm.html
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/3dm/Rhino_Logo.3dm" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// 3dm files
// loads though looks rotated on x axis. can expand on idea
// need to see if colors normal etc load right or else get it loaded
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" ,
[
["url","normal"],
[
"https://three.zcubes.com/examples/models/3ds/portalgun/portalgun.3ds" ,
"https://three.zcubes.com/examples/models/3ds/portalgun/textures/normal.jpg"
]
]
,
[-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// 3mf files
// loads though looks rotated on x axis. can expand on idea
// other links to use
//"https://three.zcubes.com/examples/models/3mf/facecolors.3mf"
//"https://three.zcubes.com/examples/models/3mf/multipletextures.3mf"
//"https://three.zcubes.com/examples/models/3mf/vertexcolors.3mf"
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/3mf/cube_gears.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/3mf/multipletextures.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/3mf/truck.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// amf file load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/amf/rook.amf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// assimp file load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/assimp/octaminator/Octaminator.assimp" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// bvh file load - needed fitting. did that break other loads?
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/bvh/pirouette.bvh" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// dae file load - needed fitting. did that break other loads? collada
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/collada/elf/elf.dae" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//need to do kinematics
//https://threejs.org/examples/webgl_loader_collada_kinematics.html
// dae file load - needed fitting. did that break other loads? collada with animation
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/collada/stormtrooper/stormtrooper.dae" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// draco drc file load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/draco/bunny.drc" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// fbxfile load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/fbx/Samba Dancing.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// fbxfile load - nurbs
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/fbx/nurbs.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// gcode load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/gcode/benchy.gcode" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// kmz load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/kmz/Box.kmz" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// lwo load - change background to see the text which is in black
// or add screen background row
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["load" , "https://three.zcubes.com/examples/models/lwo/Objects/LWO3/Demo.lwo" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// nrrd and vtk load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/nrrd/I.nrrd" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/vtk/liver.vtk" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// pcd
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/pcd/binary/Zaghetto.pcd" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// ply
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/ply/ascii/dolphins.ply" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/ply/binary/Lucy100k.ply" , [-20,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// prwm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/prwm/smooth-suzanne.le.prwm" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/prwm/faceted-nefertiti.le.prwm" , [10,10,5] ,[10,10,10] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/prwm/vive-controller.le.prwm" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// stl
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/stl/ascii/slotted_disk.stl" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/stl/binary/pr2_head_pan.stl" , [10,10,5] ,[10,10,10] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/stl/binary/pr2_head_tilt.stl" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/stl/binary/colored.stl" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//tilt
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/tilt/BRUSH_DOME.tilt" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//tilt
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://github.com/mrdoob/three.js/blob/master/examples/models/tilt/BRUSH_DOME.tilt" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// to test
//vox
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/vox/monu10.vox" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//vrm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/vrm/Alicia/AliciaSolid.vrm" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//vrml
// other files to load
https://three.zcubes.com/examples/models/vrml/creaseAngle.wrl
https://three.zcubes.com/examples/models/vrml/crystal.wrl
https://three.zcubes.com/examples/models/vrml/house.wrl
https://three.zcubes.com/examples/models/vrml/elevationGrid1.wrl
https://three.zcubes.com/examples/models/vrml/elevationGrid2.wrl
https://three.zcubes.com/examples/models/vrml/extrusion1.wrl
https://three.zcubes.com/examples/models/vrml/extrusion2.wrl
https://three.zcubes.com/examples/models/vrml/extrusion3.wrl
https://three.zcubes.com/examples/models/vrml/lines.wrl
https://three.zcubes.com/examples/models/vrml/meshWithLines.wrl
https://three.zcubes.com/examples/models/vrml/meshWithTexture.wrl
https://three.zcubes.com/examples/models/vrml/pixelTexture.wrl
https://three.zcubes.com/examples/models/vrml/points.wrl
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/vrml/house.wrl" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// vtk and vtp
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/vtk/bunny.vtk" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/vtk/cube_ascii.vtp" , [3,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/vtk/cube_binary.vtp" , [10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/vtk/cube_no_compression.vtp" , [20,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// x
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
//["load" , "https://three.zcubes.com/examples/models/xyz/helix_201.xyz" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"]
["load" , "https://three.zcubes.com/examples/models/xfile/SSR06_model.x" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// xyz
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
//["load" , "https://three.zcubes.com/examples/models/xyz/helix_201.xyz" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"]
["load" , "../threefull/other/examples/helix_201.xyz" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" , "klein" , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// mobius strip
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" , "mobius" , [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// torus structure with mesh function
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
//a=3;
//b=1;
//c=1;
//d=1;
a=10;//*Math.Pi();
b=2;//*Math.Pi();//*Math.Pi()
var twopi=2*Math.PI;
var x=cos(u*twopi)*(a + b*cos(v*twopi))
var y=sin(u*twopi)*(a + b*cos(v*twopi))
var z=b*sin(v*twopi)
target.set(x,y,z)
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(x,y,target)
{
var xMin=-10;
var yMin=-10;
var xMax=10;
var yMax=10;
var a=1;
var b=1;
var xRange = xMax - xMin;
var yRange = yMax - yMin;
var x = xRange * x + xMin;
var y = yRange * y + yMin;
var z=sin(sqrt(a*x^2 + b*y^2))
target.set(x,y,z)
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// with zrange color
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(x,y,target)
{
var xMin=-10;
var yMin=-10;
var xMax=10;
var yMax=10;
var a=1;
var b=1;
var xRange = xMax - xMin;
var yRange = yMax - yMin;
var x = xRange * x + xMin;
var y = yRange * y + yMin;
var z=sin(sqrt(a*x^2 + b*y^2))
target.set(x,y,z)
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "zrange" ,false , "phong"]
]
);""
// asbestoes https://sites.google.com/site/cgwith3js/home/parametric-geometry
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
//a=3;
//b=1;
//c=1;
//d=1;
/*
a=10;//*Math.Pi();
b=2;//*Math.Pi();//*Math.Pi()
var twopi=2*Math.PI;
var x=cos(u*twopi)*(a + b*cos(v*twopi))
var y=sin(u*twopi)*(a + b*cos(v*twopi))
var z=b*sin(v*twopi)
//target.set(x,y,z)
*/
target.set(-100 + 200 * u, 3 * Math.sin(20 * (u + v)), -100 + 200 * v);
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// lissajous
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
var A=1;
var B=2;
var a=2;
var b=2;
var delta=Math.PI/2;//2;
var xi=2;
var x=A*Math.sin(a*(u)+delta)
//var y=B*Math.sin(b*(v)+xi)
var y=B*Math.sin(b*(v))
var z=0;//b*sin(v*twopi)
target.set(x,y,z);
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
-not yet working
// Dinis Surface https://mathworld.wolfram.com/DinisSurface.html
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
var a=1;
var b=0.2;
u=u*4*(Math.PI)
v=v*2;
x = a*COS(u)*SIN(v)
y = a*SIN(u)*SIN(v)
z = MIN(MAX(a*(COS(v)+LN(TAN(1/2*v)))+b*u,-100),100);
target.set(x,y,z);
}
, [1,3,3] ,[5,5,20,20] , 0x00ff00 , "yellow" ,false , "normal"]
]
);""
// Dinis Surface https://mathworld.wolfram.com/DinisSurface.html
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["parametricgeometry" ,
function mf(u,v,target)
{
var a=1;
var b=0.2;
u=u*4*(Math.PI)
v=v*2;
x = a*COS(u)*SIN(v)
y = a*SIN(u)*SIN(v)
z = MIN(MAX(a*(COS(v)+LN(TAN(1/2*v)))+b*u,-100),100);
target.set(x,y,z);
}
, [1,3,3] ,[5,5,50,50] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// trying walt with background
// need to see how the reflection etc. can be triggered
// as in https://threejs.org/examples/#webgl_materials_cubemap
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/examples/models/obj/walt/WaltHead.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// walt disney with normals - did not seem to trigger
// how to do this with obj async load?
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","normals" ,"tangents"],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/examples/models/obj/walt/WaltHead.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",5,15]
]
);
""
//todo
// https://threejs.org/examples/#webgl_materials
-blending just field blending with THREE.AdditiveBlending etc
materials.push( new THREE.MeshLambertMaterial( { map: texture, transparent: true } ) );
materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd } ) );
materials.push( new THREE.MeshPhongMaterial( { color: 0xdddddd, specular: 0x009900, shininess: 30, flatShading: true } ) );
materials.push( new THREE.MeshNormalMaterial() );
materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, transparent: true, blending: THREE.AdditiveBlending } ) );
materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd } ) );
materials.push( new THREE.MeshPhongMaterial( { color: 0xdddddd, specular: 0x009900, shininess: 30, map: texture, transparent: true } ) );
materials.push( new THREE.MeshNormalMaterial( { flatShading: true } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, wireframe: true } ) );
materials.push( new THREE.MeshDepthMaterial() );
materials.push( new THREE.MeshLambertMaterial( { color: 0x666666, emissive: 0xff0000 } ) );
materials.push( new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x666666, emissive: 0xff0000, shininess: 10, opacity: 0.9, transparent: true } ) );
materials.push( new THREE.MeshBasicMaterial( { map: texture, transparent: true } ) );
-https://threejs.org/examples/#webgl_loader_gltf_extensions
-ducks etc.
-reflection steel balls etc.
// simple catmullromcurve3 with editor
// need to see how to remove the spline points on unselect etc.
// fit view does not work for spline points, with only position, not the actual center of the spline curve
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["curve" , ,
[
[1,3,3],
[2,3,3],
[3,1,3],
[1,3,3],
] ,
[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"
]
]
);""
// animations - rpm, tpm and opm (rotations, times and orbit)
// simple cube rpm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", [["rpm"],[5]]]
]
);""
// simple cube tpm animation on a path
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong",
[
["rpm","tpm","points" ],
[5, 2, [[1,2,3],[2,3,4],[5,5,6]]]
]
]
]
);""
// simple cube tpm animation on a path
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", [["tpm","points"],[20,[[10,2,3],[20,3,4],[50,5,6]]]]]
]
);""
// orbit per minute
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong",
[
["opm" ,"r" ],
[20 ,10 ]
]
]
]
);""
// orbit per minute and rpm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong",
[
["opm" ,"r" ,"rpm"],
[20 ,10 , 100]
]
]
]
);""
// jupiter orbit per minute and rpm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
[
["opm" ,"r" ,"rpm"],
[20 ,100 , 100]
]
]
]
);""
// jupiter orbit per minute and rpm title etc. scale and rotation (in degrees)
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" , "rotation","scale"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
[
["opm" ,"r" ,"rpm"],
[20 ,100 , 100]
],
[0 ,23 , 0] ,
[1 ,1 , 1]
]
]
);""
// jupiter orbit per minute and rpm title etc. scale and rotation (in degrees)
// camera animation
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["camera" ,
[
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , , ,
[
["rpm"],
[ 100]
]
],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
[
["rpm"],
[ 100]
]
]
]
);""
// camera rotation
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["camera" ,
[
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , , ,
[
["rpm"],
[ 10]
]
],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
[
["rpm"],
[ 5]
]
]
]
);""
// get the camera on the scene here
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["camera" ,
[
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , , ,
[
["rpm"],
[ 10]
]
],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
]
]
);""
// get the camera on the scene here
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "animation" ],
["camera" ,
[
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , , , ,
[
["tpm","points"],
[2,[[1,2,3],[2,3,4],[5,5,6]]]
]
],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong",
]
]
);""
// simple sphere and mirror cube
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["cube" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "mirror"],
["sphere" , , [10,5,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// circular mirror
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["circle" , , [1,3,3] ,[50,50,50] , 0x00ff00 , "yellow" ,false , "mirror"],
["sphere" , , [10,5,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);""
// grid and sphere
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
);
""
// grid and sphere - zrange color like https://stemkoski.github.io/Three.js/Graphulus-Function.html
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "zrange" ,false , "phong"]
]
);""
//zrange is not kicking in.
//zrange is not working on ParameterBufferGeometry. On https://stemkoski.github.io/Three.js/Graphulus-Function.html it was ParameterGeometry
-need to follow up
// grid and sphere uv color
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "uv" ,false , "phong"]
]
);
""
// painting texture
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "painting" ,false , "phong"]
]
);
""
// jupiter, earth etc.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "jupiter" ,false , "phong"],
["sphere" , , [12,3,3] ,[5,20,20] , 0x00ff00 , "earth" ,false , "phong"]
]
);
""
// physics not working due to ammo issues. see how to resolve. the threeful copy of example is not working
// should we get from https://github.com/kripken/ammo.js?
or should we try https://schteppe.github.io/cannon.js/?
// should possibly switch to cannonjs
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [1,150,130] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,300,230] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floorxy" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["flooryz" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["floorxz" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [1,15,13] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,30,23] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
// at least oriented right
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[50,1,50] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [1,15,13] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,30,23] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["load" , "../threefull/examples/models/gltf/RobotExpressive/RobotExpressive.glb" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"]
]
);
""
// xbot
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["load" , "../threefull/examples/models/gltf/Xbot.glb" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"]
]
);
""
// soldier test from config
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["load" , "soldier" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"]
]
);
""
// parrot
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
["load" , "parrot" , [1,3,3] ,[5,20,20] , 0x00ff00 , ,false , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
],
["ground" , [
["type","width","height"],
["checkerboard",1000,1000]
],
]
]
);
""
//ground
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
],
["ground" , [
["type","width","height"],
["grass",1000,1000]
],
],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["light" ,
[
["type" , "color", "intensity", "width", "height"],
["rectarealight" , "red", 0.6, 10, 10]
] ,
[1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
)
""
//rect light
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["light" ,
[
["type" , "color", "intensity", "width", "height"],
["rectarealight" , "red", 0.6, 10, 10]
] ,
[1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
)
""
// fog
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
],
["fog" , [
["color","near","far"],
["red",10,2000]
],
, , , , ,],
/* ["fog" , [
["color","density"],
["red",0.1]
],
, , , , ,],
*/
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["light" ,
[
["type" , "color", "intensity", "distance", "decay"],
["pointlight" , "red", 0.6, 100, 2]
] ,
[1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
)
""
//sphere and light works
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["light" ,
[
["type" , "color", "intensity", "distance", "decay"],
["pointlight" , "red", 0.6, 100, 2]
] ,
[1,1,-5] ,[5,2,20] , 0x00ff00 , "yellow" ,false , "phong"],
["sphere" , , [1,3,3] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong"]
]
)
""
//text
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["text" , "ZCubes" , [3,3,3] ,[5,2,20] , 0x00ff00 , "yellow" ,true , "backgroundreflection"]
]
)
""
// bevelled text
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["red"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["text" , "ZCubes" , [3,3,3] ,[5,2,20,true] , 0x00ff00 , "yellow" ,true , "backgroundreflection"]
]
)
""
// background and sphere with reflection
// did not seem to work
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["pisa"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
//["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"],
["sphere" , , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , "backgroundreflection"]
]
)
""
// svg load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["white"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["load" , "../threefull/examples/models/svg/tiger.svg" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ]
]
)
""
// pdb load
// it did not show the letters. did the css2d not work?
// need to figure out how CSS2DObject works to show the labels
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["white"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["load" , "../threefull/examples/models/pdb/aspirin.pdb" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ]
]
)
""
// pdb load
// it did not show the letters. did the css2d not work?
// need to figure out how CSS2DObject works to show the labels
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["transparent"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["load" , "../threefull/examples/models/pdb/aspirin.pdb" , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ]
]
)
""
// svg monalisa load
//if monalisa svg was assigned, this was loaded, but was not visible until pisa was made background then could see it
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["white"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
["load.svg" , monalisa , [3,3,3] ,[5,50,50] , 0x00ff00 , , , ]
]
)
""
-fbx load - had to change the path for mimetype allowed.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
/*["scene" , [
["background"],
["pisa"]
],
, , , , ,],
*/
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[275/*60 */ ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
//["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"],
["load" , "../threefull/examples/models/fbx/Samba Dancing.fbx" , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , ]
]
)
-fbx load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
/*["scene" , [
["background"],
["pisa"]
],
, , , , ,],
*/
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[275/*60 */ ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
//["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"],
["load" , "https://three.zcubes.com/examples/models/fbx/Samba Dancing.fbx" , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , ]
]
)
//RENDER3DDEV(
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
["pisa"]
],
, , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[60 ,"auto" ,0.1 ,1000 , [0,0,5] , 3]
], , , , ,],
//["cube" , , [2,2,2] ,[0.5,0.1,0.1] , 0x00ff00 , "yellow" ,true , "backgroundreflection"],
["sphere" , , [3,3,3] ,[5,50,50] , 0x00ff00 , "yellow" ,true , "backgroundreflection"]
]
)
""
// multiple spheres
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ,"focallength"],
[75 ,"auto" ,0.1 ,1000 , [50,50,50] , 3]
], , , , , ,],
["sphere" , , i=>[3*i,i*3,3] ,[5,50,50] , 0x00ff00 , ["yellow","red"] ,true, , 10]
]
)
""
// simpler multiple spheres - size gets confusing. check next one.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,[5,50,50] , 0x00ff00 , ["yellow","red"] ,true, , 10]
]
)
""
// simpler multiple spheres - size better
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[5,50,50] , 0x00ff00 , "yellow" ,true, , 10]
]
)
""
// smaller sphere
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[1,50,50] , 0x00ff00 , "yellow" ,true, , 10]
]
)
""
// smaller sphere normal colors
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[1,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10]
]
)
""
// smaller sphere normal colors - varying radii
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[1*i,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10]
]
)
""
// smaller sphere normal colors - varying radii slight - 0 radius defaults to 1
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10]
]
)
""
// smaller sphere normal colors - varying radii slight - 0 radius defaults to 1 adjusted by a small amount
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i+0.01,50,50] , 0x00ff00 , "yellow" ,true, "normal", 10]
]
)
""
// smaller sphere normal colors - varying colors from interpolate d3
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[3*i,i*3,3] ,i=>[0.3*i+0.01,50,50] , 0x00ff00 , i=>d3.interpolateInferno(i/10) ,true, "phong", 10]
]
)
""
// smaller sphere normal colors - varying colors from interpolate d3 2d
// looks like rocks
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , (i,j)=>[3*i,j*3,3] ,(i,j)=>[0.3*i+0,2*j+0.01,50,50] , 0x00ff00 , (i,j)=>d3.interpolateInferno((i+j)/10) ,true, "phong", |6,4|]
]
)
""
// varying size varying colors from interpolate d3 2d
// looks like rocks
// material can have other properties in subarray. how to loop this?
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , (i,j)=>[3*i,j*3,3] ,(i,j)=>[0.3*i+0.2*j+0.01,50,50] , 0x00ff00 , (i,j)=>d3.interpolateInferno((i+j)/10) ,true, "phong", |6,4|]
]
)
""
// planets
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material","count" ],
["sphere" , , i=>[10*i,0,0] ,(i,j)=>[5,50,50] , 0x00ff00 , PLANETS ,true, "phong", PLANETS.length]
]
)
""
// new items
//https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_video_webcam.html
// webcam
RENDER3D(
[
["type" ,"fill", "size"],
["sphere", "webcam",[1,30,30]] // user direction
]
)
""
// load objects with ferrari, and do this to rotate the wheels. on #bg
RENDER3D(
[
["type" , "name" , "animation" ],
["change" , "wheel_fl" , [["rpmx"],[-60]] ],
["change" , "wheel_fr" , [["rpmx"],[-60]] ],
["change" , "wheel_rl" , [["rpmx"],[-60]] ],
["change" , "wheel_rr" , [["rpmx"],[-60]] ]
],
"#bg"
);""
// rose 2
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["load" , "../threefull/other/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// gave black
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/rose/rose 2.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/female02.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"aut" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// rose seems to work better
// mtl file needs to be moved around for values like each line in mtl
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "../threefull/other/female/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// gave black
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose2/rose.obj" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//glb shows rose right. really tiny and had to be scaled. why?
// made scale to be 10
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose3/rose 2.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
//alien obj file
// why is it so far to the top?
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/alien/alien.obj" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
//cubes fbx file. did not work since this is old version
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cubes/cubes.fbx" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
//cubes glb file. did not work since this is old version
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cubes/cubes.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
//glb rendered, flb had issues with transparency
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower.glb" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower 2.gltf" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/rose/rose flower 5.gltf" , [0,0,0] ,[10,10,10] , 0x00ff00 , ,true , "phong"]
]
);
""
// physics started working after quaternion of plane was set 2:15 PM 12/8/2020
// basics work in this
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[500,1,500] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [0,10,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,10,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[200,100,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
-still some axis confusion, or camera confusion.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [0,100,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,100,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
-look better
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material", "mass" ],
["physics"],
["floor" , , [0,0,-3] ,[50,50,1] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [0,10,0] ,[5,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["sphere" , , [10,20,0] ,[3,20,20] , 0x00ff00 , "yellow" ,false , "phong", 10],
["grid" , , [0,0,0] ,[50,50,2] , 0x00ff00 , "yellow" ,false , "phong"],
]
);""
// fruits
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/fruits/apple and orange.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// cups
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
['../threefull/examples/textures/terrain/grasslight-big.jpg']
], , , , ,],
["camera" , [
["fov" ,"aspect" ,"near" ,"far", "position" ],
[90 ,"auto" ,0.1 ,1000 , [0,0,30] ]
], , , , ,],
["load" , "https://kappaomega.zcubes.com/threetest/threefull/other/cups/cup.glb" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// nightsky
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["nightsky" , , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// annotation test
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[0,0,-15]]
]
, [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
//["nightsky" , , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// annotation test
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[-11,9,5]]
]
, [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
// shows annotation test -wip
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[-11,9,5]]
]
, [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
// annotation test
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[0,0,-15]]
]
, [0,0,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[4,4,-2]]
]
, [5,5,0] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
// html - these positioning did not seem correct. see why.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["html" ,
"<div>TEST</div>"
, [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["html" ,
"<div>TEST2</div>"
, [2,2,2] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["html" ,
"<div>TEST2</div>"
, [4,4,2] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
// html - these positioning did not seem correct. see why.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["html" ,
"<div style='font-size:8px'>TEST</div>"
, [1,1,1] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["html" ,
"<div style='font-size:8px'>TEST2</div>"
, [20,2,20] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["html" ,
"<div style='font-size:8px'>TEST2</div>"
, [40,4,42] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
]
);
""
LOAD("elements");
els=ELEMENT(1..118)
// html - these positioning did not seem correct. see why.
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" , els.map(e=>e.toString()), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118]
]
);
""
// this did not work correctly
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" , els.map(e=>e.SYMBOL), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118]
]
);
""
// this is too large as font. need to see what to do to make it right
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" , els.map(e=>"<div>"+e.SYMBOL+"</div>"), SPHERICALPOINTS(118,800), [1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong",118]
]
);
""
// this does not work find out why.
// el.add(elchild) seems to be undefined
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
"<div style='font-size:8px'>TEST</div>"
, SPHERICALPOINTS(20,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 20]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
"<div style='font-size:8px'>TEST</div>"
, SPHERICALPOINTS(20,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 20]
]
);
""
// works
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
"TEST"
, SPHERICALPOINTS(117,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 117]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
"TEST"
, HELICALPOINTS(118,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
// element names in helical format
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
ELEMENT(1..118).map(e=>e+"")
, HELICALPOINTS(118,100) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
}
)
// element names in double helical format with 90 deg rotation
helix1=HELICALPOINTS(118,100);
helix2=ROTATEPOINTS(helix1);
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
ELEMENT(1..118).map(e=>e+""), helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118],
["html" ,
ELEMENT(1..118).map(e=>e+""), helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
}
)
// element names in double helical format
helix1=HELICALPOINTS(118,100);
helix2=ROTATEPOINTS(helix1,Math.PI);
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
ELEMENT(1..118).map(e=>e+""), helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118],
["html" ,
ELEMENT(1..118).map(e=>e+""), helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
}
)
// dna in double helical format
// d1="ATCG";
// d2="TAGC";
// dna=(1..100@(function (){var r=RANDINT(4);return([d1[r],d2[r]])}) )~;
d1="ATCG";
d2="TAGC";
d=(1..100@(function (){var r=RANDINT(4);return([d1[r],d2[r]])}) )~;
dna=(d[0]~);//.print()
helix1=HELICALPOINTS(118,100);
helix2=ROTATEPOINTS(helix1,Math.PI);
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
dna[0], helix1 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 100],
["html" ,
dna[1], helix2 ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 100]
]
);
""
}
)
// element names in helical format with conical angle
LOAD("elements",
function ()
{
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ,"count"],
["html" ,
ELEMENT(1..118).map(e=>e+"")
, SCALEPOINTS(HELICALPOINTS(118,100),1..118@(x=>x/118)) ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong", 118]
]
);
""
}
)
// annotation still wip
// annotation test
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[0,0,-15]]
]
, [0,0,0] ,[1.5,1,1] , 0x00ff00 , ,true , "phong"],
["annotation" ,
[
["title","description","camera"],
["Test" ,"Description Text",[4,4,-2]]
]
, [5,5,0] ,[1.5,1,1] , 0x00ff00 , ,true , "phong"],
]
);
""
// how to get rid of the yellow area etc. and get the camera to zoom in right
// point
// sphere and cube - better looking
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["point", "red",[1,30,30],
[
[1,1,2],
[2,1,2],
[3,1,2]
], [["size"],[0.1]] ]
]
)
""
// points
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["points", "red",[1,30,30],
1..100@(x=>[x,1,x]), [["size"],[0.05]] ]
]
)
""
// points
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["points", "red",[1,30,30],
1..100@(x=>[x,1,x]) .map(x=>x[0]) , [["size"],[0.5]] ]
]
)
""
// line test
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["line", "red",[1,30,30],[[0,0,0][1,1,1],[4,4,2]]]
]
)
""
// lines
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],[[[1,1,2],[2,3,4]],[12,3,4],[4,5,5]]],
["lines", "yellow",[4,30,30],[[[3,3,2],[4,4,4]],[1,3,4],[14,5,15]]]
]
)
""
// lines from stem to sphere
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],SPHERICALPOINTS(118,800).rays()]
]
)
""
// not showing anything. why? lines from stem to sphere
// is it radius? The group is being made etc.
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],SPHERICALPOINTS(18,5).rays()]
]
)
""
// lines from stem to sphere
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).rays()]
]
)
""
// lines from conical tree with scale
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],SCALEPOINTS(HELICALPOINTS(118,800),1..118.map(x=>1/x)).rays()]
]
)
""
// try subpoints using add
// lines from stem to sphere
// did not work
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],ADDPOINTS(HELICALPOINTS(118,800),1..118.map(x=>-x)).rays()]
]
)
""
// try subpoints using add
// lines from stem to sphere
// did not work
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>-x))]
]
)
""
// rayscale etc
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>-x))]
]
)
""
// rayscale etc
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>1/x))]
]
)
""
// rayscale etc conical christmas tree
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "red",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))]
]
)
""
// rayscale etc with many colors
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "rainbow",[1,30,30],HELICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))]
]
)
""
// rayscale etc with many colors like a fruit
RENDER3D(
[
["type" ,"fill", "size", "coordinates"],
["lines", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118))]
]
)
""
// rayscale etc with many colors like a fruit with center
// like a flower. note [[]] on material not to split settings array
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["lines", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118),"center"),
[
[
["type","linewidth"],
["line",3]
]
]
]
]
)
""
// rayscale etc with many colors like a fruit with center
// like a flower. note [[]] on material not to split settings array
// line2 is not working well
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["line2s", "rainbow",[1,30,30],SPHERICALPOINTS(118,800).raysscale(1..118.map(x=>x/118),"center"),
[
[
["linewidth"],
[3]
]
]
]
]
)
""
// points with lookat
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["points", "red",[1,30,30],
SPHERICALPOINTS(118,10).rayslookat(), [["size"],[0.1]] ]
]
)
""
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material"],
["points", "red",[1,30,30],
SPHERICALPOINTS(118,10).rayslookat(), [["size"],[0.1]] ]
]
)
""
// place rectangles at spherical points with lookat defined
pts=SPHERICALPOINTS(118,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat"],
["cube", "red",[1,1,1], pts, "phong",pts.rayslookat() ]
]
)
""
// sphere of cubes...
pts=SPHERICALPOINTS(118,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "red",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// small cubes did not seem to change
pts=SPHERICALPOINTS(118,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "red",[0.1,0.1,0.1], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// sphere from small balls
pts=SPHERICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "red",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
// random colors on spheres
pts=SPHERICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "random",[1,1,1], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// interesting shape like a cross with stuff in the middle
pts=SPHERICALPOINTS(130,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "reds",[1,15,15], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// interesting sphere
pts=SPHERICALPOINTS(130,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "reds",[[1,15,15]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// random colors on spheres
pts=SPHERICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "random",[[1,10,10]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// random colors on spheres
pts=SPHERICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "random",[[1,1,1]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS(30,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,0.10,0.10]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS(5,2);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[1,10,10]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS(5,20);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,1,1]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS(50,20);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[10,10,10]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes around center at same level
pts=HELICALPOINTS(5,2,5,0);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
// (maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset)
pts=HELICALPOINTS(50,2,5,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes in separate levels
pts=HELICALPOINTS(50,2,5,0,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "random",[[0.1,5,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes rainbow colors with lookat
pts=HELICALPOINTS(50,20,5,0,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "rainbow",[[15.1,5,15]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes
pts=HELICALPOINTS([50,100],20,5,0,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "rainbow",[[15.1,5,15]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical cubes in concentric circles
pts=HELICALPOINTS(20,[50,100],5,8,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["cube", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical sphere in concentric circles, with triangular shapes
pts=HELICALPOINTS(20,[5,15],5,8,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// helical spheres with random radii
pts=HELICALPOINTS(20,[50,100],5,8,10);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "rainbow",x=>[RANDOM(5),10,5], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
// simple sphere and viewport
// not working yet
// added controls and still has issues
RENDER3D(
[
["type" ],
["sphere"],
["viewport"]
]
)
""
// flower like helical sphere in concentric circles, with triangular shapes
pts=HELICALPOINTS(20,5,20,0);
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count"],
["sphere", "rainbow",[[5,1,5]], pts, "phong",pts.rayslookat() ,pts.length ]
]
)
""
//HELICALPOINTS(maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset,requirednumberofpoints)
// flowerlike helical sphere in concentric circles, with triangular shapes
pts=HELICALPOINTS(20,15,20,0);
angles=radpiby20;
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count","rotation"],
["sphere", "rainbow",[[5,1,3]], pts, "phong",pts.rayslookat() ,pts.length,i=>[angles[i],0,0] ]
]
)
""
//HELICALPOINTS(maxnumberofpoints,radius,thetasegments,cylinderstep,cylinderoffsetpercycle,startphi,startcylinderoffset,requirednumberofpoints)
// flowerlike helical sphere in concentric circles, with triangular shapes with rotation
pts=HELICALPOINTS(20,15,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookat","count","rotation"],
["sphere", "rainbow",[[5,1,3]], pts, "phong",pts.rayslookat() ,pts.length,i=>[angles[i],0,0] ]
]
)
""
// flowerlike helical sphere in concentric tetrahedrons, with triangular shapes
// note lookatdeactivated so that it does not affect the set rotations
// could use this for the json object display from crockford
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","lookatdeactivated","count","rotation"],
["tetrahedron", "rainbow",[[5]], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ]
]
)
""
// flowerlike helical sphere with tubes to get json emblem. note the use of settings to define tube
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"],
["tube", "rainbow",[[[-10,-10],[10,10],[0,0]]], [5], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes - try 2
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"],
["tube", "rainbow",[[[-10,-10],[10,10],[10,-10],[-10,10],[-10,-10]]], [5], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes - try 3
// segments can be used for flower marigold
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"],
["tube", "rainbow",[[[0,0],[6,0],[3,2.2427336738541745]]], [1], pts, "phong",pts.rayslookat() ,pts.length,function (i){console.log(angles[i]);return([angles[i],0,0])} ]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes try 4
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","looka1t","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,6,0],[0,3,2.2427336738541745],[0,0,0]]], [15,10,10], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,0,angles[i]]]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes try 5
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [15,10,10], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes try 5
// size should be in two d array if i loop
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [[2,10,10]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]]
]
)
""
// flowerlike helical sphere in concentric circles, with triangular shapes try 6 thin edges of tube
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745],[0,0,0]]], [[5,0.1,5]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]]
]
)
""
// crayon like tubes
pts=HELICALPOINTS(20,25,20,0);
angles=deg360by20;
RENDER3D(
[
["type" ,"fill", "settings","size", "coordinates","material","lookat","count","rotation"],
["tube", "rainbow",[[[0,0,0],[0,0,6],[0,3,2.2427336738541745]]], [[2,1,50,true]], pts, "phong",pts.rayslookat() ,pts.length,i=>[0,angles[i],0]]
]
)
""
// render download command
RENDER(
[
["type","cx", "cy", "r","coordinates","label","fill","stroke","stroke-width","font-size","format"],
["circle",100,100,60,,,"purple","purple"],
["circle",100,100,30,,,"white","white"],
["text",,,,[90,65],"1",,"black",3,40],
["download",,,,[90,65],"1",,"black",3,40,"png"]
]);
""
//A forest of trees
// RENDER3D(
// [
// ["type" ,"fill", "size", "coordinates","material","count"],
// ["tree", "red",[1,30,30],
// 1..100@(x=>[x,1,x]), [["size"],[0.05]],15 ]
// ]
// )
// ""
//1..100@(x=>[x,1,x]) would not work as it gives arrays within arrays
//A row of trees
RENDER3D(
[
["type" ,"fill", "size", "coordinates","material","count"],
["tree", "red",[1,30,30],
(x=>[x,1,x]), [["size"],[0.05]],15 ]
]
)
""
// forest of trees. notice [[size]]
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",[[1,30,30]],
((x,y)=>[x,0,y]),IM(15) ]
]
)
""
// forest of trees.trying different size
// this did not work as well
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",((x,y)=>[RANDINT(100),x,y]),
((x,y)=>[x,0,y]),IM(15) ]
]
)
""
// forest of trees. works. trying different size
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",((x,y)=>[RANDINT(10)]),
((x,y)=>[x*RANDINT(10),0,y*RANDINT(10)]),IM(15) ]
]
)
""
// one big tree
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",((x,y)=>[RANDINT(100)]),
,IM(15) ]
]
)
""
// one big tree
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",((x,y)=>[RANDINT(100)]),
,50 ]
]
)
""
// one big tree - different height cover etc.
RENDER3D(
[
["type" ,"fill", "size", "coordinates","count"],
["tree", "red",[1..5,(50..1..-10)]~,
,5 ]
]
)
""
// loading different formats
// 3dm files
// loads though looks rotated on x axis. can expand on idea as in https://threejs.org/examples/webgl_loader_3dm.html
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/3dm/Rhino_Logo.3dm" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// 3dm files
// loads though looks rotated on x axis. can expand on idea
// need to see if colors normal etc load right or else get it loaded
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" ,
[
["url","normal"],
[
"https://three.zcubes.com/examples/models/3ds/portalgun/portalgun.3ds" ,
"https://three.zcubes.com/examples/models/3ds/portalgun/textures/normal.jpg"
]
]
,
[-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// 3mf files
// loads though looks rotated on x axis. can expand on idea
// other links to use
//"https://three.zcubes.com/examples/models/3mf/facecolors.3mf"
//"https://three.zcubes.com/examples/models/3mf/multipletextures.3mf"
//"https://three.zcubes.com/examples/models/3mf/vertexcolors.3mf"
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/3mf/cube_gears.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/3mf/multipletextures.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/3mf/truck.3mf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// amf file load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/amf/rook.amf" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// assimp file load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/assimp/octaminator/Octaminator.assimp" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// bvh file load - needed fitting. did that break other loads?
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/bvh/pirouette.bvh" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// dae file load - needed fitting. did that break other loads? collada
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/collada/elf/elf.dae" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//need to do kinematics
//https://threejs.org/examples/webgl_loader_collada_kinematics.html
// dae file load - needed fitting. did that break other loads? collada with animation
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/collada/stormtrooper/stormtrooper.dae" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// draco drc file load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/draco/bunny.drc" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// fbxfile load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/fbx/Samba Dancing.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// fbxfile load - nurbs
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/fbx/nurbs.fbx" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// gcode load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/gcode/benchy.gcode" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// kmz load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/kmz/Box.kmz" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// lwo load - change background to see the text which is in black
// or add screen background row
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["scene" , [
["background"],
[0xf0f0f0]
], , , , ,],
["load" , "https://three.zcubes.com/examples/models/lwo/Objects/LWO3/Demo.lwo" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// nrrd and vtk load
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/nrrd/I.nrrd" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/vtk/liver.vtk" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// pcd
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/pcd/binary/Zaghetto.pcd" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// ply
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/ply/ascii/dolphins.ply" , [-10,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/ply/binary/Lucy100k.ply" , [-20,10,5] ,[1.5,1,1] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// prwm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/prwm/smooth-suzanne.le.prwm" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/prwm/faceted-nefertiti.le.prwm" , [10,10,5] ,[10,10,10] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/prwm/vive-controller.le.prwm" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// stl
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/stl/ascii/slotted_disk.stl" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/stl/binary/pr2_head_pan.stl" , [10,10,5] ,[10,10,10] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/stl/binary/pr2_head_tilt.stl" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/stl/binary/colored.stl" , [-20,10,5] ,[3,3,3] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//tilt
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/tilt/BRUSH_DOME.tilt" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//tilt
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://github.com/mrdoob/three.js/blob/master/examples/models/tilt/BRUSH_DOME.tilt" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// to test
//vox
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/vox/monu10.vox" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//vrm
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/vrm/Alicia/AliciaSolid.vrm" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
//vrml
// other files to load
https://three.zcubes.com/examples/models/vrml/creaseAngle.wrl
https://three.zcubes.com/examples/models/vrml/crystal.wrl
https://three.zcubes.com/examples/models/vrml/house.wrl
https://three.zcubes.com/examples/models/vrml/elevationGrid1.wrl
https://three.zcubes.com/examples/models/vrml/elevationGrid2.wrl
https://three.zcubes.com/examples/models/vrml/extrusion1.wrl
https://three.zcubes.com/examples/models/vrml/extrusion2.wrl
https://three.zcubes.com/examples/models/vrml/extrusion3.wrl
https://three.zcubes.com/examples/models/vrml/lines.wrl
https://three.zcubes.com/examples/models/vrml/meshWithLines.wrl
https://three.zcubes.com/examples/models/vrml/meshWithTexture.wrl
https://three.zcubes.com/examples/models/vrml/pixelTexture.wrl
https://three.zcubes.com/examples/models/vrml/points.wrl
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/vrml/house.wrl" , [-10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// vtk and vtp
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["load" , "https://three.zcubes.com/examples/models/vtk/bunny.vtk" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/vtk/cube_ascii.vtp" , [3,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/vtk/cube_binary.vtp" , [10,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"],
["load" , "https://three.zcubes.com/examples/models/vtk/cube_no_compression.vtp" , [20,10,5] ,[5,5,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// x
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
//["load" , "https://three.zcubes.com/examples/models/xyz/helix_201.xyz" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"]
["load" , "https://three.zcubes.com/examples/models/xfile/SSR06_model.x" , [-10,10,5] ,[50,50,50] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""
// teapot
RENDER3D(
[
["type" , "settings" , "coordinates", "size" , "stroke" , "fill", "helper", "material" ],
["teapot" , , [-10,10,5] ,[20,5] , 0x00ff00 , "yellow" ,true , "phong"]
]
);
""