Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: xadn/canvas-test
base: ff6b3c79bb
...
head fork: xadn/canvas-test
compare: 118fe8a8d4
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 37,646 additions and 37,642 deletions.
  1. +37,636 −37,634 build/index.js
  2. +1 −1  index.html
  3. +9 −7 src/index.js
View
75,270 build/index.js
37,636 additions, 37,634 deletions not shown
View
2  index.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <title>three.js canvas - particles - random</title>
+ <title>canvas-test</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
View
16 src/index.js
@@ -18,8 +18,10 @@ function animate() {
particleGroup.rotation.x += 0.01;
particleGroup.rotation.y += 0.02;
- box.rotation.x += 0.01;
- box.rotation.y += 0.02;
+ if (box) {
+ box.rotation.x += 0.01;
+ box.rotation.y += 0.02;
+ }
renderer.render(scene, camera);
}
@@ -30,13 +32,13 @@ function init() {
particleGroup = createParticleGroup();
scene.add(particleGroup);
- box = createBox();
- scene.add(box);
+ // box = createBox();
+ // scene.add(box);
camera = new THREE.PerspectiveCamera(65, window.innerWidth / window.innerHeight, 1, 10000);
// camera.position.z = 1000;
- renderer = new THREE.CanvasRenderer();
+ renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
@@ -64,9 +66,9 @@ function randomPosition() {
function createParticleGroup() {
var group = new THREE.Object3D();
- var material = new THREE.SpriteCanvasMaterial({
+ var material = new THREE.SpriteMaterial({
color: 0xffffff,
- program: function ( context ) {
+ program: function (context) {
context.beginPath();
context.arc(0, 0, 1.5, 0, PI2, true);
context.fill();

No commit comments for this range

Something went wrong with that request. Please try again.