WebGL Foundation - What's the Best Choice? X3DOM?

I am going to launch a web application that will use interactive 3D content. The goal is to allow it to run natively in the browser, i.e. Flash is not allowed, only JavaScript + HTML5.

In addition to using pure WebGL, it is better to use lib, which will offer a higher level interface.

The X3DOM approach is great for me - and it looks like it should become native in the browser, and lib will pave the way.

But after my first impressions, I'm not sure if this is enough. Besides 400kb JS-File, this slows down Firefox.

The opportunities that I need are few. The entire scene created can be easily done by hand. But I need user interaction to figure out where the user clicks. And later I want to be able to load and paste 3D objects into a common file format.

PS: Optional browsers are Firefox and Webkit. Desktop and mobile. I don't care about IE.

PPS: Yes, I know the question: WebGL Framework

+4
source share
3 answers

X3DOM works great when you come from the background of X3D (and are developed by great people), but if you have no preference, Three.JS will be my choice.

+5
source

I looked at most WebGL frameworks only last week, and it seems that almost every one of them is in the 300 KB range. This is too hard for me. Fortunately, I found lightgl.js that has everything you need to get started with the 28K MIT license.

For me, the main thing is simply to abstract the implementation of the canvas, shader and texture. But lightgl.js also has some mouse processing and model loading , etc.

+4
source

I think the solution comes down to: you want a more approach to design or to a programmer.

x3dom: its use of x3d to describe the scene lends itself to a more designer approach, only with the addition of x3dom css and js you can do this:

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

three.js: only to generate a scene via javascript, and a lot of extra code is required to create a canvas. check out the source of this simple example: http://stemkoski.github.com/Three.js/Template.html

none of the methods are suitable, I prefer to create a scene and then use js when necessary for any calculations.

+2
source

Source: https://habr.com/ru/post/1384613/


All Articles