Search code examples
graphic3d-engine

How to write a 3D graphics engine which can be used in JavaScript?


I have recently focused on drawing some cool shapes in a HTML 5.0 canvas. And I want to write a 3D graphics engine which can be used in JavaScript. I have already finished a rotating cube. And I want to finish the shapes like this example: http://gyu.que.jp/jscloth/touch.html.

Who have ever tried in this field?


Solution

  • Edit: This question was asked many years ago. Since then, every browser except for IE (for now?) has added support for webgl. You can see many samples here: http://www.chromeexperiments.com/webgl/

    I truly don't want to discourage you, but in order to write a 3D engine in JavaScript, you have to be extremely well versed and intimate in the math/logic behind 3D rendering.

    Since you didn't state your current expertise, I'm assuming you don't ... in which case I strongly suggest that you start somewhere else. For example, XNA Game Studio. You write the code in C#, and there are already a lot of well written APIs that abstract most (but definitely not all) of the hard parts. But it's a great way to learn a lot of the concepts and math behind 3D rendering.

    If however, you are dead set on starting with JavaScript, there's already a lot of resources on the Internet about this. For example this one :-)
    http://dev.opera.com/articles/view/3d-games-with-canvas-and-raycasting-part/

    Good luck!