Permalink
Browse files

Added test showing UTF8 loading

  • Loading branch information...
jterrace committed Dec 2, 2011
1 parent c02d4e1 commit 79288cce905d31f6a9eb35316143e9cdd8c8511c
Showing with 20 additions and 5 deletions.
  1. +20 −5 js/test.js
  2. BIN models/duck/duck.jpg
  3. BIN models/duck/duck.utf8
View
@@ -66,24 +66,39 @@ function animate() {
renderer.render( scene, camera );
}
+function duckLoaded( geometry ) {
+ var material = new THREE.MeshPhongMaterial( { map: THREE.ImageUtils.loadTexture( "/models/duck/duck.jpg" ) } );
+ var mesh = new THREE.Mesh( geometry, material );
+ mesh.scale.set(100, 100, 100);
+ scene.add(mesh);
+}
+
function init() {
setupScene();
addLights();
addCamera();
addControls();
- var loader = new THREE.ColladaLoader();
+ /*var loader = new THREE.ColladaLoader();
loader.load(
'http://open3dhub.com/download/ccb5e214fc44f8b5985456d4496f6086d8b799bc7963ba6b9b788194bf6c710b/GibsonGuitar.dae',
- /*'http://open3dhub.com/download/c7d6bae9872dc9730e7343eb36b02d21a4f1861522ed137f14d03712ddf970cf/COLLADA.dae',*/
- /*'http://open3dhub.com/download/6cf8a48175ef3fb8e4a3cd4cb066164d3f9606a9f60a4db6249ddbec53ecb24d/multimtl.dae',*/
- /*'http://open3dhub.com/download/8bbe77a45c6125a9aa465258679463bbba89755cb2826f5524563bf00f9a1c08/cube_triangulate.dae',*/
+ //'http://open3dhub.com/download/c7d6bae9872dc9730e7343eb36b02d21a4f1861522ed137f14d03712ddf970cf/COLLADA.dae',
+ //'http://open3dhub.com/download/6cf8a48175ef3fb8e4a3cd4cb066164d3f9606a9f60a4db6249ddbec53ecb24d/multimtl.dae',
+ //'http://open3dhub.com/download/8bbe77a45c6125a9aa465258679463bbba89755cb2826f5524563bf00f9a1c08/cube_triangulate.dae',
function colladaReady( collada ) {
dae = collada.scene;
dae.scale = new THREE.Vector3(0.5, 0.5, 0.5);
scene.add(dae);
- });
+ });*/
+
+ var loader = new THREE.UTF8Loader();
+
+ loader.load('/models/duck/duck.utf8', duckLoaded,
+ { offsets: [-0.000000,-0.000000,-0.000000,-0.001953,-0.001465,1.000000,1.000000,1.000000],
+ scales: [1000.000000,1000.000000,1000.000000,0.995117,0.997559,2.000000,2.000000,2.000000],
+ bits: [14,14,14,10,10,10,10,10] }
+ );
animate();
}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Binary file not shown.

0 comments on commit 79288cc

Please sign in to comment.