Showing posts with label 3d. Show all posts
Showing posts with label 3d. Show all posts

Friday, December 9, 2011

Constructive Solid Geometry 3d Modeling in JavaScript and WebGL (csg.js)

Constructive Solid Geometry (CSG) is a modeling technique that uses Boolean operations like union and intersection to combine 3D solids. This library implements CSG operations on meshes elegantly and concisely using BSP trees, and is meant to serve as an easily understandable implementation of the algorithm. All edge cases involving overlapping coplanar polygons in both solids are correctly handled.



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:
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) }
Pretty impressive, uhm? Be sure to check out the demos. And here's the code on Github.

Source: BadassJS

Sunday, November 20, 2011

James Cameron debuts "Titanic" in 3D



Hollywood director James Cameron debuted the trailer for the upcoming 3D version of the huge movie hit, “Titanic,” on Facebook earlier this week, where he also delivered an intro. Below is the trailer for the re-release, coming out next April. The movie currently has 10 million+ fans on Facebook, which is probably a reason for the re-release in 3D.