8 thoughts on “r73 : nothing works !?!

  1. FontUtils and TextGeometry utils have also been removed from core.

    Why don’t you remove everything from the core?
    A core with ZERO bytes does not need to be downloaded at all.

    We don’t guarantee backwards compatibility between versions.

    That’s a bad move Ricardo.
    As I said from the very beginning:

    The backward compatibility is a MUST in any serious project.
    Otherwise less and less people will be interested in that project.

    cheers

  2. Why don’t you remove everything from the core?
    A core with ZERO bytes does not need to be downloaded at all.

    I gather you’re an emotional guy. However, you stay around so I also gather that at the end of the day you find the project useful 😉

    The backward compatibility is a MUST in any serious project.

    Maybe this is not as serious of a project as you think it is? I’m not Adobe you know?

    Otherwise less and less people will be interested in that project.

    People losing interest is not something I worry about. Instead, I focus on creating a beautiful API that abstract the annoyances of computer graphics and, at the same time, I want the library to fit in 100kb gzipped. It’s impossible to forever include all the features that people add.

  3. @pjanik

    Yeah, sorry about that, the TextGeometry API changed again. It’s back in core though!

    Please use http://threejs.org/examples/webgl_shadowmap.html as reference.

    var loader = new THREE.FontLoader();
    loader.load( 'fonts/helvetiker_bold.typeface.js', function ( font ) {
    
        var textGeo = new THREE.TextGeometry( "THREE.JS", {
    
            font: font,
    
            size: 200,
            height: 50,
            curveSegments: 12,
    
            bevelThickness: 2,
            bevelSize: 5,
            bevelEnabled: true
    
        });
    
        textGeo.computeBoundingBox();
        var centerOffset = -0.5 * ( textGeo.boundingBox.max.x - textGeo.boundingBox.min.x );
    
        var textMaterial = new THREE.MeshPhongMaterial( { color: 0xff0000, specular: 0xffffff } );
    
        var mesh = new THREE.Mesh( textGeo, textMaterial );
        mesh.position.x = centerOffset;
        mesh.position.y = FLOOR + 67;
    
        mesh.castShadow = true;
        mesh.receiveShadow = true;
    
        scene.add( mesh );
    
    } );
  4. If anyone is interested, this is how I loaded font without async request, using NPM three@0.74.0 module and webpack: https://gist.github.com/pjanik/49c03c02c66341a26904
    If you’re using any other build tool, the key thing is to load font file as a string. Maybe this funny parsing could be extracted to some helper method in the future?

    On a side note, it’s cool that r74 includes /examples dir (r73 didn’t), please continue to do that. 😉 Finally, I can use only three package, no externals script files anymore (I’m also using examples/js/controls/OrbitControls). It would be even more cool if examples were published using UMD format, so I could directly require OrbitControls without shimming global THREE dependency (not a big deal, as most of the build tools can handle it, but still).

    Thanks!

  5. The documentation needs to get updated as the API changed, this no longer applies: http://threejs.org/docs/index.html#Reference/Extras.Geometries/TextGeometry

    It would have been super useful to have a very basic example without all the keystroke recording switching fonts, weights and bevels. Not that those aren’t also great to have, but a simple basic one in your examples would have saved me a ton of time.

    This example could have helped a lot: http://threejs.org/docs/scenes/geometry-browser.html#TextGeometry, but when you look at the source, it only ends up drawing a torus as it pulls in external resources to actually do the work.

    I put together this simple example on JSFiddle for anyone that finds this thread.
    https://jsfiddle.net/287rumst/1/

  6. Doing a release involves quite a few steps. Sometimes my patience/dedication runs out… 😕
    Anyone can update the migration page. I would love to get some help there.

    I recently run into this problem using an older version of three.js.

    But after reading through the comments and insults you received, instead of asking for help, I just wanted to thank you for maintaining three.js.

    You’re a super dedicated and patient guy! 👍

  7. The update from r72 to r84 was a bunch of work (~3 hours for one project).

    Helpful:

    My happy result: https://www.matheretter.de/geoservant/en/


    In detail what I needed to do from v72 to v84:

    1. Remove from your html file:

       <!-- OLD <script src="../../threejs/geometries/TextGeometry.js"></script>  -->
       <!-- <script src="../../threejs/helvetiker_regular.typeface.js"></script>  -->
      
    2. Run your threejs scene, you probably get:

       Uncaught TypeError: c.generateShapes is not a function
      
    3. This happens because the renderer starts without having the font loaded. So let’s first load the font and then call the renderer at startup:

       var text3dparams;
       var font_helvetiker;
       var fontload = new THREE.FontLoader();
       fontload.load( '/threejs/fonts/helvetiker_regular.typeface.json', function ( font ) {
       	font_helvetiker = font;
       	initStageText();
       	
       	// startup
       	render(); 
       });
      
    4. As I set the text new during runtime, I need to define the stage objects on global scape, e.g.:

       var text3d_r;
       var text3d_s;
       var text3d_h;
       var material1;
       var material_s;
       var material2;
      
    5. Example of the start function:

       function initStageText()
       {
       	// 3D TEXT LABELS
       	text3dparams = {
       		font: 			font_helvetiker, // font, important to change, before was "helvetiker", now the font directly!
       		size:			0.3, 	// size of the text
       		height:			0.05, 	// thickness to extrude text
       		curveSegments: 	2,		// number of points on the curves
       		weight: 		'normal',		// font weight (normal, bold)
       		style: 			'normal',		// font style  (normal, italics)
       	}
       		
       	// label radius
       	material1 = new THREE.MeshBasicMaterial({color: 0x009900});
       	var text3dgeom_r = new THREE.TextGeometry('r = '+cone_radius, text3dparams);
       	text3d_r = new THREE.Mesh(text3dgeom_r, material1);
       	text3d_r.position.y = cone_height+0.1;
       	text3d_r.position.z = cone_radius/2-0.35;
       	text3d_r.rotation.y = -Math.PI/2;
       	scene.add(text3d_r);
       }
      
    6. I also got the error THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead. To solve this, I removed:

       gridHelper.setColors( new THREE.Color(gridcolor), new THREE.Color(gridcolor) );
      

    and added (gridstep was 1 before, then needed to set the value to 20 to get the same grid):

    	var gridHelper = new THREE.GridHelper(gridplaneSize/2, gridstep, gridcolor, gridcolor);
    
    1. Then I need to take care of the threejs changes (shown as warning in the Chrome console):

    6.1 THREE.MeshBasicMaterial: 'ambient' is not a property of this material. Solved by removing ambient:color, from new THREE.MeshBasicMaterial();

    6.2 Lights changes, just replace as stated in the warnings:

    	THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.
    	THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.
    	THREE.Light: .shadowCameraNear is now .shadow.camera.near.
    	THREE.Light: .shadowCameraFar is now .shadow.camera.far.
    	THREE.Light: .shadowCameraFov is now .shadow.camera.fov.
    	THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( 
    	THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.
    

    6.3 THREE.Light: .shadowDarkness has been removed. – remove it.

    1. I also changed the renderer setup:

       // OLD 
       var renderer = Detector.webgl ? new THREE.WebGLRenderer({ antialias: true }) : new THREE.CanvasRenderer({ antialias: true });
      
       // NEW
       var renderer;
       if(Detector.webgl)
       {
       	renderer = new THREE.WebGLRenderer({ antialias: true });
       }
       else
       {
       	renderer = new THREE.CanvasRenderer({ antialias: true });
       }
      
    2. I also needed to add a white background color to the scene setup:

       var scene = new THREE.Scene();			
       scene.background = new THREE.Color( 0xffffff );
      

    Now my application runs as with the old threejs version. Good luck for your project too!

Comments are closed.