CN105894551B - Image drawing method and device - Google Patents

Image drawing method and device Download PDF

Info

Publication number
CN105894551B
CN105894551B CN201610201407.XA CN201610201407A CN105894551B CN 105894551 B CN105894551 B CN 105894551B CN 201610201407 A CN201610201407 A CN 201610201407A CN 105894551 B CN105894551 B CN 105894551B
Authority
CN
China
Prior art keywords
geometric model
array
merging
vertex
model
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
CN201610201407.XA
Other languages
Chinese (zh)
Other versions
CN105894551A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201610201407.XA priority Critical patent/CN105894551B/en
Publication of CN105894551A publication Critical patent/CN105894551A/en
Application granted granted Critical
Publication of CN105894551B publication Critical patent/CN105894551B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses an image drawing method and device, wherein the method comprises the following steps: the method comprises the steps of obtaining drawing parameters of a first geometric model in a set drawing area, traversing the drawing area, searching a repeated geometric model identical to the first geometric model, combining the drawing parameters of the repeated geometric model with the drawing parameters of the first geometric model, and sending combined data to data rendering equipment to achieve drawing of the first geometric model and the repeated geometric model in the drawing area. By adopting the method, the technical problems of serious product performance consumption, low drawing efficiency and poor user experience in the image drawing process in the prior art can be solved.

Description

