diff options
Diffstat (limited to 'o3d/samples/scatter-chart.html')
-rw-r--r-- | o3d/samples/scatter-chart.html | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/o3d/samples/scatter-chart.html b/o3d/samples/scatter-chart.html index a1f5f8d..6aa7743 100644 --- a/o3d/samples/scatter-chart.html +++ b/o3d/samples/scatter-chart.html @@ -50,7 +50,7 @@ o3djs.require('o3djs.util'); o3djs.require('o3djs.math'); o3djs.require('o3djs.quaternions'); o3djs.require('o3djs.rendergraph'); -o3djs.require('o3djs.effect'); +o3djs.require('o3djs.material'); o3djs.require('o3djs.primitives'); o3djs.require('o3djs.arcball'); o3djs.require('o3djs.event'); @@ -149,7 +149,8 @@ function initGlobals(clientElements) { clearColor); // Create a material for the objects rendered. - g_material = createPhongMaterial([1, 1, 1, 1]); + g_material = o3djs.material.createBasicMaterial( + g_pack, g_viewInfo, [1, 1, 1, 1]); // Create a cube shape to simulate the scatter points. g_cubeShape = o3djs.primitives.createCube( @@ -192,35 +193,6 @@ function resetView() { } /** - * Creates a phong material based on the given single color. - * @param {Array} baseColor An array with 4 entries, the R,G,B, and A components - * of a color. - * @return {!o3d.Material} A phong material whose overall pigment is baseColor. - */ -function createPhongMaterial(baseColor) { - // Create a new, empty Material object. - var material = g_pack.createObject('Material'); - - var lightPosition = [1000, 2000, 3000]; - o3djs.effect.attachStandardShader( - g_pack, material, lightPosition, 'phong'); - - material.drawList = g_viewInfo.performanceDrawList; - - // Assign parameters to the phong material. - material.getParam('emissive').value = [0, 0, 0, 1]; - material.getParam('ambient').value = - [.1 * baseColor[0], .1 * baseColor[1], .1 * baseColor[2], 1]; - material.getParam('diffuse').value = - [.9 * baseColor[0], .9 * baseColor[1], .9 * baseColor[2], 1]; - material.getParam('specular').value = [.5, .5, .5, 1]; - material.getParam('shininess').value = 50; - material.getParam('lightColor').value = [1, 1, 1, 1]; - - return material; -} - -/** * Create a 3D Scatter object by plotting each data point on a 3D model. */ function createScatterObject() { |