From 3ac02f95c0791f114fe522cd01b0888adb94a599 Mon Sep 17 00:00:00 2001 From: pissang Date: Tue, 16 Jan 2018 03:24:56 +0800 Subject: [PATCH] Fix examples --- README.md | 2 +- example/cubeanim.html | 2 +- example/deferred_shadow.html | 2 +- example/deferred_skinning.html | 6 +++--- example/js/AlchemyAOPass.js | 6 +++--- example/js/SSAOPass.js | 6 +++--- example/js/SSRPass.js | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d92835cb0..11a3493ea 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Circle CI](https://circleci.com/gh/pissang/claygl.svg?style=shield)](https://circleci.com/gh/pissang/claygl) -ClayGL is a WebGL graphic library helping you to build scalable Web3D applications. +ClayGL is a WebGL graphic library for building scalable Web3D applications. It's easy to use, configurable for high-quality graphics. Benefit from the modularity and tree shaking, it can be scaled down to 40k(gzipped) for a basic 3D application. diff --git a/example/cubeanim.html b/example/cubeanim.html index 0293efbb8..403afa563 100644 --- a/example/cubeanim.html +++ b/example/cubeanim.html @@ -216,7 +216,7 @@ var current = crossPosArr; setInterval(function() { var another = current == crossPosArr ? checkPosArr: crossPosArr; - animation.animate(obj) + timeline.animate(obj) .when(1000, { position: another }).start("CubicInOut"); diff --git a/example/deferred_shadow.html b/example/deferred_shadow.html index 70cc3c0d6..076ce05fc 100644 --- a/example/deferred_shadow.html +++ b/example/deferred_shadow.html @@ -90,7 +90,7 @@ debugMesh.scale.set(0.1, 0.1, 0.1); pointLight.add(debugMesh); - var animator = animation.animate(pointLight.position, { loop: true }); + var animator = timeline.animate(pointLight.position, { loop: true }); for (var k = 0; k < 10; k++) { animator.when(k * 4000 + i * 1000, { x: randomInSquare(5), diff --git a/example/deferred_skinning.html b/example/deferred_skinning.html index e3743c46b..88852c6f3 100644 --- a/example/deferred_skinning.html +++ b/example/deferred_skinning.html @@ -49,8 +49,8 @@ updates.push(function() { sphere.localTransform.copy(joint.node.worldTransform); if (parentJoint) { - lineGeoVertices.set(0, joint.node.getWorldPosition()._array); - lineGeoVertices.set(1, parentJoint.node.getWorldPosition()._array); + lineGeoVertices.set(0, joint.node.getWorldPosition().array); + lineGeoVertices.set(1, parentJoint.node.getWorldPosition().array); } lineGeo.dirty(); }); @@ -118,7 +118,7 @@ var timeline = new clay.animation.Timeline(); timeline.start(); - animation.addClip(clip); + timeline.addClip(clip); var skeletonDebugScene = createSkeletonDebugScene(skeleton, clay); skeletonDebugScene.position.x = -10; diff --git a/example/js/AlchemyAOPass.js b/example/js/AlchemyAOPass.js index 1f2ed0af1..457e756cf 100644 --- a/example/js/AlchemyAOPass.js +++ b/example/js/AlchemyAOPass.js @@ -106,9 +106,9 @@ define(function (require) { var viewInverseTranspose = new Matrix4(); Matrix4.transpose(viewInverseTranspose, camera.worldTransform); - ssaoPass.setUniform('projection', camera.projectionMatrix._array); - ssaoPass.setUniform('projectionInv', camera.invProjectionMatrix._array); - ssaoPass.setUniform('viewInverseTranspose', viewInverseTranspose._array); + ssaoPass.setUniform('projection', camera.projectionMatrix.array); + ssaoPass.setUniform('projectionInv', camera.invProjectionMatrix.array); + ssaoPass.setUniform('viewInverseTranspose', viewInverseTranspose.array); var ssaoTexture = this._ssaoPass.getTargetTexture(); if (width !== ssaoTexture.width || height !== ssaoTexture.height) { diff --git a/example/js/SSAOPass.js b/example/js/SSAOPass.js index 6d6bdc4d4..9b664edf2 100644 --- a/example/js/SSAOPass.js +++ b/example/js/SSAOPass.js @@ -88,9 +88,9 @@ define(function (require) { var viewInverseTranspose = new Matrix4(); Matrix4.transpose(viewInverseTranspose, camera.worldTransform); - ssaoPass.setUniform('projection', camera.projectionMatrix._array); - ssaoPass.setUniform('projectionInv', camera.invProjectionMatrix._array); - ssaoPass.setUniform('viewInverseTranspose', viewInverseTranspose._array); + ssaoPass.setUniform('projection', camera.projectionMatrix.array); + ssaoPass.setUniform('projectionInv', camera.invProjectionMatrix.array); + ssaoPass.setUniform('viewInverseTranspose', viewInverseTranspose.array); var ssaoTexture = this._ssaoTexture; if (width !== ssaoTexture.width || height !== ssaoTexture.height) { diff --git a/example/js/SSRPass.js b/example/js/SSRPass.js index 985e7683a..160097db9 100644 --- a/example/js/SSRPass.js +++ b/example/js/SSRPass.js @@ -81,9 +81,9 @@ define(function (require) { clay.math.Matrix4.transpose(viewInverseTranspose, camera.worldTransform); ssrPass.setUniform('colorTex', colorTex); - ssrPass.setUniform('projection', camera.projectionMatrix._array); - ssrPass.setUniform('projectionInv', camera.invProjectionMatrix._array); - ssrPass.setUniform('viewInverseTranspose', viewInverseTranspose._array); + ssrPass.setUniform('projection', camera.projectionMatrix.array); + ssrPass.setUniform('projectionInv', camera.invProjectionMatrix.array); + ssrPass.setUniform('viewInverseTranspose', viewInverseTranspose.array); ssrPass.setUniform('nearZ', camera.near);