CN107958484A - Texture coordinate computational methods and device - Google Patents

Texture coordinate computational methods and device Download PDF

Info

Publication number
CN107958484A
CN107958484A CN201711276374.6A CN201711276374A CN107958484A CN 107958484 A CN107958484 A CN 107958484A CN 201711276374 A CN201711276374 A CN 201711276374A CN 107958484 A CN107958484 A CN 107958484A
Authority
CN
China
Prior art keywords
coordinate
texture
point
road
space coordinate
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.)
Granted
Application number
CN201711276374.6A
Other languages
Chinese (zh)
Other versions
CN107958484B (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.)
Beijing Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software Technology 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 Beijing Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN201711276374.6A priority Critical patent/CN107958484B/en
Publication of CN107958484A publication Critical patent/CN107958484A/en
Application granted granted Critical
Publication of CN107958484B publication Critical patent/CN107958484B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/30Polynomial surface description
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Mathematical Optimization (AREA)
  • Algebra (AREA)
  • Remote Sensing (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the present invention provides a kind of texture coordinate computational methods and device.The described method includes:Obtain each vertex in current game scene in the corresponding each grid quadrangle of road model and the space coordinate of each distributed point;Based on the space coordinate of each vertex and each distributed point in same grid quadrangle, the conversion coefficient in conversion equation of each distributed point between space coordinate and texture coordinate is calculated;According to the conversion equation and the corresponding conversion coefficient of each distributed point being calculated, each distributed point corresponding texture coordinate in road texture mapping is calculated.The texture coordinate computational methods computational accuracy is high, can accurately calculate the texture coordinate of difference in the grid quadrangle of any shape, reduces mapping fault rate, improves player's sensory experience.

Description

Texture coordinate computational methods and device
Technical field
The present invention relates to scene of game processing technology field, in particular to a kind of texture coordinate computational methods and dress Put.
Background technology
In 3d gaming, road is part important in scene of game, and the generation of road needs to obtain Texture coordinate data of the road model in corresponding road texture mapping, in order to which each texel in the road texture mapping is mapped Corresponding position on to road model, so as to complete road product process.Wherein, high-precision texture coordinate data how is obtained The problem of being one particularly important.
In the prior art, grid when common texture coordinate calculation is according to road model progress mesh generation On point calculate texture coordinate to the distance of surrounding section, the computational accuracy of this calculation is not high, it is necessary to mark off The global shape of grid be in a kind of extremely regular state, the texture that otherwise can not calculate difference in the grid is sat , easily there is mapping error when carrying out texture mapping, influences the sensory experience of player in mark.
The content of the invention
In order to overcome above-mentioned deficiency of the prior art, it is an object of the invention to provide a kind of texture coordinate computational methods And device, the texture coordinate computational methods computational accuracy is high, in the grid quadrangle that can accurately calculate any shape The texture coordinate of difference, reduces mapping fault rate, improves player's sensory experience.
For method, preferred embodiments of the present invention provide a kind of texture coordinate computational methods, the described method includes:
Obtain each vertex in current game scene in the corresponding each grid quadrangle of road model and the sky of each distributed point Between coordinate;
Based on the space coordinate of each vertex and each distributed point in same grid quadrangle, to each distributed point space coordinate with The conversion coefficient in conversion equation between texture coordinate is calculated;
According to the conversion equation and the corresponding conversion coefficient of each distributed point being calculated, each distributed point is calculated and exists Corresponding texture coordinate in road texture mapping.
For device, preferred embodiments of the present invention provide a kind of texture coordinate computing device, and described device includes:
Space coordinate acquisition module, for obtaining in the corresponding each grid quadrangle of road model in current game scene Each vertex and the space coordinate of each distributed point;
Conversion coefficient computing module, for based on the space coordinate of each vertex and each distributed point in same grid quadrangle, Conversion coefficient in conversion equation of each distributed point between space coordinate and texture coordinate is calculated;
Texture coordinate computing module, for being according to the conversion equation and the corresponding conversion of each distributed point being calculated Number, is calculated each distributed point corresponding texture coordinate in road texture mapping.
In terms of existing technologies, the texture coordinate computational methods and device that preferred embodiments of the present invention provide have Following beneficial effect:The texture coordinate computational methods computational accuracy is high, can accurately calculate the grid four of any shape The texture coordinate of difference in the shape of side, reduces mapping fault rate, improves player's sensory experience.First, the method obtains current The space coordinate on each vertex and each distributed point in scene of game in the corresponding each grid quadrangle of road model;Then, it is described Method is based on the space coordinate of each vertex and each distributed point in same grid quadrangle, to each distributed point in space coordinate and texture The conversion coefficient in conversion equation between coordinate is calculated;Finally, the method according to the conversion equation and calculates The corresponding conversion coefficient of each distributed point arrived, is calculated each distributed point corresponding texture coordinate in road texture mapping, from And the texture coordinate of each point in the grid quadrangle of any shape is accurately calculated, the mapping fault rate of texture mapping is reduced, Improve player's sensory experience.
To enable the above objects, features and advantages of the present invention to become apparent, present pre-ferred embodiments cited below particularly, And attached drawing appended by coordinating, it is described in detail below.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, therefore be not construed as pair The restriction of the claims in the present invention protection domain, for those of ordinary skill in the art, what is do not made the creative labor Under the premise of, other relevant attached drawings can also be obtained according to these attached drawings.
Fig. 1 is the block diagram for the computing device that preferred embodiments of the present invention provide.
Fig. 2 is a kind of flow diagram for the texture coordinate computational methods that preferred embodiments of the present invention provide.
Fig. 3 is the flow diagram for the sub-step that the step S210 shown in Fig. 2 includes.
Fig. 4 is another flow diagram for the texture coordinate computational methods that preferred embodiments of the present invention provide.
Fig. 5 is the flow diagram for the sub-step that the step S209 shown in Fig. 4 includes.
Fig. 6 is that a kind of square frame of the texture coordinate computing device shown in Fig. 1 that preferred embodiments of the present invention provide shows It is intended to.
Fig. 7 is the block diagram of the space coordinate acquisition module shown in Fig. 6.
Fig. 8 is another square frame of the texture coordinate computing device shown in Fig. 1 that preferred embodiments of the present invention provide Schematic diagram.
Icon:10- computing devices;11- memories;12- processors;13- communication units;14- video card units;100- textures Coordinate computing device;110- space coordinate acquisition modules;120- conversion coefficient computing modules;130- texture coordinate computing modules; 111- mesh generation submodules;112- trigonometric ratios handle submodule;140- changes equation configuration module;150- textures map mould Block.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, instead of all the embodiments.The present invention implementation being usually described and illustrated herein in the accompanying drawings The component of example can be arranged and designed with a variety of configurations.
Therefore, below the detailed description of the embodiment of the present invention to providing in the accompanying drawings be not intended to limit it is claimed The scope of the present invention, but be merely representative of the present invention selected embodiment.Based on the embodiments of the present invention, this area is common Technical staff's all other embodiments obtained without creative efforts, belong to the model that the present invention protects Enclose.
It should be noted that:Similar label and letter represents similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing.
Below in conjunction with the accompanying drawings, elaborate to some embodiments of the present invention.In the case where there is no conflict, it is following Feature in embodiment and embodiment can be mutually combined.
Fig. 1 is refer to, is the block diagram for the computing device 10 that preferred embodiments of the present invention provide.Of the invention real Apply in example, the computing device 10 can accurately calculate and drawn by road model in the road building process of 3d gaming The corresponding texture coordinate of grid quadrangle for the arbitrary shape got, reduces road texture mapping and is mapped to the road model Mapping fault rate when upper, so as to strengthen the sensory experience of player when player participates in the 3d gaming.Wherein described grid The corresponding texture coordinate of quadrangle includes forming the texture coordinate corresponding to four vertex of the grid quadrangle, and the grid Texture coordinate in quadrangle corresponding to the different each point of distributing position.In the present embodiment, the computing device 10 can be, But it is not limited to, PC (personal computer, PC), tablet computer, personal digital assistant (personal Digital assistant, PDA) or server etc. with image processing function.
In the present embodiment, the computing device 10 can include texture coordinate computing device 100, memory 11, processing Device 12, communication unit 13 and video card unit 14.The memory 11, processor 12, communication unit 13 and video card unit 14 are each Element is directly or indirectly electrically connected between each other, to realize the transmission of data or interaction.For example, these elements are mutual It can be realized and be electrically connected by one or more communication bus or signal wire.The texture coordinate computing device 100 is included at least One can be stored in the software function module in the memory 11, the processing in the form of software or firmware (firmware) Device 12 is stored in software program and module in memory 11 by operation, so as to perform various functions at application and data Reason.
In the present embodiment, the memory 11 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only storage (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), Erasable Programmable Read Only Memory EPROM (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programmable read-only memory (Electric Erasable Programmable Read- Only Memory, EEPROM) etc..Wherein, memory 11 is used for storage program, and the processor 12 is receiving execute instruction Afterwards, described program is performed.Further, the software program in above-mentioned memory 11 and module may also include operating system, its May include the various component softwares for management system task (such as memory management, storage device control, power management etc.) and/ Or driving, and can be in communication with each other with various hardware or component software, so as to provide the running environment of other software component.
In the present embodiment, the processor 12 can be a kind of IC chip of the disposal ability with signal. The processor 12 can be general processor, including central processing unit (Central Processing Unit, CPU), network Processor (Network Processor, NP) etc..Can realize or perform disclosed each method in the embodiment of the present invention, Step and logic diagram.General processor can be microprocessor or the processor can also be any conventional processor Deng.
In the present embodiment, the communication unit 13 is used to establish the computing device 10 with setting outside other by network Communication connection between standby, and carried out data transmission by the network.
In the present embodiment, the video card unit 14 is used to carry out calculation process to graph data, to alleviate processor 12 Computing pressure.Wherein, the core component of the video card unit 14 is GPU (Graphics Processing Unit, at figure Manage device), for the pattern data information needed for computing device 10 to be carried out conversion driving, and control display to be shown.
In the present embodiment, the computing device 10 passes through the texture coordinate computing device that is stored in the memory 11 The texture coordinate of each point in each grid quadrangle corresponding to 100 pairs of road models calculates, and obtains high-precision texture Coordinate, thus in road generating process road texture mapping mapping fault rate, enhancing player participate in game when sensory experience, Improve the game comfort level of player.
It is understood that the structure shown in Fig. 1 is only a kind of structure diagram of computing device 10, the computing device 10 may also include more either less components than shown in Fig. 1 or have the configuration different from shown in Fig. 1.Shown in Fig. 1 Each component can use hardware, software or its combination realize.
Fig. 2 is refer to, is a kind of flow diagram for the texture coordinate computational methods that preferred embodiments of the present invention provide. In embodiments of the present invention, the texture coordinate computational methods are applied to above-mentioned computing device 10, below to the line shown in Fig. 2 The idiographic flow and step for managing Coordinate calculation method are described in detail.
In embodiments of the present invention, the texture coordinate computational methods comprise the following steps:
Step S210, obtains each vertex in current game scene in the corresponding each grid quadrangle of road model and each point The space coordinate layouted.
In the present embodiment, the computing device 10 can be set by network from other electronics to communicate with the computing device 10 Standby place, obtains each vertex in the corresponding each grid quadrangle of the road model and the space coordinate of each distributed point;The meter Calculating equipment 10 also can be by way of providing external input device, in each grid quadrangle for receiving game programmer's input Each vertex and the space coordinate of each distributed point;The computing device 10 can also be drawn by directly carrying out grid to the road model Office is managed and the mode of coordinate identifying processing, and each vertex and the space of each distributed point are sat in each grid quadrangle marked off Mark.Wherein, to build four vertex during corresponding grid quadrangle, the distributed point is corresponding grid quadrangle on each vertex The point of interior Arbitrary distribution or regular distribution, the grid quadrangle can be parallelogram, rectangle or irregular quadrilateral.
Alternatively, Fig. 3 is refer to, is the flow diagram for the sub-step that the step S210 shown in Fig. 2 includes.In this hair In bright embodiment, the step S210 can include sub-step S211 and sub-step S212, the sub-step S211 and the son Step S212 is as follows:
Sub-step S2111, carries out mesh generation to the road model in current game scene, obtains each net of different shapes Lattice quadrangle.
In the present embodiment, the computing device 10 carries out mesh generation to the road model in current game scene, obtains It can include to the step of each grid quadrangle of different shapes:
The road curve in the road model is sampled according to default spacing, is obtained each on the road curve Sampled point;
Centered on each sampled point, the line between neighbouring sample point is drawn out, and length is equal to the road The line segment of the road width of model, and four based on the adjacent segments drawn out vertex form four side of grid of correspondingly-shaped Shape.
Wherein, each line segment drawn out, between the sampled point and the previous sampled point of the sampled point that pass through with the line segment Line be mutually perpendicular to, and the line segment pass through sampled point be the line segment midpoint.It is made of four vertex of adjacent segments Grid quadrangle because the degree of crook of road curve and the different of distribution situation of each sampled point can there are different shapes.
Sub-step S212, trigonometric ratio processing is carried out to each grid quadrangle, obtains each vertex in corresponding grid quadrangle Space coordinate and each distributed point space coordinate.
In the present embodiment, the computing device 10 can be made every by carrying out trigonometric ratio processing to each grid quadrangle A grid quadrangle can be mutually spliced to form by multiple triangles.The computing device 10 is carrying out three to each grid quadrangle During angling processing, four vertex of each grid quadrangle corresponding sky in whole space coordinates can be obtained successively Between be used for the space coordinate that marks off each branch's point of multiple triangles in coordinate, and each grid quadrangle.
Step S220, based on the space coordinate of each vertex and each distributed point in same grid quadrangle, exists each distributed point The conversion coefficient in conversion equation between space coordinate and texture coordinate is calculated.
In the present embodiment, the conversion equation can characterize the transformational relation between space coordinate and texture coordinate, institute Conversion proportion of each distributed point in the conversion equation, the meter in corresponding grid quadrangle can be characterized by stating conversion coefficient The conversion coefficient that the generation of different distributions point is different in same grid quadrangle can be directed to by calculating equipment 10.
In the present embodiment, the space coordinate on four vertex of a grid quadrangle can be expressed as p0, p1, p2 and The texture coordinate of p3, p0 in corresponding road texture mapping is (0,0), and texture coordinates of the p1 in corresponding road texture mapping is (1,0), texture coordinates of the p2 in corresponding road texture mapping are (1,1), and textures of the p3 in corresponding road texture mapping is sat It is designated as (0,1), the corresponding texture coordinates of space coordinate p of a distributed point in the grid quadrangle are (x, y), then described Conversion equation can be represented by the formula:
Wherein, ac, bc, cd, ab, bd are distributed point conversion coefficient corresponding in the conversion equation, and x is with y For the abscissa value and ordinate value of the corresponding texture coordinate of the distributed point, then ac=F (A, C), bc=F (B, C), cd=F (C, D), ab=F (A, B), bd=F (B, D).Wherein A=p0-p, B=p1-p0, C=p3-p0, D=p2+p0-p1-p3, F ((x1, y1), (x2, y2))=x1*y2-x2*y1, the computing device 10 can be according to the skies on each vertex in same grid quadrangle Between coordinate, and the space coordinate of each distributed point obtains the conversion of each distributed point between the space coordinate and texture coordinate etc. Corresponding conversion coefficient ac, bc, cd, ab and bd in formula.
Step S230, according to the conversion equation and the corresponding conversion coefficient of each distributed point being calculated, is calculated Each distributed point corresponding texture coordinate in road texture mapping.
In the present embodiment, the computing device 10 is obtaining the corresponding conversion system of each distributed point in same grid quadrangle After number ac, bc, cd, ab and bd, asked being calculated based on described conversion coefficient ac, bc, cd, ab and bd in above-mentioned conversion equation Obtain texture coordinate of the distributed point in corresponding road texture mapping.
Fig. 4 is refer to, is another flow signal for the texture coordinate computational methods that preferred embodiments of the present invention provide Figure.In embodiments of the present invention, before the step S210, the method can also include:
Step S209, configures the conversion equation between space coordinate and texture coordinate.
Alternatively, Fig. 5 is refer to, is the flow diagram for the sub-step that the step S209 shown in Fig. 4 includes.In this reality Apply in example, the step S209 can include sub-step S201 and sub-step S202, the sub-step S201 and the sub-step S202 is as follows:
Sub-step S201, according to the positional information of mapping point of the distributed point on four edges in grid quadrangle, and corresponds to Texture coordinate of the mapping point in road texture mapping, establishes conversion of each mapping point in space coordinate and texture coordinate and closes System.
In the present embodiment, texture coordinate of the distributed point in a grid quadrangle in corresponding road texture mapping is When (x, y), which necessarily maps the mapping point or line that textured abscissa is x on the four edges of the grid quadrangle The mapping point that ordinate is y is managed, such as, the mapping point that the correspondence texture abscissa for being p4 there are space coordinate on the p0p1 of side is x, The mapping point that the correspondence texture abscissa for being p5 there are space coordinate on the p3p2 of side is x, the distributed point are then mapped at the two On the line of point, and transformational relation of the two mapping points in space coordinate and texture coordinate is represented by p4=(p1-p0) * X+p0, p5=(1-x) * p3+p2, p=(p5-p4) * y+p4, then can obtain p=(1-y) * [(1-x) * p0+x*p1]+y* [(1-x)*p3+x*p2]。
Sub-step S202, according to transformational relation of each mapping point in space coordinate and texture coordinate, four side of generation grid Conversion equation between the space coordinate and texture coordinate of shape.
In the present embodiment, the computing device 10 can pass through A=p0-p, B=p1-p0, C=p3-p0, D=p2+p0- P1-p3 peer-to-peer p=(1-y) * [(1-x) * p0+x*p1]+y* [(1-x) * p3+x*p2] is converted, obtain equation (0,0)= A+x*B+y*C+x*y*D.The computing device 10 passes through the function equity with F ((x1, y1), (x2, y2))=x1*y2-x2*y1 The both ends of formula (0,0)=A+x*B+y*C+x*y*D disappear after C computings and the B computings that disappear, so as to obtain above-mentioned conversion equation.
In embodiments of the present invention, after the step S230, the method can also include:
Step S240, according to each vertex in each grid quadrangle and the corresponding texture coordinate of each distributed point, by road texture The corresponding texel of each texture coordinate is mapped to corresponding position on the road model in textures.
In the present embodiment, the computing device 10 each distributed point in each grid quadrangle is obtained is corresponding to road line After managing the texture coordinate in textures, by based on obtained each texture coordinate by the corresponding line of each texture coordinate in road texture mapping Element is mapped to corresponding position on the road model, so as to generate complete road in current game scene.
Fig. 6 is refer to, is the texture coordinate computing device 100 shown in Fig. 1 of preferred embodiments of the present invention offer A kind of block diagram.In embodiments of the present invention, the texture coordinate computing device 100 includes space coordinate acquisition module 110th, conversion coefficient computing module 120 and texture coordinate computing module 130.
The space coordinate acquisition module 110, for obtaining the corresponding each grid four of road model in current game scene The space coordinate on each vertex and each distributed point in the shape of side.
In the present embodiment, the space coordinate acquisition module 110 can perform the step S210 in Fig. 2, on described The description of space coordinate acquisition module 110 is referred to the above description to the step S210.
Alternatively, Fig. 7 is refer to, is the block diagram of the space coordinate acquisition module 110 shown in Fig. 6.In this reality Apply in example, the space coordinate acquisition module 110 can include mesh generation submodule 111 and trigonometric ratio processing submodule 112.
The mesh generation submodule 111, for carrying out mesh generation to the road model in current game scene, obtains Each grid quadrangle of different shapes.
In the present embodiment, the mesh generation submodule 111 carries out grid to the road model in current game scene Division, obtaining the mode of each grid quadrangle of different shapes includes:
The road curve in the road model is sampled according to default spacing, is obtained each on the road curve Sampled point;
Centered on each sampled point, the line between neighbouring sample point is drawn out, and length is equal to the road The line segment of the road width of model, and four based on the adjacent segments drawn out vertex form four side of grid of correspondingly-shaped Shape.
In the present embodiment, the mesh generation submodule 111 can perform the sub-step S211 in Fig. 3, specifically retouch State and can refer to above to the detailed description of the sub-step S211.
The trigonometric ratio handles submodule 112, for carrying out trigonometric ratio processing to each grid quadrangle, obtains corresponding grid The space coordinate on each vertex in quadrangle and the space coordinate of each distributed point.
In the present embodiment, the trigonometric ratio processing submodule 112 can perform the sub-step S212 in Fig. 3, specifically Description can refer to above to the detailed description of the sub-step S212.
The conversion coefficient computing module 120, for based on the sky of each vertex and each distributed point in same grid quadrangle Between coordinate, the conversion coefficient in conversion equation of each distributed point between space coordinate and texture coordinate is calculated.
In the present embodiment, the conversion coefficient computing module 120 can perform the step S220 in Fig. 2, specifically retouch State and can refer to above to the detailed description of the step S220.
The texture coordinate computing module 130, for being corresponded to according to the conversion equation and each distributed point being calculated Conversion coefficient, each distributed point corresponding texture coordinate in road texture mapping is calculated.
In the present embodiment, the texture coordinate computing module 130 can perform the step S230 in Fig. 2, specifically retouch State and can refer to above to the detailed description of the step S230.
Fig. 8 is refer to, is the texture coordinate computing device 100 shown in Fig. 1 of preferred embodiments of the present invention offer Another block diagram.In embodiments of the present invention, the texture coordinate computing device 100 can also match somebody with somebody including conversion equation Put module 140 and textures mapping block 150.
The conversion equation configuration module 140, for the conversion equation between space coordinate and texture coordinate into configuration.
In the present embodiment, the conversion equation configuration module 140 is to conversion between space coordinate and texture coordinate etc. The mode of formula into configuration includes:
According to the positional information of mapping point of the distributed point on four edges in grid quadrangle, and correspondence mappings point is in road Texture coordinate in texture mapping, establishes transformational relation of each mapping point in space coordinate and texture coordinate;
According to transformational relation of each mapping point in space coordinate and texture coordinate, the space coordinate of generation grid quadrangle Conversion equation between texture coordinate.
The textures mapping block 150, for according to each vertex in each grid quadrangle and the corresponding texture of each distributed point Coordinate, corresponding position on the road model is mapped to by the corresponding texel of each texture coordinate in road texture mapping.
In the present embodiment, the textures mapping block 150 can perform the step S240 in Fig. 4, and specific description can With reference to the above description to the step S240.
In conclusion in the texture coordinate computational methods and device that preferred embodiments of the present invention provide, the texture Coordinate calculation method computational accuracy is high, and the texture that can accurately calculate difference in the grid quadrangle of any shape is sat Mark, reduces mapping fault rate, improves player's sensory experience.First, the method obtains road model pair in current game scene The space coordinate on each vertex and each distributed point in each grid quadrangle answered;Then, the method is based on same four side of grid The space coordinate of each vertex and each distributed point in shape, in conversion equation of each distributed point between space coordinate and texture coordinate Conversion coefficient calculated;Finally, the method is according to the conversion equation and corresponding turn of each distributed point being calculated Coefficient is changed, each distributed point corresponding texture coordinate in road texture mapping is calculated, so as to accurately calculate arbitrary shape The texture coordinate of each point in the grid quadrangle of shape, reduces the mapping fault rate of texture mapping, improves player's sensory experience.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the invention, for the skill of this area For art personnel, the invention may be variously modified and varied.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should all be included in the protection scope of the present invention.

Claims (10)

  1. A kind of 1. texture coordinate computational methods, it is characterised in that the described method includes:
    The space for obtaining each vertex in current game scene in the corresponding each grid quadrangle of road model and each distributed point is sat Mark;
    Based on the space coordinate of each vertex and each distributed point in same grid quadrangle, to each distributed point in space coordinate and texture The conversion coefficient in conversion equation between coordinate is calculated;
    According to the conversion equation and the corresponding conversion coefficient of each distributed point being calculated, each distributed point is calculated in road Corresponding texture coordinate in texture mapping.
  2. 2. according to the method described in claim 1, it is characterized in that, road model is corresponding in the acquisition current game scene The step of space coordinate on each vertex and each distributed point in each grid quadrangle, includes:
    Mesh generation is carried out to the road model in current game scene, obtains each grid quadrangle of different shapes;
    Trigonometric ratio processing is carried out to each grid quadrangle, obtain each vertex in corresponding grid quadrangle space coordinate and each point The space coordinate layouted.
  3. 3. according to the method described in claim 2, it is characterized in that, the road model in current game scene carries out net Lattice divide, and the step of obtaining each grid quadrangle of different shapes includes:
    The road curve in the road model is sampled according to default spacing, obtains each sampling on the road curve Point;
    Centered on each sampled point, the line between neighbouring sample point is drawn out, and length is equal to the road model Road width line segment, and four based on the adjacent segments drawn out vertex form the grid quadrangle of correspondingly-shaped.
  4. 4. according to the method described in claim 1, it is characterized in that, road model corresponds in the acquisition current game scene Each grid quadrangle in each vertex and each distributed point space coordinate the step of before, the method further includes:
    To the conversion equation between space coordinate and texture coordinate into configuration;
    Wherein, the step of conversion equation between space coordinate and texture coordinate configures includes:
    According to the positional information of mapping point of the distributed point on four edges in grid quadrangle, and correspondence mappings point is in road texture Texture coordinate on textures, establishes transformational relation of each mapping point in space coordinate and texture coordinate;
    According to transformational relation of each mapping point in space coordinate and texture coordinate, the space coordinate and line of generation grid quadrangle Manage the conversion equation between coordinate.
  5. 5. according to the method described in any one in claim 1-4, it is characterised in that it is described according to it is described conversion equation and The corresponding conversion coefficient of each distributed point being calculated, is calculated each distributed point corresponding texture in road texture mapping and sits After target step, the method further includes:
    According to each vertex in each grid quadrangle and the corresponding texture coordinate of each distributed point, each texture in road texture mapping is sat Mark corresponding texel and be mapped to corresponding position on the road model.
  6. 6. a kind of texture coordinate computing device, it is characterised in that described device includes:
    Space coordinate acquisition module, for obtaining each top in the corresponding each grid quadrangle of road model in current game scene The space coordinate of point and each distributed point;
    Conversion coefficient computing module, for based on the space coordinate of each vertex and each distributed point in same grid quadrangle, to each Conversion coefficient in conversion equation of the distributed point between space coordinate and texture coordinate is calculated;
    Texture coordinate computing module, for according to the conversion equation and the corresponding conversion coefficient of each distributed point that is calculated, Each distributed point corresponding texture coordinate in road texture mapping is calculated.
  7. 7. device according to claim 6, it is characterised in that the space coordinate acquisition module includes:
    Mesh generation submodule, for carrying out mesh generation to the road model in current game scene, obtains of different shapes Each grid quadrangle;
    Trigonometric ratio handles submodule, for carrying out trigonometric ratio processing to each grid quadrangle, obtains in corresponding grid quadrangle The space coordinate of the space coordinate on each vertex and each distributed point.
  8. 8. device according to claim 7, it is characterised in that the mesh generation submodule is in current game scene Road model carries out mesh generation, and obtaining the mode of each grid quadrangle of different shapes includes:
    The road curve in the road model is sampled according to default spacing, obtains each sampling on the road curve Point;
    Centered on each sampled point, the line between neighbouring sample point is drawn out, and length is equal to the road model Road width line segment, and four based on the adjacent segments drawn out vertex form the grid quadrangle of correspondingly-shaped.
  9. 9. device according to claim 6, it is characterised in that described device further includes:
    Change equation configuration module, for the conversion equation between space coordinate and texture coordinate into configuration;
    Wherein, mode bag of the conversion equation configuration module to the conversion equation between space coordinate and texture coordinate into configuration Include:
    According to the positional information of mapping point of the distributed point on four edges in grid quadrangle, and correspondence mappings point is in road texture Texture coordinate on textures, establishes transformational relation of each mapping point in space coordinate and texture coordinate;
    According to transformational relation of each mapping point in space coordinate and texture coordinate, the space coordinate and line of generation grid quadrangle Manage the conversion equation between coordinate.
  10. 10. according to the device described in any one in claim 6-9, it is characterised in that described device further includes:
    Textures mapping block, for according to each vertex in each grid quadrangle and the corresponding texture coordinate of each distributed point, by road The corresponding texel of each texture coordinate is mapped to corresponding position on the road model in texture mapping.
CN201711276374.6A 2017-12-06 2017-12-06 Texture coordinate calculation method and device Active CN107958484B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711276374.6A CN107958484B (en) 2017-12-06 2017-12-06 Texture coordinate calculation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711276374.6A CN107958484B (en) 2017-12-06 2017-12-06 Texture coordinate calculation method and device

Publications (2)

Publication Number Publication Date
CN107958484A true CN107958484A (en) 2018-04-24
CN107958484B CN107958484B (en) 2021-03-30

Family

ID=61958013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711276374.6A Active CN107958484B (en) 2017-12-06 2017-12-06 Texture coordinate calculation method and device

Country Status (1)

Country Link
CN (1) CN107958484B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109448095A (en) * 2018-10-17 2019-03-08 北京新能源汽车股份有限公司 Method and device for acquiring building model in navigation map and terminal
CN109741420A (en) * 2018-12-29 2019-05-10 北京金山安全软件有限公司 Region filling method and device, electronic equipment and storage medium
CN109754450A (en) * 2018-12-29 2019-05-14 深圳市创梦天地科技有限公司 A kind of racing track generation method, device and equipment
CN112819939A (en) * 2021-03-08 2021-05-18 网易(杭州)网络有限公司 Method, apparatus, device and computer readable storage medium for correcting UV coordinates
CN113144614A (en) * 2021-05-21 2021-07-23 苏州仙峰网络科技股份有限公司 Texture sampling Map computing method and device based on Tiled Map
WO2022116012A1 (en) * 2020-12-01 2022-06-09 华为技术有限公司 Texture processing method and apparatus
CN116048531A (en) * 2023-03-30 2023-05-02 南京砺算科技有限公司 Instruction compiling method, graphic processing unit, storage medium and terminal equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1395222A (en) * 2001-06-29 2003-02-05 三星电子株式会社 Representation and diawing method of three-D target and method for imaging movable three-D target
CN101872492A (en) * 2010-06-09 2010-10-27 中国科学院深圳先进技术研究院 Multi-angle map implementation method of three-dimensional simulation city
US20140125654A1 (en) * 2003-02-14 2014-05-08 Everyscape, Inc. Modeling and Editing Image Panoramas
CN104637089A (en) * 2015-02-15 2015-05-20 腾讯科技(深圳)有限公司 Three-dimensional model data processing method and device
CN104680573A (en) * 2015-01-20 2015-06-03 西安科技大学 Texture mapping method based on triangular mesh simplification
CN106327566A (en) * 2016-08-30 2017-01-11 北京像素软件科技股份有限公司 Method for generating virtual-reality three dimensional road

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1395222A (en) * 2001-06-29 2003-02-05 三星电子株式会社 Representation and diawing method of three-D target and method for imaging movable three-D target
US20140125654A1 (en) * 2003-02-14 2014-05-08 Everyscape, Inc. Modeling and Editing Image Panoramas
CN101872492A (en) * 2010-06-09 2010-10-27 中国科学院深圳先进技术研究院 Multi-angle map implementation method of three-dimensional simulation city
CN104680573A (en) * 2015-01-20 2015-06-03 西安科技大学 Texture mapping method based on triangular mesh simplification
CN104637089A (en) * 2015-02-15 2015-05-20 腾讯科技(深圳)有限公司 Three-dimensional model data processing method and device
CN106327566A (en) * 2016-08-30 2017-01-11 北京像素软件科技股份有限公司 Method for generating virtual-reality three dimensional road

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CHUNMEI HU 等: "MAPPPING DIGITAL IMAGE TEXTURE ONTO 3D MODEL FROM LIDAR DATA", 《ISPRS CONGRESS(2008)》 *
田玲: "基于体绘制的三维数据场可视化技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
顾海燕: "路面三维模型真实感显示技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109448095A (en) * 2018-10-17 2019-03-08 北京新能源汽车股份有限公司 Method and device for acquiring building model in navigation map and terminal
CN109741420A (en) * 2018-12-29 2019-05-10 北京金山安全软件有限公司 Region filling method and device, electronic equipment and storage medium
CN109754450A (en) * 2018-12-29 2019-05-14 深圳市创梦天地科技有限公司 A kind of racing track generation method, device and equipment
CN109754450B (en) * 2018-12-29 2022-12-20 深圳市创梦天地科技有限公司 Method, device and equipment for generating track
CN109741420B (en) * 2018-12-29 2023-06-27 北京金山安全软件有限公司 Region filling method and device, electronic equipment and storage medium
WO2022116012A1 (en) * 2020-12-01 2022-06-09 华为技术有限公司 Texture processing method and apparatus
CN112819939A (en) * 2021-03-08 2021-05-18 网易(杭州)网络有限公司 Method, apparatus, device and computer readable storage medium for correcting UV coordinates
CN112819939B (en) * 2021-03-08 2023-07-07 网易(杭州)网络有限公司 Method, apparatus, device and computer readable storage medium for correcting UV coordinates
CN113144614A (en) * 2021-05-21 2021-07-23 苏州仙峰网络科技股份有限公司 Texture sampling Map computing method and device based on Tiled Map
CN113144614B (en) * 2021-05-21 2024-08-16 苏州仙峰网络科技股份有限公司 Tiled Map-based texture sampling mapping calculation method and Tiled Map-based texture sampling mapping calculation device
CN116048531A (en) * 2023-03-30 2023-05-02 南京砺算科技有限公司 Instruction compiling method, graphic processing unit, storage medium and terminal equipment
CN116048531B (en) * 2023-03-30 2023-08-08 南京砺算科技有限公司 Instruction compiling method, graphic processing device, storage medium and terminal equipment

Also Published As

Publication number Publication date
CN107958484B (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN107958484A (en) Texture coordinate computational methods and device
CN107479792B (en) Intelligent grid forecast correction method and system
CN109903366A (en) The rendering method and device of dummy model, storage medium and electronic equipment
CN108159693B (en) Game scene construction method and device
CN112489213A (en) Three-dimensional terrain model generation method and device, electronic equipment and storage medium
CN106898040A (en) Virtual resource object rendering intent and device
CN109377500A (en) Image partition method and terminal device neural network based
CN107607090A (en) Building projects method and device for correcting
CN113538706A (en) Digital sand table-based house scene display method, device, equipment and storage medium
CN111915712A (en) Illumination rendering method and device, computer readable medium and electronic equipment
CN116109803B (en) Information construction method, device, equipment and storage medium
CN109887063B (en) Method and device for realizing virtual fluid in three-dimensional space, medium and electronic equipment
CN111383311B (en) Normal map generation method, device, equipment and storage medium
CN116522552A (en) Machine room wiring method and system
CN112734900B (en) Baking method, device and equipment for shadow map and computer readable storage medium
JPS6386079A (en) Three-dimensional shadow image forming processing device
CN111882638A (en) Picture rendering method, device, equipment and medium
CN106846498A (en) Laser point cloud rendering intent and device
CN111882637B (en) Picture rendering method, device, equipment and medium
CN101021840A (en) Electronic form unit grid drawing method and apparatus
CN115619986A (en) Scene roaming method, device, equipment and medium
CN114996374A (en) Online data visualization implementation method, system, device and medium
CN114170367A (en) Method, apparatus, storage medium, and device for infinite-line-of-sight pyramidal heatmap rendering
CN118395744B (en) Flooding simulation method and device applied to distribution room and electronic equipment
CN115828794B (en) Tree pollen concentration prediction method and device under urban scale

Legal Events

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