CN102867322A - Method and device for realizing Chinese marking in three-dimensional scene - Google Patents
Method and device for realizing Chinese marking in three-dimensional scene Download PDFInfo
- Publication number
- CN102867322A CN102867322A CN2012103089499A CN201210308949A CN102867322A CN 102867322 A CN102867322 A CN 102867322A CN 2012103089499 A CN2012103089499 A CN 2012103089499A CN 201210308949 A CN201210308949 A CN 201210308949A CN 102867322 A CN102867322 A CN 102867322A
- Authority
- CN
- China
- Prior art keywords
- font
- texture
- file
- attribute
- chinese
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Controls And Circuits For Display Device (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention provides a method and a device for realizing Chinese marking in a three-dimensional scene. The method comprises the following steps of: establishing a corresponding font file for each font, wherein the parameters of each attribute are preset in the font files; finding a target font file according to the font style selected by a user, performing Unicode code conversion on a Chinese characters input by the user to obtain a corresponding Unicode code set, and modifying the parameters in the target font file according to the Unicode code set; loading the target font file in which the parameters are modified and generating corresponding font texture; acquiring a UV coordinate of the font texture; performing rectangle establishing and texture mapping according to the UV coordinate of the font texture; setting the color and the size of the font texture which is subjected to the texture mapping; and performing three-dimensional (3d) rendering. The method and the device provided by the invention have the advantages that the efficiency is high, real-time Chinese marking is realized, and a plurality of fonts are supported.
Description
Technical field
The present invention relates to the 3D technology, relate in particular to the device of realizing realizing in the Chinese method that marks and a kind of three-dimensional scenic Chinese mark in a kind of three-dimensional scenic.
Background technology
Along with the development of computer technology, three-dimensional scenic is used and is more and more come true from concept, such as 3D game, virtual navigation, dummy emulation system etc.Three-dimensional scenic generally all is the three-dimensional design engine implementation that provides by means of the third party, in numerous three-dimensional picture engines, OGRE(Object-Oriented Graphics Rendering Engine, the object-oriented graphics rendering engine) as the three-dimensional picture render engine of increasing income, take full advantage of Object-oriented Technique, make the 3D software implemented convenient, thereby be widely applied.At present, what OGRE was successful is applied in a plurality of three-dimensional simulation projects, comprises game on line and some commercial three-dimensional artificial projects, such as virtual digit city, overpass system etc.
Yet the developer of OGRE d engine does not use Chinese as their first language, so the OGRE d engine directly do not support Chinese, has just reserved certain routine interface.At home, all all can run into the problem how realization Chinese efficient and true to nature marks in the 3D scene based on the constructed virtual scene of OGRE, therefore, how under the 3D of OGRE scene, to realize the Chinese mark and can guarantee operational efficiency, become most important.
The method that realizes the Chinese mark in traditional three-dimensional scenic mainly contains following several scheme:
Scheme one, utilize the rendering intent of 2D, literal is rendered on the 2D layer on the 3D layer, usually utilize CEGUI(Crazy Eddie ' s GUI) storehouse, a kind of general UI(User Interface, user interface) storehouse, combine with the 2D interface layer that OGRE provides, therefore can on the layer of 3D scene, play up again the layer of a 2D to be used for display text more, this scheme is simple, and can easily utilize the 2D prior art to process Chinese character and demonstration, but literal is fixed on the 2D layer, little nearly large variation far away can not be arranged along with moving of camera lens, thereby have certain application limitation;
Scheme two, come Chinese display (OGRE own literal output also be this method of usefulness) by pinup picture, namely prepare a very large picture, draw full Chinese character on the picture, be placed in the resource file and load, need to revise Ogre::Font, Ogre::FontManager, three classes of Ogre::TextAreaGuiElement during loading, navigating to the Chinese character position in the picture, the application limitation of the method in can solution one, it is more true to nature that literal is shown.Yet this scheme need to consume a large amount of video memorys, and the literal size differs too large with respect to the bitmap size ratio, causes font single, is not suitable for amplifying dwindling, and amplifies and can see shade and mosaic when dwindling;
Scheme three, utilize TTF(TrueTypeFont) vector font library, the unicode of all Chinese characters coding is loaded in the configuration file of OGRE, because the method is utilized vector font library (namely coming descriptive text with Points And lines), therefore need to amplify when dwindling at character size, only need to amplify corresponding multiple to the Points And lines of all these literal gets final product, the phenomenons such as mosaic can not occur, just in time solve the font defective in the scheme two.Yet, adopt this scheme also to have certain defect, because this scheme is before inputting word information, need to create background process and carry out the initialization of fontlib, and Chinese characters in common use have more than 20,000, adding Chinese font commonly used has tens of kinds, so the initialization procedure efficient of this scheme when starting is very low, this obviously can not satisfy practical application.
Summary of the invention
Based on this, be necessary the problem for inefficiency in the such scheme three, method and the device of realizing the Chinese mark in a kind of three-dimensional scenic are provided.
For achieving the above object, the present invention adopts following technical scheme:
The method of instant playback Chinese character in a kind of three-dimensional scenic may further comprise the steps:
Create corresponding font file for each font, set in advance the parameter of each attribute in this font file;
Font format according to user selection finds the target font file, and the Chinese character that the user inputs is carried out the Unicode code change to obtain corresponding Unicode code set, then revise the parameter of corresponding attribute in the described target font file according to described Unicode code set;
Target font file after the modification parameter is loaded, and generate corresponding font texture;
Obtain the UV coordinate of described font texture;
UV coordinate according to described font texture carries out rectangle establishment and texture;
Font texture after the texture is carried out color and size setting, then carry out 3d and play up.
Realize the device of Chinese mark in a kind of three-dimensional scenic, comprising:
Initialization module is used for creating corresponding font file for each font, sets in advance the parameter of each attribute in this font file;
Processing module, be used for finding corresponding target font file according to the font format of user selection, and the Chinese character that the user inputs is carried out the Unicode code change to obtain corresponding Unicode code set, then revise the parameter of corresponding attribute in the described target font file according to described Unicode code set;
Font texture generation module is used for the target font file after parameter is revised in loading, and generates accordingly corresponding font texture;
Coordinate obtaining module is for the UV coordinate that obtains described font texture;
Rendering module is used for carrying out rectangle establishment and texture according to the UV coordinate of described font texture, then carries out 3d and plays up.
Compare with the method that realizes the Chinese mark in the traditional three-dimensional scenic, realize in the three-dimensional scenic of the present invention that method and the device of Chinese mark has following advantage:
One, efficient is high: before inputting word information, need not create the initialization that background process carries out fontlib, the font file that only needs to create required font gets final product.This will reduce the workload of initialization procedure greatly in a lot of situation of the font of required support, thereby will have improved the efficient that realizes the Chinese mark in the three-dimensional scenic.
Two, can mark in real time: the Unicode code set that the present invention can find according to the font format of user selection corresponding target font file and obtain correspondence according to the word content of user's input, and then generating in real time corresponding font texture, this process is Millisecond.
Three, support multi-font: the corresponding font file of each font, can directly locate, need not search for.
Description of drawings
Fig. 1 is the method flow synoptic diagram of realizing the Chinese mark in a kind of three-dimensional scenic of the present invention;
Fig. 2 is the apparatus structure synoptic diagram of realizing the Chinese mark in a kind of three-dimensional scenic of the present invention.
Embodiment
In the OGRE d engine, font format exists with the material object, has gathered Texture features and coordinate information thereof.These font informations are kept in the file of .fontdef form, and resolved when this document starts in system, its basic format is as follows:
Wherein, the type attribute: TrueType font, tell OGRE to generate the texture font;
The source attribute: the ttf file that represents Chinese font is written into, and is written into such as the simkai.ttf file;
The size attribute: the size of font point, the point here is the unit of conventional metered dose word size, 1p ≈ 0.35mm;
The resolution attribute: monitor resolution/dots per inch, this is the size of binding site, to determine the final size of this font correspondence on target indicator;
Code points attribute: this attribute allows the user to specify which Unicode code point need to obtain the font texture, i.e. character set in the label character.
On the basis of the present invention's font display module research in to the OGRE d engine, by analyzing the literal use principle of OGRE, propose to realize in the following three-dimensional scenic method of Chinese mark, referring to shown in Figure 1, the method may further comprise the steps:
Step S101 creates corresponding font file for each font and loads for ORGE, then enters step S102.Need to prove: the parameter that sets in advance each attribute in the font file of described establishment.
As an embodiment preferably, the parameter of each attribute can be set to as follows in the described font file: the Type setup of attribute is TrueType font; The source setup of attribute is the ttf file of representative Chinese font,, such as the simkai.ttf regular script, the simsun.ttf Song typeface, simhei.ttf black matrix etc.; Size attribute and resolution setup of attribute are under the default situations, namely are set to respectively 16,96; The code_points setup of attribute is 33-166 in addition, i.e. corresponding all Latin characters.
In addition, as an embodiment preferably, the font file of above-mentioned establishment can be the file of fontdef form.
Step S102 processes the Chinese character that will mark.Detailed process comprises: at first the font format according to user selection finds corresponding target font file, and the Chinese character that the user inputs is carried out the Unicode code change to obtain corresponding Unicode code set, then revise the parameter of corresponding attribute (being the code_points attribute) in the described target font file according to described Unicode code set, enter step S103 after having revised.
In fact before step S102, can also comprise the steps: the font file that 3D software creates among the load step S101 when starting, and generate the form of corresponding font name and font file.
Step S103, the target font file after the parameter is revised in loading, and generates accordingly corresponding font texture, then enters step S104.The relevant interface function that 3D software transfer ORGE engine provides can be realized the font file of having revised the code_points parameter among the step S102 is loaded, and generates corresponding font texture.
Step S104 obtains the UV coordinate of described font texture, then enters step S105.As an embodiment preferably, the process of the above-mentioned UV of obtaining coordinate can comprise the steps: that specifically the relevant interface that 3D software transfer OGRE engine provides travels through character string corresponding to code_points attribute in the target font file, each character is generated its corresponding UV coordinate, then calculate UV coordinate corresponding to whole character string.
Step S105 carries out rectangle according to the UV coordinate of described font texture and creates and texture, then carries out 3d and plays up.3D software can create rectangle according to UV coordinate corresponding to the character string that generates among the step S104, then the texture that generates among the step S103 is inserted this rectangle and can realize texture.Carry out in addition the process that 3d plays up and belong to known technology, it will not go into details in the present invention.
As an embodiment preferably, among the described step S105 after carrying out texture, carry out can also comprising step before 3d plays up: according to user's demand, the font texture after the texture is carried out color and size arranges.Such as the relevant interface that can call the OGRE engine and provide font color is arranged to user-selected font color.
In addition, corresponding with the method for realization Chinese mark in above-mentioned a kind of three-dimensional scenic, the present invention also realizes the device that Chinese marks in a kind of three-dimensional scenic, as shown in Figure 2, comprising:
Font texture generation module 103 is used for the target font file after parameter is revised in loading, and generates accordingly corresponding font texture;
Rendering module 105 is used for carrying out rectangle establishment and texture according to the UV coordinate of described font texture, then carries out 3d and plays up.
Make this preferably embodiment, the font file that creates in the described initialization module 101 can be the file of fontdef form.
Make this preferably embodiment, described rendering module 105 can comprise module is set, and is used for after carrying out texture, carries out before 3d plays up, and the font texture after the texture is carried out color and size arranges.
Other technical characterictic of realizing the device that Chinese marks in the three-dimensional scenic of the present invention is identical with the method for realization Chinese mark in above-mentioned a kind of three-dimensional scenic, and it will not go into details herein.
Compare with the method that realizes the Chinese mark in the traditional three-dimensional scenic, realize in the three-dimensional scenic of the present invention that method and the device of Chinese mark has following advantage:
One, efficient is high: before inputting word information, need not create the initialization that background process carries out fontlib, the font file that only needs to create required font gets final product.This will reduce the workload of initialization procedure greatly in a lot of situation of the font of required support, thereby will improve the efficient that realizes the Chinese mark in the three-dimensional scenic.
Two, can mark in real time: the Unicode code set that the present invention can find according to the font format of user selection corresponding target font file and obtain correspondence according to the word content of user's input, and then generating in real time corresponding font texture, this process is Millisecond.
Three, support multi-font: the corresponding font file of each font, can directly locate, need not search for.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to claim of the present invention.Should be pointed out that for the person of ordinary skill of the art without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.
Claims (7)
1. realize the method that Chinese marks in a three-dimensional scenic, it is characterized in that, may further comprise the steps:
Create corresponding font file for each font, set in advance the parameter of each attribute in this font file;
Font format according to user selection finds corresponding target font file, and the Chinese character that the user inputs is carried out the Unicode code change to obtain corresponding Unicode code set, then revise the parameter of corresponding attribute in the described target font file according to described Unicode code set;
The target font file after the parameter is revised in loading, and generates accordingly corresponding font texture;
Obtain the UV coordinate of described font texture;
UV coordinate according to described font texture carries out rectangle establishment and texture, then carries out 3d and plays up.
2. realize the method for Chinese mark in the three-dimensional scenic according to claim 1, it is characterized in that, described carry out texture after, carry out also comprising step before 3d plays up: the font texture after the texture is carried out color and size arranges.
3. realize the method for Chinese mark in the three-dimensional scenic according to claim 1, it is characterized in that the font file of described establishment is the file of fontdef form.
4. realize the method for Chinese mark according to claim 1 and 2 or in the 3 described three-dimensional scenics, it is characterized in that the parameter of each attribute is set to as follows in the described font file: the Type setup of attribute is TrueType font; The source setup of attribute is the ttf file of representative Chinese font; The size setup of attribute is 16; The resolution setup of attribute is 96; And the code_points setup of attribute is 33-166.
5. realize the device that Chinese marks in a three-dimensional scenic, it is characterized in that, comprising:
Initialization module is used for creating corresponding font file for each font, sets in advance the parameter of each attribute in this font file;
Processing module, be used for finding corresponding target font file according to the font format of user selection, and the Chinese character that the user inputs is carried out the Unicode code change to obtain corresponding Unicode code set, then revise the parameter of corresponding attribute in the described target font file according to described Unicode code set;
Font texture generation module is used for the target font file after parameter is revised in loading, and generates accordingly corresponding font texture;
Coordinate obtaining module is for the UV coordinate that obtains described font texture;
Rendering module is used for carrying out rectangle establishment and texture according to the UV coordinate of described font texture, then carries out 3d and plays up.
6. realize the device of Chinese mark in the three-dimensional scenic according to claim 5, it is characterized in that the font file that creates in the described initialization module is the file of fontdef form.
7. realize the device of Chinese mark in the three-dimensional scenic according to claim 5, it is characterized in that, described rendering module comprises module is set, and is used for after carrying out texture, carries out before 3d plays up, and the font texture after the texture is carried out color and size arranges.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012103089499A CN102867322A (en) | 2012-08-27 | 2012-08-27 | Method and device for realizing Chinese marking in three-dimensional scene |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012103089499A CN102867322A (en) | 2012-08-27 | 2012-08-27 | Method and device for realizing Chinese marking in three-dimensional scene |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102867322A true CN102867322A (en) | 2013-01-09 |
Family
ID=47446178
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2012103089499A Pending CN102867322A (en) | 2012-08-27 | 2012-08-27 | Method and device for realizing Chinese marking in three-dimensional scene |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102867322A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105551076A (en) * | 2016-02-19 | 2016-05-04 | 杨冠平 | Three-dimensional image font library |
CN108986193A (en) * | 2018-07-10 | 2018-12-11 | 武汉国遥新天地信息技术有限公司 | It is a kind of three-dimensional text retouch side method for drafting |
WO2019228013A1 (en) * | 2018-05-31 | 2019-12-05 | 阿里巴巴集团控股有限公司 | Method, apparatus and device for displaying rich text on 3d model |
CN110826005A (en) * | 2019-11-13 | 2020-02-21 | 北大方正集团有限公司 | File generation method and device, electronic equipment and storage medium |
CN113569529A (en) * | 2021-06-25 | 2021-10-29 | 深圳震有科技股份有限公司 | Three-dimensional Chinese character construction method, system, terminal equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060170684A1 (en) * | 2005-01-28 | 2006-08-03 | Microsoft Corporation | Font cache and meta-fonts |
CN101178817A (en) * | 2007-12-25 | 2008-05-14 | 王鹏勃 | Demonstration document realization method based on three-dimensional information in three-dimensional scene |
-
2012
- 2012-08-27 CN CN2012103089499A patent/CN102867322A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060170684A1 (en) * | 2005-01-28 | 2006-08-03 | Microsoft Corporation | Font cache and meta-fonts |
CN101178817A (en) * | 2007-12-25 | 2008-05-14 | 王鹏勃 | Demonstration document realization method based on three-dimensional information in three-dimensional scene |
Non-Patent Citations (2)
Title |
---|
YANG XU ET AL.: "Research and Implementation of Chinese Characters Display in Ogre-Based Virtual Simulation Scenes", 《2011 EIGHTH INTERNATIONAL CONFERENCE ON FUZZY SYSTEMS AND KNOWLEDGE DISCOVERY》 * |
李刚等: "OGRE技术在三维仿真场景中的应用研究", 《舰船电子工程》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105551076A (en) * | 2016-02-19 | 2016-05-04 | 杨冠平 | Three-dimensional image font library |
WO2019228013A1 (en) * | 2018-05-31 | 2019-12-05 | 阿里巴巴集团控股有限公司 | Method, apparatus and device for displaying rich text on 3d model |
US10789770B1 (en) | 2018-05-31 | 2020-09-29 | Alibaba Group Holding Limited | Displaying rich text on 3D models |
US11113874B2 (en) | 2018-05-31 | 2021-09-07 | Advanced New Technologies Co., Ltd. | Displaying rich text on 3D models |
CN108986193A (en) * | 2018-07-10 | 2018-12-11 | 武汉国遥新天地信息技术有限公司 | It is a kind of three-dimensional text retouch side method for drafting |
CN110826005A (en) * | 2019-11-13 | 2020-02-21 | 北大方正集团有限公司 | File generation method and device, electronic equipment and storage medium |
CN113569529A (en) * | 2021-06-25 | 2021-10-29 | 深圳震有科技股份有限公司 | Three-dimensional Chinese character construction method, system, terminal equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11507727B2 (en) | Font rendering method and apparatus, and computer-readable storage medium | |
US11216253B2 (en) | Application prototyping tool | |
CN102867322A (en) | Method and device for realizing Chinese marking in three-dimensional scene | |
CN102693553B (en) | Method and device for creating charts achieving three-dimensional effect | |
CN108205960B (en) | Method and device for rendering characters, electronic map making system and navigation system | |
CN103034502A (en) | Method for embedding dynamic real-time monitoring chart in scalable vector graphics (SVG) interface | |
CN110110152A (en) | Processing method, device, computer equipment and the storage medium of mind map | |
CN104298504A (en) | Method for achieving font rendering based on FreeType font engine | |
CN105550247A (en) | SVG standard customizable graphic symbol based power system graphic display method | |
CN109636894B (en) | Dynamic three-dimensional thermodynamic calculation method and system based on pixel rasterization | |
CN105303506A (en) | Data parallel processing method and system based on HTML5 | |
CN108961361B (en) | Method and system for generating special effect text image and computer equipment | |
CN103729190A (en) | Method for displaying unified parsing of multiple media on mobile terminal | |
WO2017143973A1 (en) | Text recognition model establishing method and device | |
CN104111913A (en) | Processing method and device of streaming document | |
WO2016155398A1 (en) | Information processing method, terminal and computer storage medium | |
CN108399156B (en) | The composition method and device of formula in a kind of pdf document | |
US9081529B1 (en) | Generation of electronic books | |
CN103605521A (en) | Method and device for realizing interface apposition | |
US8818092B1 (en) | Multi-threaded text rendering | |
US9965446B1 (en) | Formatting a content item having a scalable object | |
JP6323461B2 (en) | Server apparatus, client apparatus, information processing method, and recording medium | |
CN103488380A (en) | Method and device for displaying information | |
CN105354295B (en) | Dynamic display device and method for three-dimensional dynamic plotting point labels | |
CN109741417B (en) | Method and device for generating graphic file, computing equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20130109 |