CN106055331B - Model boundary generation method and device - Google Patents

Model boundary generation method and device Download PDF

Info

Publication number
CN106055331B
CN106055331B CN201610375665.XA CN201610375665A CN106055331B CN 106055331 B CN106055331 B CN 106055331B CN 201610375665 A CN201610375665 A CN 201610375665A CN 106055331 B CN106055331 B CN 106055331B
Authority
CN
China
Prior art keywords
model
value
dir
copy
fresnel
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.)
Active
Application number
CN201610375665.XA
Other languages
Chinese (zh)
Other versions
CN106055331A (en
Inventor
吴拥民
何汉鑫
许凯杰
刘德建
陈宏展
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian TQ Digital Co Ltd
Original Assignee
Fujian TQ Digital Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Fujian TQ Digital Co Ltd filed Critical Fujian TQ Digital Co Ltd
Priority to CN201610375665.XA priority Critical patent/CN106055331B/en
Publication of CN106055331A publication Critical patent/CN106055331A/en
Application granted granted Critical
Publication of CN106055331B publication Critical patent/CN106055331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Processing Or Creating Images (AREA)

Abstract

For provide it is a kind of be simple and efficient, have a wide range of application, scheme can be generated in the model boundary used in mobile device, the method that inventor provides include the following steps: replicating original model and generate a copy model in its position;Pre-determined distance is expanded in three axes direction in the model space in the three-dimensional coordinate system where archetype respectively;Obtain the direction V of video camera sightdirWith the normal direction N of copy model, and by the direction V of video camera sightdirFresnel value is obtained with the normal direction N of copy model;The material color value for enabling final copy model is value of the preset boundary RGB color value multiplied by Fresnel, and enabling the value of transparency is Fresnel.Inventor simultaneously provide realize the above method device, the method to generate boundary can be amplified using model itself, using tinter progress edge coloring method to realize, fast and efficiently model retouches side effect.

Description

Model boundary generation method and device
Technical field
The present invention relates to software field, in particular to a kind of model boundary generation method calculated for game engine and dress It sets.
Background technique
The dominant technical approach for retouch side to model in the prior art specifically includes that
1, the post-processing based on screen space retouch the scheme on side.The disadvantages of this solution is its property on the mobile apparatus It can be lower.
2, it carries out expanding in the normal direction using vertex shader retouching side.The problem of program, is that it is only applicable to portion The uniform model of point-score line transition.
Due to the constraint of hardware performance, it is difficult to adopt the post-processing scheme of screen space on a mobile platform to carry out model Retouch side, efficiency receives a degree of restriction.
Summary of the invention
It a kind of be simple and efficient, have a wide range of application, can be generated in the model boundary that is used in mobile device for this reason, it may be necessary to provide Method and apparatus.
To achieve the above object, a kind of model boundary generation method is inventor provided, is included the following steps:
Replicating original model simultaneously generates a copy model in its position;
Three axes direction in the model space in the three-dimensional coordinate system where archetype is expanded in advance respectively If distance;
Obtain the direction V of video camera sightdirWith the normal direction N of copy model, and by the direction V of video camera sightdir Fresnel value is obtained with the normal direction N of copy model;
The material color value for enabling final copy model is value of the preset boundary RGB color value multiplied by Fresnel, and is enabled saturating The value of lightness is Fresnel.
Further, in the model boundary generation method, the pre-determined distance is preset border width.
Further, in the model boundary generation method, the direction V of video camera sight is obtaineddirMethod specifically wrap It includes:
Obtain position P of the video camera in the model spacecamWith position V of the vertex in the model spacepos
With formula Vdir=Pcam-VposObtain VdirValue.
Further, in the model boundary generation method, the method for obtaining the normal direction N of copy model is specifically wrapped It includes: obtaining the direction N of normal from copy model or normal map.
Further, in the model boundary generation method, by the direction V of video camera sightdirWith the method for copy model The method that line direction N obtains Fresnel value specifically includes:
To VdirIt is standardized with N;
With formula F resnel=(1.0-dot (Vdir,N))nFresnel value is obtained, the Vdir and N in formula are through standard Change treated numerical value.
Further, in the model boundary generation method, formula F resnel=(1.0-dot (Vdir,N))nIn n Value depends on preset border width, and the more big then n value of preset border width is smaller.
Inventor additionally provides a kind of model boundary generating means simultaneously, including copied cells, retouches side unit and calculate single Member;
The copied cells generate a copy model for replicating original model and in its position;
The side unit of retouching is for three coordinates in the model space in the three-dimensional coordinate system where archetype Axis direction expands pre-determined distance respectively;
The computing unit is used to obtain the direction V of video camera sightdirWith the normal direction N of copy model, and by imaging The direction V of machine sightdirFresnel value is obtained with the normal direction N of copy model;
It is described retouch side unit be also used to enable final copy model material color value be preset boundary RGB color value multiplied by The value of Fresnel, and enabling the value of transparency is Fresnel.
Further, in the model boundary generating means, the pre-determined distance is preset border width.
Further, in the model boundary generating means, computing unit obtains the direction V of video camera sightdirSide Method specifically includes:
Obtain position P of the video camera in the model spacecamWith position V of the vertex in the model spacepos
With formula Vdir=Pcam-VposObtain VdirValue.
Further, in the model boundary generating means, computing unit obtains the side of the normal direction N of copy model Method specifically includes: the direction N of normal is obtained from copy model or normal map.
Further, in the model boundary generating means, computing unit by video camera sight direction VdirAnd copy The method that the normal direction N of model obtains Fresnel value specifically includes:
To VdirIt is standardized with N;
With formula F resnel=(1.0-dot (Vdir,N))nFresnel value is obtained, the Vdir and N in formula are through standard Change treated numerical value.
Further, in the model boundary generating means, formula F resnel=(1.0-dot (Vdir,N))nIn n Value depends on preset border width, and the more big then n value of preset border width is smaller.
It is different from the prior art, the method that above-mentioned technical proposal can be amplified using model itself to generate boundary, Using tinter carry out edge coloring method to realize, fast and efficiently model retouches side effect.
Detailed description of the invention
Fig. 1 is the flow chart of model boundary generation method described in an embodiment of the present invention;
Fig. 2 is the structural schematic diagram of model boundary generating means described in an embodiment of the present invention.
Description of symbols:
1- copied cells
2- retouches side unit
3- computing unit
Specific embodiment
Technology contents, construction feature, the objects and the effects for detailed description technical solution, below in conjunction with specific reality It applies example and attached drawing is cooperated to be explained in detail.
Referring to Fig. 1, for the flow chart of model boundary generation method described in an embodiment of the present invention;The method packet Include following steps:
S1, replicating original model simultaneously generate a copy model in its position;
S2, the three axes direction in the model space in the three-dimensional coordinate system where archetype are expanded respectively Pre-determined distance;
S3, the direction V for obtaining video camera sightdirWith the normal direction N of copy model, and by the direction of video camera sight VdirFresnel value is obtained with the normal direction N of copy model;
S4, the material color value for enabling final copy model are value of the preset boundary RGB color value multiplied by Fresnel, and The value for enabling transparency is Fresnel.
In some embodiments, pre-determined distance described in step S2 is preset border width, that is, this method institute The width on the boundary to be generated retouches hem width degree, specifically retouches hem width degree and should be taken by actual demand and is determined.
In some embodiments, the direction V of video camera sight is obtained described in step S3dirMethod specifically include as Under step by step:
S31, position P of the video camera in the model space is obtainedcamWith position V of the vertex in the model spacepos
S32, with formula Vdir=Pcam-VposObtain VdirValue.
In some embodiments, the method that the normal direction N of copy model is obtained described in step S3 specifically includes: from The direction N of normal is obtained in copy model or normal map.
In some embodiments, by the direction V of video camera sight described in step S3dirWith the normal side of copy model The method for obtaining Fresnel value to N specifically includes:
S33, to VdirIt is standardized with N;
S34, with formula F resnel=(1.0-dot (Vdir,N))nFresnel value is obtained, the Vdir and N in formula are warp Numerical value after standardization.
Further, in some embodiments, the (1.0-dot (V of formula F resnel=described in step S34dir, N))nIn n value depend on preset border width, under normal circumstances, the more big then n value of preset border width is smaller, specifically It is fixed that the determination of n value can be attempted to take according to the actual situation.
In present embodiment, step S3, the operation described in S4 is actually render process, to be solved in the technical program The technical issues of concrete condition under, the mode of rendering should be deleting madel front and only the model back side is rendered.
Referring to Fig. 2, for the structural schematic diagram of model boundary generating means described in an embodiment of the present invention;The mould Type boundary generating means include copied cells 1, retouch side unit 2 and computing unit 3;
The copied cells 1 generate a copy model for replicating original model and in its position;
The side unit 2 of retouching is for three coordinates in the model space in the three-dimensional coordinate system where archetype Axis direction expands pre-determined distance respectively;
The computing unit 3 is used to obtain the direction V of video camera sightdirWith the normal direction N of copy model, and by taking the photograph The direction V of camera sightdirFresnel value is obtained with the normal direction N of copy model;
The side unit 2 of retouching is also used to enable the material color value of final copy model to multiply for preset boundary RGB color value With the value of Fresnel, and enabling the value of transparency is Fresnel.
In some embodiments, side unit 2 is retouched in the model space along the three-dimensional coordinate system where archetype In to expand pre-determined distance described in pre-determined distance respectively be preset border width, that is, the present apparatus in three axes direction The width on the boundary to be generated retouches hem width degree, specifically retouches hem width degree and should be taken by actual demand and is determined.
In some embodiments, computing unit 3 obtains the direction V of video camera sightdirMode specifically include:
Obtain position P of the video camera in the model spacecamWith position V of the vertex in the model spacepos
With formula Vdir=Pcam-VposObtain VdirValue.
In some embodiments, the method that computing unit 3 obtains the normal direction N of copy model specifically includes: from pair The direction N of normal is obtained in this model or normal map.
In some embodiments, computing unit 3 by video camera sight direction VdirWith the normal direction N of copy model The method for obtaining Fresnel value specifically includes:
To VdirIt is standardized with N;
With formula F resnel=(1.0-dot (Vdir,N))nFresnel value is obtained, the Vdir and N in formula are through standard Change treated numerical value.
Further, in some embodiments, formula F resnel=(1.0-dot (Vdir,N))nIn n value depend on Preset border width, the more big then n value of preset border width are smaller.
Computing unit 3 and to retouch the operation that side unit 2 is done be actually render process in present embodiment, in this technology side Under the concrete condition of case technical problem to be solved, the mode of rendering should be deleting madel front and only to the model back side carry out Rendering.
It is different from the prior art, technical solution of the present invention can be amplified using model itself to generate boundary Method, using tinter carry out edge coloring method to realize, fast and efficiently model retouches side effect.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or the terminal device that include a series of elements not only include those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or end The intrinsic element of end equipment.In the absence of more restrictions, being limited by sentence " including ... " or " including ... " Element, it is not excluded that there is also other elements in process, method, article or the terminal device for including the element.This Outside, herein, " being greater than ", " being less than ", " being more than " etc. are interpreted as not including this number;" more than ", " following ", " within " etc. understand Being includes this number.
It should be understood by those skilled in the art that, the various embodiments described above can provide as method, apparatus or computer program production Product.Complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in these embodiments Form.The all or part of the steps in method that the various embodiments described above are related to can be instructed by program relevant hardware come It completes, the program can store in the storage medium that computer equipment can be read, for executing the various embodiments described above side All or part of the steps described in method.The computer equipment, including but not limited to: personal computer, server, general-purpose computations It is machine, special purpose computer, the network equipment, embedded device, programmable device, intelligent mobile terminal, smart home device, wearable Smart machine, vehicle intelligent equipment etc.;The storage medium, including but not limited to: RAM, ROM, magnetic disk, tape, CD, sudden strain of a muscle It deposits, USB flash disk, mobile hard disk, storage card, memory stick, webserver storage, network cloud storage etc..
The various embodiments described above are referring to the method according to embodiment, equipment (system) and computer program product Flowchart and/or the block diagram describes.It should be understood that can be realized by computer program instructions every in flowchart and/or the block diagram The combination of process and/or box in one process and/or box and flowchart and/or the block diagram.It can provide these computers Program instruction generates a machine to the processor of computer equipment, so that the finger executed by the processor of computer equipment It enables and generates to specify in one or more flows of the flowchart and/or one or more blocks of the block diagram The device of function.
These computer program instructions, which may also be stored in, to be able to guide computer equipment computer operate in a specific manner and sets In standby readable memory, so that the instruction being stored in the computer equipment readable memory generates the manufacture including command device Product, command device realization refer in one or more flows of the flowchart and/or one or more blocks of the block diagram Fixed function.
These computer program instructions can also be loaded into computer equipment, so that executing on a computing device a series of Operating procedure is to generate computer implemented processing, so that the instruction executed on a computing device is provided for realizing in process The step of function of being specified in figure one process or multiple processes and/or block diagrams one box or multiple boxes.
Although the various embodiments described above are described, once a person skilled in the art knows basic wounds The property made concept, then additional changes and modifications can be made to these embodiments, so the above description is only an embodiment of the present invention, It is not intended to limit scope of patent protection of the invention, it is all to utilize equivalent structure made by description of the invention and accompanying drawing content Or equivalent process transformation, being applied directly or indirectly in other relevant technical fields, similarly includes in patent of the invention Within protection scope.

Claims (10)

1. a kind of model boundary generation method, which comprises the steps of:
Replicating original model simultaneously generates a copy model in its position;
Three axes direction in the model space in the three-dimensional coordinate system where archetype expand respectively it is default away from From;
Obtain the direction V of video camera sightdirWith the normal direction N of copy model, and by the direction V of video camera sightdirAnd pair The normal direction N of this model obtains Fresnel value, and the method for obtaining the normal direction N of copy model specifically includes: from copy mould The direction N of normal is obtained in type or normal map;
The material color value for enabling final copy model is value of the preset boundary RGB color value multiplied by Fresnel, and enables transparency Value be Fresnel.
2. model boundary generation method as described in claim 1, which is characterized in that the pre-determined distance is that preset boundary is wide Degree.
3. model boundary generation method as claimed in claim 1 or 2, which is characterized in that obtain the direction V of video camera sightdir Method specifically include:
Obtain position P of the video camera in the model spacecamWith position V of the vertex in the model spacepos
With formula Vdir=Pcam-VposObtain VdirValue.
4. model boundary generation method as claimed in claim 1 or 2, which is characterized in that by the direction V of video camera sightdirWith The method that the normal direction N of copy model obtains Fresnel value specifically includes:
To VdirIt is standardized with N;
With formula F resnel=(1.0-dot (Vdir,N))nFresnel value is obtained, the Vdir and N in formula are normalized place Numerical value after reason.
5. model boundary generation method as claimed in claim 4, which is characterized in that formula F resnel=(1.0-dot (Vdir, N))nIn n value depend on preset border width, the more big then n value of preset border width is smaller.
6. a kind of model boundary generating means, which is characterized in that including copied cells, retouch side unit and computing unit;
The copied cells generate a copy model for replicating original model and in its position;
The side unit of retouching is for the three axes side in the model space in the three-dimensional coordinate system where archetype To expanding pre-determined distance respectively;
The computing unit is used to obtain the direction V of video camera sightdirWith the normal direction N of copy model, and regarded by video camera The direction V of linedirFresnel value is obtained with the normal direction N of copy model, computing unit obtains the normal direction N of copy model Method specifically include: from copy model or normal map obtain normal direction N;
It is described retouch side unit be also used to enable final copy model material color value be preset boundary RGB color value multiplied by The value of Fresnel, and enabling the value of transparency is Fresnel.
7. model boundary generating means as claimed in claim 6, which is characterized in that the pre-determined distance is that preset boundary is wide Degree.
8. model boundary generating means as claimed in claims 6 or 7, which is characterized in that computing unit obtains video camera sight Direction VdirMethod specifically include:
Obtain position P of the video camera in the model spacecamWith position V of the vertex in the model spacepos
With formula Vdir=Pcam-VposObtain VdirValue.
9. model boundary generating means as claimed in claims 6 or 7, which is characterized in that computing unit is by video camera sight Direction VdirIt is specifically included with the normal direction N of the copy model method for obtaining Fresnel value:
To VdirIt is standardized with N;
With formula F resnel=(1.0-dot (Vdir,N))nFresnel value is obtained, the Vdir and N in formula are normalized place Numerical value after reason.
10. model boundary generating means as claimed in claim 9, which is characterized in that formula F resnel=(1.0-dot (Vdir,N))nIn n value depend on preset border width, the more big then n value of preset border width is smaller.
CN201610375665.XA 2016-05-31 2016-05-31 Model boundary generation method and device Active CN106055331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610375665.XA CN106055331B (en) 2016-05-31 2016-05-31 Model boundary generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610375665.XA CN106055331B (en) 2016-05-31 2016-05-31 Model boundary generation method and device

Publications (2)

Publication Number Publication Date
CN106055331A CN106055331A (en) 2016-10-26
CN106055331B true CN106055331B (en) 2019-12-03

Family

ID=57172392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610375665.XA Active CN106055331B (en) 2016-05-31 2016-05-31 Model boundary generation method and device

Country Status (1)

Country Link
CN (1) CN106055331B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109827646A (en) * 2018-12-21 2019-05-31 太原重工股份有限公司 Weighing method and weighing device for powder material
CN110286840B (en) * 2019-06-25 2022-11-11 广州视源电子科技股份有限公司 Gesture zooming control method and device of touch equipment and related equipment
CN111729322A (en) * 2020-06-15 2020-10-02 完美世界(北京)软件科技发展有限公司 Model stroke processing method and device, computer equipment and readable storage medium
CN112509131B (en) 2020-11-20 2022-12-06 上海莉莉丝网络科技有限公司 Rendering method, system and computer readable storage medium for map area boundary in game map
CN114791800B (en) * 2022-06-21 2022-09-23 杭州美创科技有限公司 White-model building edge tracing method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2680224A1 (en) * 2012-06-27 2014-01-01 Vestel Elektronik Sanayi ve Ticaret A.S. Method and device for determining a depth image
CN105279782A (en) * 2015-07-02 2016-01-27 苏州蜗牛数字科技股份有限公司 Simulation and rendering method of real-time sea system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2680224A1 (en) * 2012-06-27 2014-01-01 Vestel Elektronik Sanayi ve Ticaret A.S. Method and device for determining a depth image
CN105279782A (en) * 2015-07-02 2016-01-27 苏州蜗牛数字科技股份有限公司 Simulation and rendering method of real-time sea system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
卡通着色,描边;Zephyroal;《卡通着色,描边》;20120319;正文第2页 *
给物体边缘加高光轮廓的办法,付Demo(增加一组算法);Hog;《给物体边缘加高光轮廓的办法,付Demo(增加一组算法)》;20120831;正文第1页 *

Also Published As

Publication number Publication date
CN106055331A (en) 2016-10-26

Similar Documents

Publication Publication Date Title
CN106055331B (en) Model boundary generation method and device
Karni et al. Energy‐based image deformation
US8665267B2 (en) System and method for generating 3D surface patches from unconstrained 3D curves
US20190251401A1 (en) Image composites using a generative adversarial neural network
Robson et al. Context-aware garment modeling from sketches
US9330466B2 (en) Methods and apparatus for 3D camera positioning using a 2D vanishing point grid
US10832034B2 (en) Facial image generating method, facial image generating apparatus, and facial image generating device
Schreck et al. Nonsmooth developable geometry for interactively animating paper crumpling
US10452788B2 (en) Modeling a three-dimensional object having multiple materials
WO2013155603A1 (en) Systems and methods for displaying animations on a mobile device
CN111724481A (en) Method, device, equipment and storage medium for three-dimensional reconstruction of two-dimensional image
Yeh et al. Interactive high-relief reconstruction for organic and double-sided objects from a photo
Chien et al. Bounded distortion harmonic shape interpolation
Ji et al. Geometry-aware single-image full-body human relighting
Edmunds et al. Advanced, Automatic Stream Surface Seeding and Filtering.
CN107341841B (en) Generation method of gradual animation and computing device
KR20160016812A (en) Image edits propagation to underlying video sequence via dense motion fields
Das et al. Learning an isometric surface parameterization for texture unwrapping
Shi et al. Filling n-sided regions with G 1 triangular Coons B-spline patches
US11100707B2 (en) Computer graphics method for terrain rendering
Zanni et al. N-ary implicit blends with topology control
CN110415351B (en) Method, device and system for constructing three-dimensional grid based on single image
Chen et al. Simple and efficient example-based texture synthesis using tiling and deformation
CN114820980A (en) Three-dimensional reconstruction method and device, electronic equipment and readable storage medium
CN109993689B (en) Cosmetic method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant