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

The history of JavaScript's 3D tech development

Before most of popular browsers start to support canvas "3d" context, we JavaScript developers have struggled how to implement to enable 3D by JavaScript without any extensions like Java, Flash, etc. Here is a part of the history of JavaScript's 3D tech development.

Animation.Cube - April 2006


Three years ago, I wrote a library named Animation.Cube which slices images into many vertical lines to show rotating cube. I demonstrated this at the first technical talks of Shibuya.js community. The code is on JSAN. See also digg.

Triangles by Border of Div - October 2006



Useless Pickles (Jeff Lau) shows polygons drawn by many triangles made by <div> elements using trick of borders. It means we could develop Virtua Fighter (1) by JavaScript.

3D by Canvas - March 2008


Again, I wrote a new demo using <canvas> element to draw wireframe image and polygons as well. The code was written for another demo to manipulate Wii Remote controllers, I had sessions talked at OSDC.TW 2008 (Taipei), YAPC::Asia 2008 (Tokyo), YAPC::NA 2008 (Chicago), and YAPC::Europe 2008 (Copenhagen) conferences.

3D Renderer with Textures - March 2008


At just about the same time, Jacob Seidelin gave a great demo with texture mapped polygons using <canvas> element.

Triangle Texture Mapping on Wii - April 2008



Daniel Gump released Wii Opera SDK which had triangle texture-mapping feature. It is a SDK for Nintendo Wii's Internet Channel. He said it could show 500 textured triangles per second on Wii.

Motion Blur - May (maybe) 2008



Kaarel Lumi represented a beautiful motion blur using alpha blending tech by fillStyle. Thanks, @moriyoshi.

Projective Texturing - November 2008



Steven Wittens also wrote projective transform renderer. I'm interested in the tech which make an adjustment on size of the image cutted. It makes many cuts for front pieces.

Sphere Environment Mapping - February 2009



Satoshi Ueyama reported that Chrome had extremely fast canvas rendering engine named Skia by demonstrating his demos and benchmarks. He also described in detail how to implement texture mapping by canvas in his post. He also implemented physical computing and sphere environment mapping feature on it. His demos showed us that now we could run JavaScript 3D by real-time / daily-usable performance on Chrome. And I guess rest of popular browsers will soon come to the stage. See also my post.

Incredible JavaScript+Canvas 3D demos from Japan!

Mr. Satoshi Ueyama hacked out the new era of JavaScript 3D tech by unveiling the real of Google Chrome's power. Satoshi is one of the great JavaScript hackers in Japan, and also known as gyuque listed on the article of 30 Japanese geeks you should follow on Twitter. (cached)

He has introduced the brand new JavaScript technique using Canvas for 3D on his post. Browsing with Google Chrome is strongly recommended for all demos below.

I'm sure this could be one giant leap for JavaScript user interface technologies.

Demo #1: 3D texture mapped with physical computing

This is his first demo which shows 3D textured by Canvas. You can click on the cloth to make it waved.


http://gyu.que.jp/jscloth/

Demo #2: Hatsune Miku 3D with OOP

The 3D Miku is OO-style implemented as an object which has swing() method. This means she swings green onion in her hand when swing() method is called. Click on her.


http://gyu.que.jp/jscloth/miku.html

She wears hundreds of polygons. The demo was created for Paul Bakaus, jQuery UI lib's lead, visiting Japan.


Demo #3: 3D iPod touch with environment mapping

You may find the all demos above have the same width as 480px. Yes, it is definitely same as the horizontal viewport size which iPhone and iPod touch have. Now you can see iPod touch displayed on your iPod touch by the demo #3!

It could be slightly slow on ITSELF, however, it's still cool. These demos show us that we rarely need Flash anymore on the mobile platform, right? ;)


http://gyu.que.jp/jscloth/touch.html

But the most important point of the demo is not its width. You need to see behind of it. He also implemented the reflection mapping feature on his lib.


http://gyu.que.jp/jscloth/touch.html

The all demos above are coded only by pure JavaScript using Canvas. Here are no Java, Flash, ActionScript etc. but just the Web standards.

You can see Google Chrome runs all demos much faster than any other browsers. It has a great rendering engine named Skia. CPUs are already enough fast to calculate most things, you know, and now JITs are implemented as well. But canvas renderers admit of their performance. Skia is special. Safari is also fine. Firefox, 3.0 and 3.1 JIT-ed, are seem to be slower, unfortunately. We don't have to say that IE have no capability to run these.

Gyuque runs several benchmarks to describe Skia has significant advantage on its canvas rendering engine.


http://d.hatena.ne.jp/gyuque/20090211#1234364019

The 3D JavaScript tech could be one of the killer applications of Chrome now. I guess the next generation of browsers will soon compete on Canvas performance.

Original of this post was written for my Japanese blog.
You must see more detail on gyuque's post.