-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stability: Added a test to catch regressions when rendering clones.
- Loading branch information
1 parent
f035de6
commit 89aaa00
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Cloning Tests</title> | ||
<meta charset="utf-8"> | ||
<style> | ||
body { | ||
margin: 0px; | ||
overflow: hidden; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<script src="https://cdn.rawgit.com/mrdoob/three.js/r73/build/three.js"></script> | ||
<script src="https://cdn.rawgit.com/mrdoob/three.js/r73/examples/js/loaders/MTLLoader.js"></script> | ||
|
||
<script > | ||
var scene, renderer, camera; | ||
|
||
scene = new THREE.Scene(); | ||
scene.position.set(0, -60, 0); | ||
scene.scale.multiplyScalar(2); | ||
|
||
var geometry = new THREE.BoxGeometry(1, 1, 1); | ||
var material = new THREE.MeshBasicMaterial({color:'#ffffff'}); | ||
var cube = new THREE.Mesh(geometry, material); | ||
cube.scale.multiplyScalar(100); | ||
|
||
setTimeout(function() | ||
{ | ||
var clonedCube = cube.clone(); | ||
scene.add(clonedCube); | ||
clonedCube.position.set(0, -50, 0); | ||
|
||
setTimeout(function() | ||
{ | ||
var secondClonedCube = cube.clone(); | ||
scene.add(secondClonedCube); | ||
}, 4000); | ||
}, 2000); | ||
|
||
if (window.altspace) { | ||
renderer = altspace.getThreeJSRenderer(); | ||
} | ||
else { | ||
renderer = new THREE.WebGLRenderer(); | ||
renderer.setClearColor("#AAAAAA"); | ||
renderer.setSize( window.innerWidth, window.innerHeight ); | ||
document.body.appendChild( renderer.domElement ); | ||
|
||
var aspect = window.innerWidth / window.innerHeight; | ||
camera = new THREE.PerspectiveCamera(45, aspect, 1, 2000 ); | ||
camera.position.z = 400; | ||
camera.position.y = 50; | ||
camera.lookAt( scene.position ); | ||
|
||
scene.add( new THREE.AmbientLight( 0xffffff ) ); | ||
} | ||
|
||
function animate(elapsed) { | ||
requestAnimationFrame(animate); | ||
renderer.render(scene, camera); | ||
} | ||
|
||
animate(0); | ||
</script> | ||
</body> | ||
</html> |