更改文本曲线方向three.js

时间:2016-09-04 12:06:26

标签: javascript three.js

我用three.js创建了3D文本。我的问题是曲线方向不是属性的:

text3D

CODE:

            var textLoader = new THREE.FontLoader();
            textLoader.load( 'fonts/helvetiker_regular.typeface.json', function ( font ) {
                var theText = "My example text";
                var textGeometry = new THREE.TextGeometry( theText, {
                    size: 128,
                    height: 50,
                    curveSegments: 4,
                    font: font
                });

                var textMaterial = new THREE.MeshPhongMaterial({
                    color: 0x62254a
                });
                var text3D = new THREE.Mesh(textGeometry, textMaterial);

                var direction = new THREE.Vector3(0, 0, -1);
                var axis = new THREE.Vector3(0, 1, 0);
                var angle = Math.PI / 6;

                var modifier = new THREE.BendModifier();
                modifier.set(direction, axis, angle).modify( text3D.geometry );

                group.add( text3D );
                scene.add( group );
            } );

...我需要像example一样创建文本曲线。

0 个答案:

没有答案