I want to write chess in JavaScript but I am pretty new to JavaScript. Can somebody tell me good 2d library for JavaScript if exists ? Is there possible to write 3d objects with JavaScript ? Any advice is helpful
You should take a look at Raphaƫl and processing.js.
The processing.js reference lists a few 3d primitives so you can render 3d objects, at least in a limited manner.
Re: 3D objects in JS, Check out three.js for an excellent 3d library. It supports WebGL, Canvas, SVG rendering (WebGL being significantly faster in browser that support it).
Get a new browser if necessary (e.g. chrome dev build) and check out some of the webgl demos.
Related
I know that Adobe 3D pdf support JavaScript. So, I have JavaScript code in Three.js for 3D models in 3D world.
Is it possible to have same (or similar) code in 3D pdf?
I mean, I load 3D models, and do things with 3D models and have that all in 3D pdf?
What do I have to have to have this?
Can I create scene with Adobe API?
Is it free, Adobe API?
You can add JavaSCript to a 3D Annotation using Adobe Acrobat manually or just about any PDF library tool that supports Rich Media Annotations or will allow you to access objects at the COS dictionary level. I can advise better if you can tell me what programming languages you are most proficient at. One thing to note is that there is no physics engine or collision detection in the Acrobat JavaScript for 3D API, you'd need to add that yourself... though it is certainly possible.
I'm about to use WebGl in a academic project to preview some 2d and 3d models in a given format.
While I'm reading some documentation, I would like to know, from your experience, what would be the best API to speedup development and abstract some low-level calls and also the best IDE to work with it.
Cross browser compatibility is not a major problem.
I've decided about WebGl because I would like to create a web interface for my project to help sharing my progress.
Do you even recommend using WebGl for that?
At the end of the day, an IDE is only meant to help a little, you do the hard hauling, having said that, the best editor(s) I use for javascript are Sublime Text and Netbeans IDE
Then as it was already stated, Chrome DevTools is your best bet for debugging.
API
Three.js is really awesome to work with regarding developing WebGL apps. It makes creating what you want very easy (create a scene object, create some things you want to show, then add them to the scene and render. No need to mess around with GLSL and low level stuff right off the bat, although you could if you really wanted to).
IDE
Chrome's console and various tools are great for debugging in general. You can use whatever text editor / IDE for javascript that you want.
API (Framework)
If three.js is hard for you, or you are professional developer who just don't want to spend his time on simple things like setting up environment(scene, camera, renderer) you may try whitestorm.js.
WhitestormJS framework is a wrapper around three.js (you can use both at once, like jQuery wraps DOM). It has some extra features:
Built-in physics of Bullet Physics 3, even softbody physics (You can use light version without physics.
It has component structure (like ReactJS). You can share your plugins, components and use the ones from others.
*WhitestormJS is non-commercial open-source project by three.js fans.
Does webGL contain push/popMatrix? and if not, how would I go about recreating them?
No, WebGL is based off of OpenGL ES 2.0, so there is no built in matrix management or fixed function pipeline. The model view and projection matrices need to be completely managed in your own code and passed to shaders at draw time. You really don't need push and pop matrix if you are using a scene graph or some kind of other similar scene management system. All you really need is a good matrix and vector math library.
If you are still set on using push and pop matrix, you could simply use an array of matrices, and write functions like push and pop that simply save your current matrix into the array and push or pop the index down.
I would get the OpenGL ES 2.0 programming guide if you need more help with transitioning to WebGL. The book's website here: http://opengles-book.com/ contains a download link to some source code with demos for a variety of platforms and languages including WebGL. It also contains a decent math library if you need it.
From what I see here and there, there is no native support but you can easily build such a stack with an Array.
Which are the famouse 3d javascript libraries? By famous I mean something that is as famous Jquery is to web developers. By famous I mean things are properly documented and many resources are available i.e tutorials/books etc for newbies. I am trying to learn three.js but having hard time figuring out how to use because there isn't much documentation available for this. On top of that it is javascript so not even intellisense benefit ;) What are the other options for this type of 3d stuff? I am mainly interested in WebGL and Canvas.
Due to the great work of Mr. Doob (i.e. rome), three.js is quite famous.
If by famous you just mean 'popular', why not let google decide for you? When searching for JavaScript 3D Library, google seems to think the following is most popular.
http://www.c3dl.org/
It seems to fit your criteria, WebGL and Canvas.
I'm looking for a way to load a virtual human (ie; a model rigged with a skeleton, preferably with moving eyebrows/etc) onto a web page. The functionality should be similar to the dated library Haptek Player (http://www.youtube.com/watch?v=c2iIuiT3IW8), but allow for a transparent background. Ideally it would be in WebGL/O3D since it can be directly integrated with my existing code. However, if there's an implementation out there already in Flash3D or a different plugin, I can quickly switch my codebase to actionscript.
I've investigated trying to send the Haptek Player vertices to a Float32Array (used by WebGL) using an npapi plugin. I can place the vertex data into a javascript array and draw the virtual human. The vertex data cannot be changed, however, since the array must be copied to a typed array (Float32Array) to be used by WebGL.
Thanks for any input!
try http://expression.sourceforge.net/
C++ and OpenGL
you can experiment with converting the code to javascript using emscripten