Image drawing method and device
Technical Field
The present invention relates to image processing technologies, and in particular, to an image rendering method and apparatus.
Background
With the increasing number of people who explore, explore and travel during self-driving travel, the mobile terminal with the navigation function is also widely applied, and the navigation function of the mobile terminal brings convenience for the travel of people to a great extent.
The drawing efficiency of elements on a navigation map in a navigation product is key data for reflecting whether the navigation product is fine or not and whether the performance is superior or not. The drawing efficiency directly determines the richness of the map to be drawn. But the richness of rendering and performance are inversely proportional, i.e., the more objects or elements that are rendered, the worse the performance. When navigation or map drawing is performed, for any model or rendered data, the model or rendered data is generally stored in a memory of a terminal, and then vertex arrays of the model or rendered data are respectively transmitted to a display card through the memory, so that the display card draws and renders the data respectively.
The prior art has the defects that: the data transmission from the memory to the display card is performance-consuming, if a large number of repeated objects with small vertex number exist, the repeated submission of a large number of data to the display card through the memory can cause a large amount of unnecessary performance consumption, so that the rendering burden is heavier, the frame rate of drawing is greatly reduced, and the user experience is poorer.
Disclosure of Invention
In view of this, embodiments of the present invention provide an image drawing method and apparatus, so as to solve technical problems of severe product performance consumption, low drawing efficiency, and poor user experience in an image drawing process in the prior art.
In a first aspect, an embodiment of the present invention provides an image drawing method, where the method includes:
acquiring drawing parameters of a first geometric model in a set drawing area;
traversing the drawing area, searching a repeated geometric model which is the same as the first geometric model, and combining the drawing parameters of the repeated geometric model with the drawing parameters of the first geometric model;
and sending the merged data to data rendering equipment so as to realize the drawing of the first geometric model and the repeated geometric model in the drawing area.
In a second aspect, an embodiment of the present invention further provides an image drawing apparatus, where the apparatus includes:
the drawing parameter acquisition module is used for acquiring drawing parameters of the first geometric model in a set drawing area;
a drawing parameter merging module, configured to traverse the drawing area, search for a repeating geometric model that is the same as the first geometric model, and merge the drawing parameters of the repeating geometric model with the drawing parameters of the first geometric model;
and the drawing module is used for sending the merged data to data rendering equipment so as to realize drawing of the first geometric model and the repeated geometric model in the drawing area.
According to the image drawing method and device provided by the embodiment of the invention, the drawing parameters of the first geometric model are obtained in the set drawing area, the drawing area is traversed, the repeated geometric model which is the same as the first geometric model is searched, the drawing parameters of the repeated geometric model and the drawing parameters of the first geometric model are combined, and the combined data are sent to the data rendering equipment, so that the first geometric model and the repeated geometric model in the drawing area are drawn. By adopting the method, the technical problems of serious product performance consumption, low drawing efficiency and poor user experience in the image drawing process in the prior art can be solved.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1 is a schematic flowchart of an image rendering method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an image rendering method according to a second embodiment of the present invention;
fig. 3 is a schematic flowchart of an image drawing method according to a third embodiment of the present invention;
fig. 4 is a block diagram of an image drawing apparatus according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a schematic flowchart of an image drawing method according to an embodiment of the present invention. The present embodiment is applicable to the case of drawing an image. The method may be performed by an image rendering apparatus, wherein the apparatus may be implemented by software and/or hardware, and may be generally integrated in a terminal device for displaying an image. As shown in fig. 1, the image drawing method provided in this embodiment may specifically include:
and S110, acquiring drawing parameters of the first geometric model in the set drawing area.
Generally, in order to realize display of a set image (for example, a navigation map or a game scene), a terminal device needs to first acquire a set display area of an image to be displayed as a drawing area, send parameter information of a geometric model in the drawing area to a certain rendering device for rendering, and finally complete a display process of the image.
For example, the set drawing area may be a drawing area set by a user in a self-defined manner, or may be a drawing area set by a system in a fixed manner; the first geometric model may be a geometric model existing in the set drawing area, such as a geometric model of a street lamp, a fence, a tree, and the like; the drawing parameters may be parameters that the first geometric model can characterize the first geometric model during the drawing process, and may be, for example, parameters of the shape, position, color, material, and the like of the first geometric model.
S120, traversing the drawing area, searching a repeated geometric model which is the same as the first geometric model, and combining the drawing parameters of the repeated geometric model and the drawing parameters of the first geometric model.
Illustratively, traversing the whole drawing area, searching all the repeating geometric models which are the same as the first geometric model, specifically, the repeating geometric models which are the same as the first geometric model in shape, or the repeating geometric models which are the same as the first geometric model in color, and combining the drawing parameters of the repeating geometric models with the drawing parameters of the first geometric model to form combined data.
S130, sending the merged data to data rendering equipment to achieve drawing of the first geometric model and the repeated geometric model in the drawing area.
Illustratively, the drawing parameters of the repetitive geometric model and the drawing parameters of the first geometric model are combined, and the obtained combined data are sent to the data rendering device together, where the data rendering device may be a device for rendering and drawing the combined data, and may be a display card device, so as to draw the first geometric model and all the repetitive geometric models in the drawing area.
In the image drawing method provided by the first embodiment of the present invention, the drawing parameters of the first geometric model are obtained in the set drawing area, the drawing area is traversed, the repeated geometric model that is the same as the first geometric model is found, the drawing parameters of the repeated geometric model and the drawing parameters of the first geometric model are combined, and the combined data is sent to the data rendering device, so that the first geometric model and the repeated geometric model in the drawing area are drawn. The image drawing method provided by the embodiment of the invention can be applied to drawing of navigation images, game images and other images with the same drawing model. By adopting the method, the drawing parameters of the first geometric model and the drawing parameters of the repeated geometric model are combined, and then the combined data are sent to the data rendering device, so that the times of sending the data to the data rendering device are reduced, the performance consumption of the rendering device in the data sending process is reduced, the rendering efficiency is improved, and the user experience is improved.
Example two
Based on the foregoing embodiments, the present embodiment provides an image drawing method, and in particular, provides a navigation image drawing method. Fig. 2 is a schematic flow chart of an image drawing method according to a second embodiment of the present invention. As shown in fig. 2, the image drawing method provided in this embodiment may specifically include:
s210, obtaining drawing parameters of the first geometric model in the set drawing area.
For example, the drawing parameters may include model display position information, which may be used to describe a specific display position of the geometric model. Further, the model display position information may include: an array of vertices of the geometric model and world coordinates of the geometric model within the drawing area. Optionally, the vertex array of the geometric model may be used to describe the vertex number and vertex position of the specific information of the geometric model; the world coordinates of the geometric model within the drawing area may be used to describe accurate position information of the geometric model on the world map for connecting the position of the virtual geometric model within the drawing area with the position of the real geometric model on the world map. Further, the same geometric model has the same vertex array, i.e., the vertex arrays used to describe the same geometric model are the same.
S220, taking the vertex array of the first geometric model as a reference vertex array, and storing the reference vertex array in a vertex merging array.
For example, since the same geometric model has the same vertex array, the vertex array of the first geometric model may be used as the reference vertex array, and the remaining same geometric models may be referenced to the vertex array of the first geometric model. Further, the reference vertex array is stored in a vertex merge array, and the vertex merge data may be used to store vertex arrays of all identical geometric models.
S230, calculating a translation matrix of the repeated geometric model relative to the first geometric model according to the relation between the world coordinates of the repeated geometric model and the world coordinates of the first geometric model found in the drawing area.
For example, the relationship between the world coordinates of any nth repeating geometric model and the world coordinates of the first geometric model may be determined according to the world coordinates of the repeating geometric models found in the drawing area, and then the translation matrix of any nth repeating geometric model relative to the first geometric model may be calculated.
The relation between the world coordinates of any Nth repeated geometric model and the world coordinates of any Mth repeated geometric model can be determined according to the world coordinates of the repeated geometric models found in the drawing area, and then the translation matrix of any Nth geometric model relative to any Mth geometric model is calculated, wherein N, M is a positive integer, and N is larger than M.
And S240, taking the product of the reference vertex array and the translation matrix as a translation vertex array of the repeated geometric model, and adding the product into the vertex merging array.
For example, the reference vertex array may be multiplied by a translation matrix of any nth repeating geometric model relative to the first geometric model, the product obtained by the multiplication is used as a translation vertex array of any nth repeating geometric model, and the translation vertex array of any nth repeating geometric model is added to the vertex merging array to obtain a new vertex merging array.
The new vertex merging array may also be obtained by multiplying the translation vertex array of any mth repeating geometric model by the translation matrix of any nth repeating geometric model with respect to the mth repeating geometric model, taking the product obtained by the multiplication as the translation vertex array of any nth repeating geometric model, and adding the translation vertex array of any nth repeating geometric model to the vertex merging array, where N, M is a positive integer and N is greater than M. It should be noted that, here, a translation vertex array of the mth repeating geometric model needs to be known.
And S250, multiplying the world coordinate matrix of the first geometric model by the vertex merging array generated after traversing the drawing area to generate the coordinate merging array.
Illustratively, traversing the drawing area to obtain translation vertex arrays of all the repeated geometric models, adding the translation vertex arrays of all the repeated geometric models to the vertex merging array to obtain a new vertex merging array, and then forming a world coordinate matrix of the first geometric model and the vertex merging array generated after traversing the drawing area to generate a coordinate merging array.
And S260, sending the merged data to data rendering equipment so as to realize drawing of the first geometric model and the repeated geometric model in the drawing area.
The image drawing method provided by the second embodiment of the present invention is to use the vertex array of the first geometric model as a reference vertex array, calculate the translation matrix of the repetitive geometric model relative to the first geometric model according to the relationship between the world coordinates of the repetitive geometric model and the world coordinates of the first geometric model, obtain the translation vertex array of the repetitive geometric model, add the vertex array of the first geometric model and the translation vertex array of the repetitive geometric model together in the vertex merging array, multiply the world coordinate matrix of the first geometric model and the vertex merging array, generate a coordinate merging array, and finally send merged data to the data rendering device, so as to draw all the same geometric models in the drawing area. By adopting the method, the vertex array of the first geometric model and the translation vertex array of the repeated geometric model are merged to obtain a final vertex merged array, and the vertex merged array is multiplied by the world coordinate matrix of the first geometric model before rendering, so that the geometric model obtained by rendering is ensured to correspond to the real geometric model, the drawing efficiency is improved, and the user experience is improved.
In a preferred implementation manner of this embodiment, the model display position information further includes: and model index information.
For example, in computer graphics, any geometric model is represented by a mesh composed of points and triangles, model index information can be used to represent the number of triangular meshes composed of different vertices in a vertex array of the geometric model, and the use of the model index information can help to quickly access the vertex array of the geometric model and reduce the performance consumption of the device. For example: drawing a square consisting of two triangles, wherein the coordinate of the upper left corner can be (l, t), the coordinate of the lower right corner can be (r, b), when the vertex mode is used for drawing, the two triangles are drawn, and data needs to be transmitted in the following mode: (l, t), (r, t), (l, b); (r, t), (r, b), (l, b). When the model index information is used for drawing, the index array can be defined as follows: float co [4] [2] { { l, t }, { r, t }, { r, b }, { l, b } }, when plotted, data is transmitted in the following manner: 0,1, 3; 1,2,3. Therefore, the model index information can reduce the repeated calling times of the vertexes and improve the drawing efficiency.
Correspondingly, merging the drawing parameters of the repeating geometric model with the drawing parameters of the first geometric model may further include:
storing the model index information of the first geometric model in an index merging array, and recording the number of indexes in the index merging array.
For example, the model index information of the first geometric model may be used to indicate the number of triangular meshes composed of different vertices in the reference vertex array of the first geometric model, and the different vertices in the reference vertex array of the first geometric model may be composed of several different triangular meshes.
And if the translation vertex array of the repeated geometric model is added into the vertex merging array, increasing the index value in the model index information of the repeated geometric model by an offset corresponding to the index number.
Illustratively, if the same repeated geometric model as the first geometric model exists in the drawing area, the translation vertex array of the repeated geometric model is added to the vertex merging array, further, the model index information of the repeated geometric model can be used for expressing the number of triangle meshes composed of different vertices in the translation vertex array of the repeated geometric model, and the index value in the model index information of the repeated geometric model is increased by an offset corresponding to the index number, and the value of the offset should be the same as the number of the index values contained in the current index merging array.
Adding the model index information of the repeated geometric model with the added offset into the index merging array, and updating the number of indexes in the index merging array.
Illustratively, indexing a model of a repeating geometric model into a search of informationAnd after the offset which is the same as the index value in the current index merged array is added to the index value, adding the model index information of the repeated geometric model into the index merged array, and updating the index number in the index merged array in real time. For example: the reference vertex array of the first geometric model may be represented as { x, y, z, x1, y1 }, the model index information may be represented as {0, 1, 2}, if there is a duplicate geometric model identical to the first geometric model, the translated vertex array of the duplicate geometric model is added to the vertex merge array, and the vertex merge array after the addition may be represented as { x, y, z, x1, y1 }, the model index information may be represented as {0, 1, 2}, and the vertex merge array may be represented as
Figure BDA0000955872090000091
The index merge array may be represented as
Figure BDA0000955872090000092
I.e. the offset is the same number as the index values of the first geometric model.
And traversing the drawing area to generate the index merging array.
Illustratively, the entire drawing area is traversed to ensure that the finally generated vertex merging array completely contains the reference vertex array of the first geometric model and the translation vertex arrays of all the repeated geometric models, and the index merging array completely contains the index model information of the first geometric model and the index merging information of all the repeated geometric models.
EXAMPLE III
The present embodiment provides an image drawing method based on the above embodiments. Fig. 3 is a schematic flow chart of an image drawing method according to a third embodiment of the present invention. As shown in fig. 3, the image drawing method provided in this embodiment may specifically include:
s310, obtaining drawing parameters of the first geometric model in the set drawing area.
For example, the drawing parameters may further include a normal coordinate parameter or a texture coordinate parameter, and specifically, the normal coordinate parameter may be used to describe the condition of the normal of different surfaces of the geometric model, so as to perform normal mapping better; the texture is actually a two-dimensional array, the colors of which are color values, and the texture coordinate parameters can be used to describe the color pattern of the geometric model and also to represent the surface texture condition of the geometric model, and the texture coordinate can be understood as a mapping of the texture image to the surface to be textured in the geometric model.
S320, storing the normal coordinate parameter or the texture coordinate parameter of the first geometric model in a parameter combination array.
Illustratively, the normal coordinate parameters or texture coordinate parameters of the first geometric model are stored in a parameter merge array for storing the normal coordinate parameters or texture coordinate parameters of all identical geometric models.
S330, adding the normal coordinate parameter or the texture coordinate parameter of the repeated geometric model found in the drawing area into the parameter merging array.
For example, within the drawing area, the found normal coordinate parameter or texture coordinate parameter of the same repetitive geometric model as the first geometric model is added to the above-described parameter merge array.
S340, traversing the drawing area to generate the parameter merging array.
Illustratively, the entire drawing area is traversed to ensure that the finally generated parameter merge array completely contains the normal coordinate parameter or texture coordinate parameter of the first geometric model and the normal coordinate parameter or texture coordinate parameter of all the repeated geometric models.
And S350, sending the merged data to data rendering equipment so as to realize the drawing of the first geometric model and the repeated geometric model in the drawing area.
Illustratively, a parameter merged array containing the normal coordinate parameter or texture coordinate parameter of the first geometric model and the normal coordinate parameter or texture coordinate parameter of the repeated geometric model is sent to the data rendering device, so as to realize the drawing of the first geometric model and the repeated geometric model in the drawing area.
In the image drawing method provided by the third embodiment of the present invention, the normal coordinate parameter or texture coordinate parameter of the first geometric model in the drawing area and the normal coordinate parameter or texture coordinate parameter of the repeated geometric model are merged and added together in the parameter merging array, and are submitted to the data rendering device for rendering, so that the number of times of submission to the data rendering device is reduced, the performance consumption of the rendering device is reduced, and the rendering efficiency is improved. The image drawing method provided by the embodiment of the invention can be applied to drawing of navigation images, game images and other images with the same drawing model.
Example four
Fig. 4 is a block diagram of an image drawing apparatus according to a fourth embodiment of the present invention, which may be implemented by software and/or hardware and may be generally integrated in a terminal device for displaying an image. This embodiment is applicable to the case of drawing an image, and as shown in fig. 4, the apparatus includes: a drawing parameter acquiring module 401, a drawing parameter merging module 402 and a drawing module 403.
The drawing parameter acquiring module 401 is configured to acquire drawing parameters of the first geometric model in a set drawing area; a drawing parameter merging module 402, configured to traverse the drawing area, search for a repeating geometric model that is the same as the first geometric model, and merge the drawing parameters of the repeating geometric model with the drawing parameters of the first geometric model; a drawing module 403, configured to send the merged data to a data rendering device, so as to implement drawing of the first geometric model and the repeated geometric model in the drawing area.
In the image drawing device provided by the fourth embodiment of the present invention, the drawing parameters of the first geometric model are obtained in the set drawing area, the drawing area is traversed, the repeated geometric model that is the same as the first geometric model is found, the drawing parameters of the repeated geometric model and the drawing parameters of the first geometric model are combined, and the combined data is sent to the data rendering device, so that the first geometric model and the repeated geometric model in the drawing area are drawn.
The image drawing device provided by the embodiment of the invention can be applied to drawing of navigation images, game images and other images with the same drawing model. By adopting the device, the data of the same geometric model are merged, and then the merged data are sent to the data rendering equipment, so that the times of sending the data to the data rendering equipment are reduced, the performance consumption in the data sending process is reduced, the rendering efficiency is improved, and the user experience is improved.
Further, the mapping parameters may include: model display location information;
wherein the model display position information may include: vertex arrays of the geometric model and world coordinates of the geometric model within the drawing area, the same geometric model having the same vertex arrays.
Further, the drawing parameter merging module 402 may include:
a vertex merging array storage unit, configured to use the vertex array of the first geometric model as a reference vertex array, and store the reference vertex array in a vertex merging array;
a translation matrix calculation unit, configured to calculate a translation matrix of the repetitive geometric model relative to the first geometric model according to a relationship between the world coordinates of the repetitive geometric model and the world coordinates of the first geometric model found in the drawing area;
a vertex merge array adding unit, configured to add a product of the reference vertex array and the translation matrix as a translation vertex array of the repeating geometric model to the vertex merge array;
and the coordinate merging array generating unit is used for multiplying the world coordinate matrix of the first geometric model by the vertex merging array generated after traversing the drawing area to generate the coordinate merging array.
Further, the model display position information may further include: model index information;
correspondingly, the drawing parameter merging module 402 may further include:
the index merging array storage unit is used for storing the model index information of the first geometric model in an index merging array and recording the number of indexes in the index merging array;
an offset increasing unit, configured to increase an index value in the model index information of the repeated geometric model by an offset corresponding to the index number if the translated vertex array of the repeated geometric model is added to the vertex merging array;
an index number updating unit, configured to add the model index information of the repeated geometric model with the offset added to the index merged array, and update the number of indexes included in the index merged array;
and the index merging array generating unit is used for traversing the drawing area and generating the index merging array.
Further, the mapping parameters may further include: a normal coordinate parameter or a texture coordinate parameter.
Further, the drawing parameter merging module 402 may include:
a parameter merging array storage unit, configured to store the normal coordinate parameter or the texture coordinate parameter of the first geometric model in a parameter merging array;
a parameter merging array adding unit configured to add the normal coordinate parameter or the texture coordinate parameter of the repetitive geometric model found in the drawing area to the parameter merging array;
and the parameter merging array generating unit is used for traversing the drawing area and generating the parameter merging array.
The image drawing device provided by the fourth embodiment of the invention belongs to the same inventive concept as the view image drawing method provided by any embodiment of the invention, can execute the image drawing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the image drawing method. For details of the technique not described in detail in this embodiment, reference may be made to the image drawing method provided in any embodiment of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An image rendering method, comprising:
acquiring drawing parameters of a first geometric model in a set drawing area;
traversing the drawing area, searching a repeated geometric model which is the same as the first geometric model, and combining the drawing parameters of the repeated geometric model with the drawing parameters of the first geometric model;
sending the merged data to data rendering equipment together so as to realize the drawing of the first geometric model and the repeated geometric model in the drawing area;
wherein said merging the drawing parameters of the repeating geometric model with the drawing parameters of the first geometric model comprises:
taking the vertex array of the first geometric model as a reference vertex array, and storing the reference vertex array in a vertex merging array;
calculating a translation matrix of the repetitive geometric model relative to the first geometric model according to the relation between the world coordinates of the repetitive geometric model and the world coordinates of the first geometric model found in the drawing area;
adding the product of the reference vertex array and the translation matrix as a translation vertex array of the repeating geometric model in the vertex merging array;
and multiplying the world coordinate matrix of the first geometric model by the vertex merging array generated after traversing the drawing area to generate a coordinate merging array.
2. The method of claim 1, wherein the mapping parameters comprise: model display location information;
wherein the model display location information comprises: vertex arrays of the geometric model and world coordinates of the geometric model within the drawing area, the same geometric model having the same vertex arrays.
3. The method of claim 2, wherein the model displaying location information further comprises: model index information;
correspondingly, the merging the drawing parameters of the repeated geometric model with the drawing parameters of the first geometric model further includes:
storing the model index information of the first geometric model in an index merging array, and recording the number of indexes included in the index merging array;
if the translation vertex array of the repeated geometric model is added into the vertex merging array, increasing an index value in the model index information of the repeated geometric model by an offset corresponding to the index number;
adding the model index information of the repeated geometric model with the added offset into the index merging array, and updating the number of indexes in the index merging array;
and traversing the drawing area to generate the index merging array.
4. The method of claim 1, wherein the mapping parameters further comprise: a normal coordinate parameter or a texture coordinate parameter.
5. The method of claim 4, wherein said merging the drawing parameters of the repeating geometric model with the drawing parameters of the first geometric model comprises:
storing the normal coordinate parameter or the texture coordinate parameter of the first geometric model in a parameter merging array;
adding the normal coordinate parameter or the texture coordinate parameter of the repeated geometric model found in the drawing area into the parameter merging array;
and traversing the drawing area to generate the parameter merging array.
6. An image drawing apparatus characterized by comprising:
the drawing parameter acquisition module is used for acquiring drawing parameters of the first geometric model in a set drawing area;
a drawing parameter merging module, configured to traverse the drawing area, search for a repeating geometric model that is the same as the first geometric model, and merge the drawing parameters of the repeating geometric model with the drawing parameters of the first geometric model;
the drawing module is used for sending the merged data to data rendering equipment together so as to draw the first geometric model and the repeated geometric model in the drawing area;
wherein, the drawing parameter merging module comprises:
the vertex merging array storage unit is used for taking the vertex array of the first geometric model as a reference vertex array and storing the reference vertex array in the vertex merging array;
a translation matrix calculation unit, configured to calculate a translation matrix of the repetitive geometric model relative to the first geometric model according to a relationship between the world coordinates of the repetitive geometric model and the world coordinates of the first geometric model found in the drawing area;
a vertex merge array adding unit, configured to add a product of the reference vertex array and the translation matrix as a translation vertex array of the repeating geometric model to the vertex merge array;
and the coordinate merging array generating unit is used for multiplying the world coordinate matrix of the first geometric model by the vertex merging array generated after traversing the drawing area to generate a coordinate merging array.
7. The apparatus of claim 6, wherein the mapping parameters comprise: model display location information;
wherein the model display location information comprises: vertex arrays of the geometric model and world coordinates of the geometric model within the drawing area, the same geometric model having the same vertex arrays.
8. The apparatus of claim 7, wherein the model display location information further comprises: model index information;
correspondingly, the drawing parameter merging module further includes:
the index merging array storage unit is used for storing the model index information of the first geometric model in an index merging array and recording the number of indexes in the index merging array;
an offset increasing unit, configured to increase an index value in the model index information of the repeated geometric model by an offset corresponding to the index number if the translated vertex array of the repeated geometric model is added to the vertex merging array;
an index number updating unit, configured to add the model index information of the repeated geometric model with the offset added to the index merged array, and update the number of indexes included in the index merged array;
and the index merging array generating unit is used for traversing the drawing area and generating the index merging array.
9. The apparatus of claim 6, wherein the mapping parameters further comprise: a normal coordinate parameter or a texture coordinate parameter.
10. The apparatus of claim 9, wherein the mapping parameter merging module comprises:
a parameter merging array storage unit, configured to store the normal coordinate parameter or the texture coordinate parameter of the first geometric model in a parameter merging array;
a parameter merging array adding unit configured to add the normal coordinate parameter or the texture coordinate parameter of the repetitive geometric model found in the drawing area to the parameter merging array;
and the parameter merging array generating unit is used for traversing the drawing area and generating the parameter merging array.
CN201610201407.XA 2016-03-31 2016-03-31 Image drawing method and device Active CN105894551B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610201407.XA CN105894551B (en) 2016-03-31 2016-03-31 Image drawing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610201407.XA CN105894551B (en) 2016-03-31 2016-03-31 Image drawing method and device

