Evan Wallace, the same guy who brought us that amazing WebGL water simulation is back at it again, this time with a library called csg.js for doing Constructive Solid Geometry modeling in JavaScript.
The models above were created with this code:
Pretty impressive, uhm? Be sure to check out the demos. And here's the code on Github.var a = CSG.cube();var b = CSG.sphere({ radius: 1.35, stacks: 12 });var c = CSG.cylinder({ radius: 0.7, start: new CSG.Vector(-1, 0, 0), end: new CSG.Vector(1, 0, 0) });var d = CSG.cylinder({ radius: 0.7, start: new CSG.Vector(0, -1, 0), end: new CSG.Vector(0, 1, 0) });var e = CSG.cylinder({ radius: 0.7, start: new CSG.Vector(0, 0, -1), end: new CSG.Vector(0, 0, 1) }
Source: BadassJS
1 comment:
Wohh exactly what I was searching for, appreciate it for posting.
Product design firm
Post a Comment