Three.js Source Note (73) extras/geometries/textgeometry.js

Source: Internet
Author: User

Commercial Territory (http://blog.csdn.net/omni360/)

This article follows "Attribution-non-commercial use-consistent" authoring public agreement

Reprint Please keep this sentence: Business Domain-this blog focuses on Agile development and mobile and IoT device research: Data visualization, Golang, HTML5, WEBGL, three. JS, Otherwise, from this blog article refused to reprint or reprint, thank you for your cooperation.


I was just beginning to learn, a lot of things are definitely wrong and please forgive me.

The following code is a comment for the extras/geometries/textgeometry.js file in the three.js source file.

More updates in: Https://github.com/omni360/three.js.sourcecode


/** * @author Zz85/http://www.lab4games.net/zz85/blog * @author alteredq/http://alteredqualia.com/* * for creating 3D Text geometry in Three.js * * Text = 3D Text * * Parameters = {* Size: <float>,//size of the text font * Heig   HT: &LT;FLOAT&GT;,//thickness to extrude text 3-D font stretch thickness, * curvesegments: <int>,//number of points on the curves The number of subdivision segments on the extrusion thickness. * Font: <string>,//font name//font names * Weight: <string>,//font weight (normal, bold)//font width * Style: &lt ; string>,//font style (normal, italics)//font style * * bevelenabled:<bool>,//turn on bevel whether font chamfer is enabled * Bevelthi Ckness: <float>,//How depth into text bevel goes//chamfer thickness * BEVELSIZE:&LT;FLOAT&GT;,//How far from text outline is bevel//dimension of chamfer from outer contour of section *} * *//*usage Examples instance://textgeometry Wrappervar Text3d = new Textgeometry (text, options) ;//Create Textgeometry () object.//complete Mannervar textshapes = three. Fontutils.generateshapes (text, options);//Generate a graphic section var based on text and parameter options Text3D = new Extrudegeometry (textshapes, options);//Call the Extrudegeometry () method to generate extruded geometry *//*///textgeometry to generate text, but to generate Chinese 3d text, The Chinese font needs to be converted into a JS-formatted file using Typeface.js. *////<summary>textgeometry</summary>///<param name = "text" type = "string" > Text content </param>///<param name = "Parameters" type= "Object" > Text parameter Option </param>three. Textgeometry = function (text, parameters) {parameters = Parameters | | {};//assigns a parameter to a value. var textshapes = three. Fontutils.generateshapes (text, parameters);//Generate graphics section based on text and parameter options//Translate parameters to Extrudegeometry Apiparameters.amount = parameters.height!== undefined? parameters.height:50; The stretch thickness of a 3-D font, which is initialized by default to 50//defaultsif (parameters.bevelthickness = = = undefined) parameters.bevelthickness = 10;//chamfer thickness, The default is initialized to 10if (parameters.bevelsize = = = undefined) Parameters.bevelsize = 8;//The dimension that is chamfered from the outer contour of the section, which is initialized to 8if by default ( parameters.bevelenabled = = = undefined) parameters.bevelenabled = false; Whether font chamfer is enabled, THREE.ExtrudeGeometry.call (this, textshapes, parameters) is not enabled by default;//Call ExtThe Rudegeometry () method generates extruded geometry and uses the Extrudegeometry object's methods for Textgeometry objects.};/ The following is a method property definition for the Textgeometryh object, inherited from the Extrudegeometry object. ********** /three. Textgeometry.prototype = Object.create (three. Extrudegeometry.prototype);


Commercial Territory (http://blog.csdn.net/omni360/)

This article follows "Attribution-non-commercial use-consistent" authoring public agreement

Reprint Please keep this sentence: Business Domain-this blog focuses on Agile development and mobile and IoT device research: Data visualization, Golang, HTML5, WEBGL, three. JS, Otherwise, from this blog article refused to reprint or reprint, thank you for your cooperation.


The following code is a comment for the extras/geometries/textgeometry.js file in the three.js source file.

More updates in: Https://github.com/omni360/three.js.sourcecode

Three.js Source Note (73) extras/geometries/textgeometry.js

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.