Publications (2)

Publication Number Publication Date
CN105894551A CN105894551A (en) 2016-08-24
CN105894551B true CN105894551B (en) 2020-02-14

Family

ID=57011933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610201407.XA Active CN105894551B (en) 2016-03-31 2016-03-31 Image drawing method and device

Country Status (1)

Country Link
CN (1) CN105894551B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108242070A (en) * 2017-10-09 2018-07-03 北京车和家信息技术有限公司 A kind of image drawing method, image plotting device and computer equipment
CN108122266B (en) * 2017-12-20 2021-07-27 成都卓杭网络科技股份有限公司 Method, device and storage medium for caching rendering textures of skeleton animation
CN109389683B (en) * 2018-08-31 2022-12-30 深圳市彬讯科技有限公司 flash background wall generation method and device
CN109978981B (en) * 2019-03-15 2023-04-25 广联达科技股份有限公司 Batch rendering method for improving display efficiency of building model
CN110047117B (en) * 2019-04-18 2023-03-17 武汉轻工大学 Method, device and equipment for drawing curved surface graph and storage medium
CN110047137B (en) * 2019-04-23 2023-02-21 武汉轻工大学 Paraboloid drawing method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306395A (en) * 2010-09-20 2012-01-04 董福田 Distributed drawing method and device of three-dimensional data
CN105157698A (en) * 2015-09-17 2015-12-16 百度在线网络技术(北京)有限公司 Method and device for drawing navigation image
CN105430470A (en) * 2014-09-15 2016-03-23 三星电子株式会社 Apparatus and method for processing data

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7528837B2 (en) * 2005-02-23 2009-05-05 Panasonic Corporation Drawing apparatus, drawing method, drawing program and drawing integrated circuit
WO2013107273A1 (en) * 2012-01-21 2013-07-25 Thomson Licensing Method and apparatus for compressing texture information of three-dimensional (3d) models
DE202014010911U1 (en) * 2013-05-15 2017-01-17 Google Inc. Efficient composition and presentation of graphic elements

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306395A (en) * 2010-09-20 2012-01-04 董福田 Distributed drawing method and device of three-dimensional data
CN105430470A (en) * 2014-09-15 2016-03-23 三星电子株式会社 Apparatus and method for processing data
CN105157698A (en) * 2015-09-17 2015-12-16 百度在线网络技术(北京)有限公司 Method and device for drawing navigation image

