|
@@ -262,22 +262,12 @@
|
|
|
|
|
|
// init 3D stuff
|
|
|
|
|
|
- function makePlatform( jsonUrl, textureUrl, textureQuality ) {
|
|
|
+ function makePlatform( url ) {
|
|
|
|
|
|
var placeholder = new THREE.Object3D();
|
|
|
|
|
|
- var texture = new THREE.TextureLoader().load( textureUrl );
|
|
|
- texture.minFilter = THREE.LinearFilter;
|
|
|
- texture.anisotropy = textureQuality;
|
|
|
-
|
|
|
- var loader = new THREE.JSONLoader();
|
|
|
- loader.load( jsonUrl, function ( geometry ) {
|
|
|
-
|
|
|
- geometry.computeFaceNormals();
|
|
|
-
|
|
|
- var platform = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map: texture } ) );
|
|
|
-
|
|
|
- platform.name = "platform";
|
|
|
+ var loader = new THREE.ObjectLoader();
|
|
|
+ loader.load( url, function ( platform ) {
|
|
|
|
|
|
placeholder.add( platform );
|
|
|
|
|
@@ -308,12 +298,9 @@
|
|
|
scene.background = envMap;
|
|
|
|
|
|
scene.add( makePlatform(
|
|
|
- 'models/platform/platform.json',
|
|
|
- 'models/platform/platform.jpg',
|
|
|
- renderer.capabilities.getMaxAnisotropy()
|
|
|
+ 'models/json/platform/platform.json'
|
|
|
) );
|
|
|
|
|
|
-
|
|
|
// start the game
|
|
|
|
|
|
var start = function ( gameLoop, gameViewportSize ) {
|