yeuchi

April 24, 2012

Hello Three.js

Filed under: 3D graphics — ctyeung @ 6:41 pm

Thanks to Mr. Doob, I am learning Three.js and adding a Geomview Object File Format (OFF) decoder.  For this first go around, I am implementing flat shading.  Here is the source code.  Apology, it only works if you are on a Mac (does not work on windows’ browsers).

Screen Shot 2012-04-24 at 5.45.40 PM

April 16, 2012

Hello jQuery Mobile

Filed under: JQuery — ctyeung @ 8:16 pm

Second day at Twin Cities code camp and I am indulged in mobile and javascript lessons.  First lesson begins with Mike Hodnick on Extensible, Durable Javascript with inheritance.  Following, Brad Broulik talks about jQuery Mobile and suggest a number of excellent tools like jQuery Theme Roller, Codiqa rapid prototyping and Adobe Shadow for mobile device testing.  I will be certain to pick up a copy of his text, Pro jQuery Mobile.

Here is my jQuery mobile exercise using above mentioned theme-roller, codiqua and PHP for service.

Screen Shot 2012-04-16 at 10.22.23 AM

April 14, 2012

HTML5 localStorage

Filed under: JQuery — ctyeung @ 9:49 pm

I was attending Twin Cities Code Camp today.  The first session,  Targeting Mobile Devices with HTML5 & CSS5 by Robert Boedigheimer was full of excellent HTML5 tips and suggestions.  For the first exercise, here is my exercise on localStorage, online and mobile device type detection.

Source code on googleSVN.

Screen Shot 2012-04-14 at 9.43.07 PM

April 12, 2012

Hello Phone Gap

Filed under: JQuery — ctyeung @ 7:27 pm

I missed the PhoneGap + jQuery Mobile = Awesome session by Brad Marsh at Minnebar.  However, the get started page on the PhoneGap website was enough for introduction.  As a “hello world” application, I dropped in my previous cubic-spline exercise to produce this HelloPhoneGap.apk.   “Write once, deploy everywhere”.  Will PhoneGap – javascript or similar product(s) in mobile development be anything like java across different hardware ?

This project source code is available from googleSVN.

Screen Shot 2012-04-12 at 6.59.52 PM

March 17, 2012

3D-Javascript-Geomview Object File Format (OFF)

Filed under: File format, JQuery — ctyeung @ 10:58 pm

For personal enrichment in 3D file format, this is my exercise on Geomview Object File Format, OFF.  OFF can be encoded in binary or ascii but this decoder handles only ascii at this point.  Like the previous decoders, this OFF demo has been tested on Firefox, Safari, Chrome and **Internet Explorer 10 preview**.

Documentation, C++ source code and sample OFF files maybe found at Holmes3D.NET.

I have implemented the ascii format and will continue to work on the binary decoder.  Here is the demo and source code in goggleSVN.

Attending Minnebar conference, I learned that STL, OBJ decoders have already been implemented with Three.js by Thingiview.js.

Screen Shot 2012-03-17 at 11.04.45 PM

January 31, 2012

3D – Javascript – PLY

Filed under: File format, JQuery — ctyeung @ 7:44 pm

For personal enrichment in 3D file format, this is my exercise on Stanford ploygon file format (PLY).  PLY is a popular format for 3D scanner with project like “The Digital Michelangelo, David”.

PLY file data can be stored in ascii, binary-big-endian or binary-little-endian.  Regardless of the data type, the file header is ascii.  For binary mode, data maybe stored in any type, char, short, int, float, etc.  In addition to the PLY wiki page, Stanford provides excellent documentation, sample code as well as a toolkit.

As in other 3D decoder exercises, I am using Devon Govett’s bmp.js as reference and tested on browsers: Chrome, Safari, Firefox and **Internet Explorer 10 preview**.

I have implemented the ascii format and will continue to work on the binary decoder.  Here is the demo and source code in goggleSVN.

dolphins

January 22, 2012

3D – Javascript – OBJ decoder

Filed under: File format, JQuery — ctyeung @ 4:26 pm

For my enrichment in 3D file format, this is my exercise in Wavefront Technologies’ OBJ decoder.  OBJ file format is simply structured in ascii and contains only data describing geometry and material.  The data content is ordered in lists of vertexes (v), texture (vt), normal (vn) and faces (f).  Each face entry consist of indexes to above mentioned lists to form a polygon – triangle or quad.  One special quality of the file format is its support of free form curved surface object as those in NURB.

For the initial implementation  in javascript, I am decoding only vertexes and faces to render a wire-frame.  This obj decoder is tested for Firefox, Chrome, Safari and **Internet Explorer 10 preview**.  Source code and history is available in googleSVN.

The new samples of shuttle and lamp post are found in open source project, MeshLab.

DecodeOBJ

January 1, 2012

TriangleGradient

Filed under: JQuery — ctyeung @ 4:19 pm

triangleGradientThere are a number of methods to rendering triangle gradient in a html5 canvas. Juho Vepsalainen has a nice article and demonstration.  I am using 3×3 matrix, technique common in color management volume transformation.  I wrote a blog performing this and other experiment in Flex using pixelbender filters sometime ago.  This is another shading exercise.

December 23, 2011

3D – Javascript-STL decoder

Filed under: File format, JQuery — ctyeung @ 10:26 am

Standard Tessellation Language (STL) for stereolithography CAD is a popular file format for rapid prototyping.  The file format supports both ascii and binary and consists of an order list of vertexes in float to make up triangle polygons.

With permission and support from Jostens, I have been working on an STL-optimized encoder/decoder.  The ultimate goal is to produce an optimized STL format that is 1/3 of a regular STL binary file while achieving an identical load time.  The concept was originally proposed in May 2011 and partially implemented in Adobe Flex.

For personal enrichment, this is an exercise in decoding STL with javascript.  This implementation is base on an existing javascrip-windows-bitmap-decoder.bmp.js authored by Devon Govett.  I have to implement a byteArray to float conversion (see previous blog entry).

Just as Devon Govett’s bmp decoder, this STL decoder will render for Firefox, Safari, Chrome and **Internet explorer 10 preview**.

The STL models were samples from the Android STLViewer application download.

Here is the project in googleSVN and GitHub.

monkey

December 21, 2011

Javascript – binary to float

Filed under: JQuery — ctyeung @ 2:56 pm

It is to my great surprise that byte array to float does not already exist in javascript.  Maybe I am missing something, it seems pretty rudimentary.

Anyhow, it is holiday season and a great time to romanticize those days of intro to programming from college.  Digging around on the web led me to a great applet for binary<->float demonstration as well as a tutorial for IEEE754.

Three things I have re-learned today in float, sign bit (0), exponent bits (1-9) and mantissa bits (10-32).  Here is my bytesToFloat exercise.

DecodeFloat

Older Posts »

Powered by WordPress