Question

I'm about to start a Web application that will use interactive generated 3D content. Aim is to let it run natively in the browser, i.e. no Flash is allowed, only JavaScript + HTML5.

Apart from using pure WebGL it's better to use a lib that will offer a more high level interface.

The approach of X3DOM looks great for me - and it looks like it's supposed to become native in the browser and the lib will pave the road.

But after my first impressions I'm not sure if it's lightweight enough. Apart from the 400kb JS-File it slows down Firefox.

The features I need are not many. The whole scene set up could be easily done by "hand". But I need user interaction including to figure out where the user clicks. And later I want to be able to load and insert 3D objects in a common file format.

PS: Browsers of choice are Firefox and Webkit based ones. Desktop and Mobile ones. I don't care about IE.

PPS: Yes, I know the question: WebGL Framework

Was it helpful?

Solution

X3DOM is great when you come from an X3D background (and developed by great people), but if you have no preference watsoever, Three.JS would be my pick.

OTHER TIPS

I looked at most WebGL frameworks just last week, and it indeed seems almost every one of them is in the 300kB range. That's too heavy for me, too. Luckily I found lightgl.js which has everything you need to get started in 28kB, MIT license.

The main thing for me is just abstracting canvas, shader and texture initialization. But lightgl.js does also have some mouse handling and model loading etc.

i think the decision boils down to: do you want to have a more design or programmer approach.

x3dom: its leveraging of x3d for describing the scene lends itself to a more designer approach, with just the adding of the x3dom css and js one can do this :

<X3D><Scene><Shape><Box/></Shape</Scene></X3d>

three.js: only allows for scene generation through javascript, and a lot of additional code is necessary just to set up the canvas. view the source of this simple box example: http://stemkoski.github.com/Three.js/Template.html

neither way is wrong, i prefer designing the scene and then using js when needed for any computations.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top