forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mrdoob#3 from Lowfab/feature/depthtextures
Feature/depthtextures
- Loading branch information
Showing
300 changed files
with
7,437 additions
and
5,870 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
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
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
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
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
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
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
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
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
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
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,129 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Three.js Geometry Browser</title> | ||
<style> | ||
@font-face { | ||
font-family: 'inconsolata'; | ||
src: url('../files/inconsolata.woff') format('woff'); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
|
||
body { | ||
margin:0; | ||
font-family: 'inconsolata'; | ||
font-size: 15px; | ||
line-height: 18px; | ||
overflow: hidden; | ||
} | ||
|
||
canvas { width: 100%; height: 100% } | ||
|
||
#newWindow { | ||
display: block; | ||
position: absolute; | ||
bottom: 0.3em; | ||
left: 0.5em; | ||
color: #fff; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<a id='newWindow' href='./geometry-browser.html' target='_blank'>Open in New Window</a> | ||
|
||
<script src="../../build/three.min.js"></script> | ||
<script src='../../examples/js/libs/dat.gui.min.js'></script> | ||
<script src="../../examples/js/controls/OrbitControls.js"></script> | ||
<script src='js/geometry.js'></script> | ||
|
||
<script> | ||
|
||
document.getElementById('newWindow').href += window.location.hash; | ||
|
||
var gui = new dat.GUI(); | ||
var scene = new THREE.Scene(); | ||
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 50 ); | ||
camera.position.z = 30; | ||
|
||
var renderer = new THREE.WebGLRenderer({antialias: true}); | ||
renderer.setSize( window.innerWidth, window.innerHeight ); | ||
document.body.appendChild( renderer.domElement ); | ||
|
||
var orbit = new THREE.OrbitControls( camera, renderer.domElement ); | ||
|
||
var ambientLight = new THREE.AmbientLight( 0x000000 ); | ||
scene.add( ambientLight ); | ||
|
||
var lights = []; | ||
lights[0] = new THREE.PointLight( 0xffffff, 1, 0 ); | ||
lights[1] = new THREE.PointLight( 0xffffff, 1, 0 ); | ||
lights[2] = new THREE.PointLight( 0xffffff, 1, 0 ); | ||
|
||
lights[0].position.set( 0, 200, 0 ); | ||
lights[1].position.set( 100, 200, 100 ); | ||
lights[2].position.set( -100, -200, -100 ); | ||
|
||
scene.add( lights[0] ); | ||
scene.add( lights[1] ); | ||
scene.add( lights[2] ); | ||
|
||
var mesh = THREE.SceneUtils.createMultiMaterialObject( | ||
|
||
new THREE.Geometry(), | ||
|
||
[ | ||
|
||
new THREE.MeshBasicMaterial({ | ||
color: 0xffffff, | ||
side: THREE.DoubleSide, | ||
wireframe: true, | ||
transparent: true, | ||
opacity: 0.5 | ||
}), | ||
|
||
new THREE.MeshPhongMaterial({ | ||
color: 0x156289, | ||
emissive: 0x072534, | ||
side: THREE.DoubleSide | ||
}) | ||
|
||
] | ||
|
||
) | ||
|
||
chooseFromHash( mesh ); | ||
|
||
scene.add( mesh ); | ||
|
||
var prevFog = false; | ||
|
||
var render = function () { | ||
|
||
requestAnimationFrame( render ); | ||
|
||
var time = Date.now() * 0.001; | ||
|
||
mesh.rotation.x += 0.005; | ||
mesh.rotation.y += 0.005; | ||
|
||
renderer.render( scene, camera ); | ||
|
||
}; | ||
|
||
window.addEventListener( 'resize', function () { | ||
|
||
camera.aspect = window.innerWidth / window.innerHeight; | ||
camera.updateProjectionMatrix(); | ||
|
||
renderer.setSize( window.innerWidth, window.innerHeight ); | ||
|
||
}, false ); | ||
|
||
render(); | ||
|
||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.