Projects > ViSLAB JavaScript Library >
Progress (ViSLAB JavaScript Library)
Vertex Search on GeodesicDome
To use the GeodesicDome data structure, I need to be able to search the neighborhood of a specified vertex according to the distance from it. I implemented a simple algorithm, which builds a tree whose root is the specified vertex. The depth of the tree corresponds to the distance from vertices to the root vertex. The following GeodesicDome was colored to confirm the tree structure. |
Hashtable/map with an object as a key
To efficiently store 3D float array, I tried to use a hashtable [new Array() or new Object()]: var hash = new Array(); (or new Object()) var key = new SomeObject(); var value = 3.4.5; if (!hash[key]) hash[key] = value; However, I'm dynamically configure what type of Array to be used to store 3D vectors and matrix : if (typeof DoubleArray != 'undefined') { glMatrixArray = DoubleArray; } else if (typeof Float64Array != 'undefined') { glMatrixArray = Float64Array; } else if (typeof FloatArray != 'undefined') { glMatrixArray = FloatArray } else if(typeof WebGLFloatArray != 'undefined') { glMatrixArray = WebGLFloatArray; } else { glMatrixArray = Array; } With Safari 5.1.1 on OS X Lion, glMatrixArray == Array; and you can use the Array object as a key for the hashtable. However, with Chrome 13.0.782.220 on OS X Lion, glMatrixArray == Float64Array and you cannot use Float64Array object as a key. So, I now use goog.getHashCode(obj) (from Google Closure Library) to get a unique hashcode. |
LU decomposition
In the past LU decomposition was a very useful tool for Computer Vision/Computer Graphics, etc. I've ported LU code. I've also ported my VecMath (java). |
all_tests.html
Following Closure Library, created all_tests.html/alltests.js to execute all XXX_test.html. |
vislab.io.StringReader
added vislab.io.StringReader class with StringReader_test.html. The test .html now use good.testing.jsunit for unit testing. StringReader allows you to read tokens from a string. You can also specify a set of delimiters (such as ' ' (space), \n, \t \f). Its basic reading method readToken() returns a string. You can also extract tokens in the form of Boolean (readBoolean()), Number (readNumber()). |
Testing vislab package
Added vislab.math.FFT in vislab/math/FFT.js to test the use of good.require()/provide() function. I also added FFT_test.html for testing. |
Initial commit
Created the basic dev structure. The repo has the following structure: vislab | README AUTHOR LICENSE jsl | build_deps.sh (shell script to build vislab-deps.js for Closure Library's dependency function) vislab | sub packages ... |
1-8 of 8