Also Published As

Publication number Publication date
CN105894551A (en) 2016-08-24

Similar Documents

Publication Publication Date Title
CN105894551B (en) Image drawing method and device
CN108898630A (en) A kind of three-dimensional rebuilding method, device, equipment and storage medium
CN102306395B (en) Distributed drawing method and device of three-dimensional data
CN105678683B (en) A kind of two-dimensional storage method of threedimensional model
CN104616345B (en) Octree forest compression based three-dimensional voxel access method
CN114820990B (en) Digital twin-based river basin flood control visualization method and system
CN110070616A (en) Memory, statistical data rendering method, device and equipment based on GIS platform
CN109685879A (en) Determination method, apparatus, equipment and the storage medium of multi-view images grain distribution
CN110428504B (en) Text image synthesis method, apparatus, computer device and storage medium
JPH10293862A (en) Three-dimensional object data processing method
CN113379814B (en) Three-dimensional space relation judging method and device
CN115619986A (en) Scene roaming method, device, equipment and medium
CN112669426B (en) Three-dimensional geographic information model rendering method and system based on generation countermeasure network
CN110827303B (en) Image editing method and device for virtual scene
CN110738719A (en) Web3D model rendering method based on visual range hierarchical optimization
CN110148086A (en) The depth polishing method, apparatus and three-dimensional rebuilding method of sparse depth figure, device
CN117830587B (en) Map annotation drawing method and device, computer equipment and storage medium
CN116402967B (en) Scene building rapid singulation method, device, computer equipment and storage medium
CN116883575B (en) Building group rendering method, device, computer equipment and storage medium
CN117557711A (en) Method, device, computer equipment and storage medium for determining visual field
US10504279B2 (en) Visibility function of a three-dimensional scene
US11954802B2 (en) Method and system for generating polygon meshes approximating surfaces using iteration for mesh vertex positions
CN111506680B (en) Terrain data generation and rendering method and device, medium, server and terminal
US20230394767A1 (en) Method and system for generating polygon meshes approximating surfaces using root-finding and iteration for mesh vertex positions
CN117456493A (en) Target detection method, device, computer 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
GR01 Patent grant
GR01 Patent grant