TEXTURE GENERATION SYSTEM
20170287201 · 2017-10-05
Inventors
- Tsubasa TOMITAKA (Fukuoka-shi, JP)
- Masashi UCHINOUMI (Fukuoka-shi, JP)
- Yuki FUKUSHIMA (Fukuoka-shi, JP)
Cpc classification
G06T17/20
PHYSICS
International classification
G06T17/20
PHYSICS
Abstract
A texture generation system includes a display terminal for displaying a three-dimensional map, a map database, a matrix, and a texture generating unit. The map database includes a three-dimensional model representing a three-dimensional shape of a feature with at least one polygon and a plurality of types of unit textures. Each pixel of the matrix stores a control value for controlling selection of the unit texture. The texture generating unit generates a texture for the polygon as an array of a plurality of unit textures with at least two types, by associating each position of the array with a pixel of the matrix, selecting one of the plurality of types of the unit textures for each position based on the control value at the pixel associated therewith, and arranging and pasting the selected unit texture onto each position, thereby providing the array of the unit textures on the polygon.
Claims
1. A texture generation system for generating a texture representing an appearance of a feature in a three-dimensional map, the system comprising: a display terminal which displays the three dimensional map including the feature having the texture; a map memory which stores a map database, the map database including: a three-dimensional model representing a three-dimensional shape of the feature with at least one polygon; and a plurality of types of unit textures to be selectively applied to the feature; a matrix memory which stores a matrix of a predetermined size, each pixel of the matrix storing a control value for controlling selection of the unit texture; and a texture generating unit which generates a texture for the polygon as an array of a plurality of the unit textures with at least two types, wherein the texture generating unit performs: associating each position of the array with a pixel of the matrix; selecting one of the plurality of types of the unit textures for each position based on the control value stored in the pixel of the matrix associated with the position; and arranging and pasting the selected unit texture onto each position so as to provide the array of the unit textures on the polygon.
2. The texture generation system according to claim 1, wherein the control values correspond to the types of the unit textures one-to-one.
3. The texture generation system according to claim 1, wherein the control values have a numeral value range wider than the number of types of the unit textures, and wherein the texture generating unit select the unit texture by comparing the control value with at least one threshold value, the numeral value range being divided into sub-ranges by the al least one threshold value such that each sub-range corresponds to one of the types of the unit textures.
4. The texture generation system according to claim 3, wherein the texture generating unit changes the at least one threshold value in accordance with a predetermined condition for displaying the three-dimensional map.
5. The texture generation system according to claim 1, wherein the texture generating unit changes the association between each position in the array of the unit texture and the pixel of the matrix, thereby changing the texture to paste.
6. The texture generation system according to claim 1, wherein the plurality of types of unit textures are stored in the map memory by being arranged into a single integral texture so as not to overlap with each other, and wherein the texture generating unit selects and pastes a portion of the integral texture corresponding to the selected unit texture.
7. The texture generation system according to claim 1, wherein the plurality of types of unit textures correspond to a plurality of different patterns of the texture, whereby the array of the unit textures has a variety of patterns to provide a realistic view of the feature.
8. A method for generating a texture representing an appearance of a feature in a three-dimensional map, executed by a computer, the method comprising: providing a map database storing a three-dimensional model representing a three-dimensional shape of the feature with at least one polygon, and a plurality of types of unit textures to be selectively applied to the feature; providing a matrix of a predetermined size, each pixel of the matrix storing a control value for controlling selection of the unit texture; and generating a texture for the polygon as an array of a plurality of the unit textures with at least two types by referring to the map database and the matrix, the generating the texture for the polygon comprising: associating each position of the array with a pixel of the matrix; selecting one of the plurality of types of the unit textures for each position based on the control value stored in the pixel of the matrix associated with the position; and arranging and pasting the selected unit texture onto each position so as to provide the array of the unit textures on the polygon; and applying the generated texture to the feature in the three-dimensional map.
9. A non-transitory computer readable medium storing a computer program for causing a computer to execute process steps for generating a texture representing an appearance of a feature in a three-dimensional map, wherein the process steps comprising: referring to a map database storing the three-dimensional model representing a three-dimensional shape of the feature with at least one polygon, and a plurality of types of unit textures to be selectively applied to the feature; referring to a matrix of a predetermined size, each pixel of the matrix storing a control value for controlling selection of the unit texture; and generating a texture for the polygon as an array of a plurality of the unit textures with at least two types, wherein the generating the texture for the polygon includes: associating each position of the array with a pixel of the matrix; selecting one of the plurality of types of the unit textures for each position based on the control value stored in the pixel of the matrix associated with the position; and arranging and pasting the selected unit texture onto each position so as to provide the array of the unit textures on the polygon; and applying the generated texture to the feature in the three-dimensional map.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION
Embodiment 1
[0044] An embodiment configured as a three-dimensional map display system for displaying a three-dimensional map on a display of a computer relating to the present invention will be described. A texture generation system of the present invention is carried out in a form incorporated in the three-dimensional map display system. The three-dimensional map display system can be also configured by using various devices such as mobile terminals including a smart phone, a mobile phone, and a tablet terminal and a navigation device other than the computer. Moreover, in this embodiment, the system operating on a standalone basis is exemplified, but it may be configured as a system which stores a map database 20 and the like illustrated in the figure in a server and connects the server and the navigation device via a network.
A. System Configuration:
[0045]
[0046] A function of each functional block in the figure will be described.
[0047] The map database 20 stores data required for displaying the three-dimensional map. In the example in the figure, a three-dimensional model 21 and texture data 22 are illustrated. Other than them, a character database storing characters to be displayed on the map may be included, for example. Moreover, network data for route search, that is, a database representing roads by links and nodes may be included. The three-dimensional model 21 stores polygon data and the like representing three-dimensional shapes of features such as buildings.
[0048] The texture data 22 stores image data representing appearances of the features as textures to be pasted on polygons. A daytime texture 23 is a texture utilized when the three-dimensional map for a daytime view is to be displayed. A night view texture 24 is a texture utilized when the three-dimensional map for a night view is to be displayed. Images representing shapes of windows are prepared as the daytime texture 23 for buildings such as a multi-floor building, and images representing lighted states, images representing unlighted states of the windows and the like are prepared as the night view textures 24. In the texture data 22, a texture to be pasted on the entire polygon and a unit texture to be arrayed and pasted on the polygon are prepared in a mixed manner. Structures of the texture data and the like will be described later.
[0049] A command input unit 11 inputs a command by a user through an operation unit such as a keyboard and a mouse or via a network. The command includes a display range, a viewpoint, a view line direction, a display mode and the like when the three-dimensional map is displayed. In this embodiment, since the three-dimensional map can be displayed as a daytime view or a night view, a command for switching them may be included.
[0050] A map display control unit 12 controls display of the three-dimensional map. Moreover, it also reads required data from the map database. A three-dimensional polygon generating unit 13 arranges the three-dimensional model 21 of each feature in a virtual three-dimensional space in order to display the three-dimensional map.
[0051] A texture generating unit 14 pastes a texture on a surface of the three-dimensional polygon. A daytime texture generating unit 15 pastes a texture representing a daytime view by using the daytime texture 23. A nighttime texture generating unit 16 pastes a texture representing a night view by using the nighttime texture 24. In this embodiment, when a night view is to be represented, the texture in a state where building windows are lighted at random is generated by arranging two types of unit textures representing the lighted/unlighted states of the windows while selecting them at random. For this processing, a matrix storing a control value used for selection of the unit texture is used. A matrix storage unit 17 stores this matrix.
[0052] In this Description, the “generation” of a texture includes both a mode in which a plurality of unit textures are arranged so as to generate a single texture and a mode of sequentially pasting a plurality of the unit textures on the polygon. In this embodiment, the texture generating unit 14 generates a texture of the polygon in the latter mode, that is, in the mode in which the unit textures are sequentially pasted on the polygon. In the functional blocks described above, in this embodiment, the map database 20, the texture generating unit 14, and the matrix storage unit 17 configures the texture generation system in the present invention.
[0053]
[0054] The polygon stores data to be illustrated.
[0055] The polygon ID is identification information of each polygon configuring the three-dimensional model, and in the example illustrated on the right side, POL1 is given to the polygon on a front surface of the building.
[0056] The shape is data specifying the shape of the polygon, and in this embodiment, a coordinate value of an apex is stored. In the example illustrated on the right side, three-dimensional coordinate values are stored for each of apexes PP1, PP2, PP3, and PP4 of the polygon. For the coordinate value, absolute coordinates based on an origin of the entire three-dimensional map may be used or relative coordinates using a reference point set for each feature as an origin may be used. In the latter case, the absolute coordinate values of the reference point are separately stored in the three-dimensional model 21.
[0057] A texture repetition number is information regulating an array of the textures to be pasted on the polygon. In the example of the figure on the right, the surface of the building is divided into sections of width 2×height 3, and the window textures are repeatedly pasted here. Therefore, the texture repetition number stores data of (2, 3). When one texture is arranged on the entire polygon without repetition, the texture repetition number is (1, 1).
[0058] For the daytime texture and the nighttime texture, identification information of the texture to be used in the polygon is stored, respectively. The three-dimensional model 21 may include attribute data representing an attribute of the feature. For example, data representing a name, a floor number and the like may be used as the attribute data for the building.
[0059] On a lower side of
[0060] In the example in
[0061] In the example in
[0062] For the nighttime texture, individual texture IDs such as “TEX2OFF” and “TEX2ON” may be given to the OFF image and the ON image. In such a case, information associating the both as nighttime textures may be prepared in the texture data 22, or the two texture IDs of “TEX2OFF” and “TEX2ON” may be stored as the nighttime textures of the three-dimensional model 21. For the nighttime texture, a plurality of types of images does not necessarily have to be prepared as the OFF image or the ON image for each of the three-dimensional model, but a single image may be prepared.
B. Three-Dimensional Map Display Processing:
[0063] Subsequently, processing contents when a three-dimensional map is displayed in the three-dimensional map display system 10 of the embodiment will be described.
[0064]
[0065] Subsequently, display of a background and the texture is made in accordance with the display mode of the map.
[0066] In the case of the daytime view mode (Step S14), the three-dimensional map display system 10 sets a background, sky, a distant view and the like for a daytime (Step S16). Then, the daytime texture is displayed for the feature (Step S18). The daytime texture designated by the three-dimensional model 21 is read from the texture data 22 and is pasted on each polygon.
[0067] In the case of the night view mode (Step S14), a background for a night view such as dark sky is set (Step S20), and night view texture generation processing is executed for the feature (Step S22). This processing is processing of reading the nighttime texture designated by the three-dimensional model 21 from the texture data 22 and of selecting the ON image and the OFF image at random and pasting them in accordance with a portion of the polygon. Contents of the processing will be described later.
[0068] The three-dimensional map display system 10 displays the three-dimensional map by executing the processing above for each feature.
C. Night View Texture Generation Processing:
[0069]
[0070] Subsequently, the three-dimensional map display system 10 selects the feature to be processed as a target model (Step S51). The target model only needs to be selected from those to which the texture generation processing has not been applied.
[0071] When the target model is not a building (Step S52), the three-dimensional map display system 10 determines that the ON image and the OFF image do not have to be used separately and pastes the nighttime texture designated by the three-dimensional model 21 (Step S53). The nighttime texture may be pasted on the entire polygon without repetition or may be pasted in repeated arrangement as illustrated in
[0072] If the target model is a building (Step S52), the three-dimensional map display system 10 sets the number of repetitions in accordance with the texture repetition number of the three-dimensional model 21 (Step S54). In the figure, a setting example in which repetition of 2 in width×3 in height is made is illustrated. In this embodiment, it is assumed that coordinate values according to the repetition number is given as two-dimensional coordinate system (U, V) for pasting the texture. As illustrated, UV coordinate values such as the lower left of the polygon set to the origin (0, 0), the lower right to (2, 0), the upper left to (0, 3), and the upper right to (2, 3) are given. The designated texture image is pasted so as to be contained in a rectangular region represented by apexes of (0, 0)-(1, 1) in the UV coordinate values, and if a value exceeding 1 is set as the UV coordinate value, pasting is performed repeatedly in accordance with the value. Therefore, when each coordinate value in the figure is set, the array of 2 in width×3 in height can be specified. The repetition number can be similarly specified by the UV coordinate values also in different arrays.
[0073] Subsequently, the three-dimensional map display system 10 sets a reference point determining a use region of the matrix (Step S55). The reference point may be a fixed point arbitrarily set such as lower left of the matrix or may be selected in compliance with a certain rule or by a random number every time this processing is executed. In this embodiment, a random number is generated, and an x-coordinate and a y-coordinate of the reference point are set.
[0074] After the reference point is set, the three-dimensional map display system 10 selects and pastes the unit texture in accordance with the control value of the matrix (Step S56). In this embodiment, since binary values of 0 and 1 are stored in each pixel of the matrix, the ON image is selected in the case of the value 1 and the OFF image is selected in the case of the value 0. Selection of the unit texture using the matrix at Steps S55 and S56 will be described later in more detail on the basis of a specific example.
[0075] The three-dimensional map display system 10 pastes the nighttime texture on the target model by the processing described above. This processing is repeatedly executed for all the target models until completion (Step S57).
[0076] In this embodiment, the processing is sorted on the basis of whether the target model is a building or not (see Step S52). This is because the two types of the unit textures, that is, the ON image and the OFF image are used separately only for the building. When a plurality of types of the unit textures is selected and used also for the features other than the building, the processing similar to that of the building (Steps S54 to S56) only needs to be executed for such features.
[0077]
[0078] In the figure, the reference point set at Step S55 of the night view texture generation processing (
[0079] A middle stage of the figure is an enlarged view of a part of the matrix. A rectangular region is illustrate with the reference point (Mx, My) on the lower left side. Each cell in the figure indicates a pixel of the matrix and stores the control value of 0 or 1.
[0080] At Step S56 in the night view texture generation processing (
[0081] On a lower stage of the figure, a selection result of the ON image and the OFF image is illustrated. Since a lower left pixel in the region A stores 0 as the control value, the OFF image is selected (see Step S56 in
[0082] Since distribution of the control values in the matrix is different depending on the region, if the reference point is different, the region used for selection of the unit texture changes, and the obtained result also becomes different. Moreover, even if the fixed reference point is used at all times, when the repetition number is different, the size of the region applied for the selection changes, and an impression of the obtained result also becomes different.
[0083] The processing described in
[0084] In the example in
D. Map Display Example:
[0085]
[0086]
E. Effects and Variations:
[0087] According to the embodiments described above, by using the matrix, the night view display without a sense of discomfort can be realized by using the ON image and the OFF image separately while suppressing the processing load.
[0088] In the embodiments, the two windows are used as the unit textures, but the shape or the like of the unit texture can be set arbitrarily. One window may be made a unit texture or much more windows may be made a unit texture. However, if a group in which many windows are two-dimensionally arranged as in the pattern A or the pattern B illustrated in
[0089] This embodiment is a technique for selecting and arranging a plurality of unit textures for the three-dimensional model and is not a technique limited to representation of a night view of buildings. By applying this embodiment to various features, diversified features can be displayed while the processing load is suppressed, whereby reality of the three-dimensional map can be further improved. For example, by selecting and applying a plurality of unit textures with different states of branches and leaves to trees, diversified trees can be represented. By selecting and applying unit textures in diversified colors such as white and gray to clouds, clouds with various shapes and colors can be represented. In the embodiment, the example in which the unit textures are arranged without overlapping with each other is illustrated, but the unit textures may be overlapped with each other and pasted depending on the feature to which the present technique is applied.
[0090] Regarding this embodiment, further various variations can be considered for the processing. They will be described below.
(1) Variation (1) of Selecting Method of Unit Texture:
[0091]
[0092] In the matrix, three values of 0, 1, and 2 are stored as illustrated in an upper stage. As a result, the three types of the unit textures can be used separately and arranged in accordance with each pixel of the matrix similarly to the embodiment. That is, it is only necessary that the 0 image is arranged for a pixel storing a control value of 0, the 1 image for the pixel storing the control value of 1, and the 2 image for the pixel storing the control value of 2. As a result, as illustrated on lower left, more diversified lighted states than that in the embodiment can be represented.
[0093] A case in which four or more of the unit textures are prepared can be also processed similarly to the variation (1).
(2) Variation (2) of Selecting Method of Unit Texture:
[0094]
[0095] In the variation (2), selection of the ON image and the OFF image is made on the basis of a magnitude relationship between the control value stored in each pixel and a threshold value TH. That is, in a case of the control value≦TH, the OFF image is used, while in a case of the control value>TH, the ON image is used. A result of the case of the threshold value TH=50 and the case of 150 are illustrated on a lower stage.
[0096] In the case of the threshold value TH=50, the control value of a pixel P00 on lower left is 0, and the control value≦TH and thus, the OFF image is selected. The control value of a pixel P10 on lower right is 96, and the control value>TH and thus, the ON image is selected. Similarly, the OFF image is selected for a pixel P01, and the ON image is selected for pixels P11, P02, and P12. As a result, in the case of the threshold value TH=50, a texture with many windows in the lighted state is obtained as illustrated on lower left.
[0097] Subsequently, in the case of the threshold value TH=150, when the unit texture is selected similarly, the OFF image is selected for the pixels P00, P10, P01, and P12, and the ON image is selected for the pixels P11 and P02. As a result, in the case of the threshold value TH=100, a texture with many windows in the unlighted state is obtained as illustrated on lower right.
[0098] As described above, according to the variation (2), by changing the threshold value TH, an obtained texture can be changed even in the same building. The threshold value TH may be designated by a user or may be changed in accordance with a condition such as time when the three-dimensional map is displayed. By using the threshold value TH=50 for time of a day such as late evening and the threshold value TH=150 for midnight, for example, a night view according to period of time can be represented.
[0099] In the variation (2), too, three or more types of the unit textures can be used. When three types of the unit textures (0 image, 1 image, and 2 image) are used as in the variation (1) (
(3) Variation of Arranging Method of Unit Texture:
[0100]
[0101] A method of utilizing the texture for displaying a daytime view is illustrated on an upper side of the figure. A UV coordinate system is defined for the texture of a building. Since a daytime image is pasted on the building, coordinate conversion is executed so that a point tp3 of the daytime image is made to correspond to a lower left point P3 which is a unit of arrangement and a point tp6 of the daytime image is made to correspond to an upper right point P6. If the point P3 is (0, 0) in the UV coordinate system and the point P6 is (1, 1), it is only necessary to apply parallel movement and enlargement/reduction to the coordinate system of (tu, tv) so that the coordinate of the point tp3 is (0, 0) and the coordinate of the point tp6 is (1, 1).
[0102] A method of utilizing the texture for displaying a night view is illustrated on a lower side of the figure. Since the OFF image and the ON image are selected and pasted on the building, the coordinate conversion is executed so that apexes of the OFF image and the ON image correspond for each of regions which become units of the arrangement. A case in which the OFF image is pasted on the left side on the uppermost stage of the polygon and the ON image on the right side as illustrated is considered. The coordinate conversion only needs to be executed for the left side so that points tp1 and tp4 of the OFF image correspond to the points P1 and P4, respectively. At this time, the coordinate conversion needs to be made so that the points P1 and P4 of the polygon to be pasted also become (0, 0) and (1, 1) in the UV coordinate system, respectively. That is because the texture corresponding to the range of (0, 0), (1, 1) is repeatedly applied when the UV coordinate exceeds 1. Similarly, for the right side, it is only necessary to execute coordinate conversion so that points P2 and P5 are subjected to coordinate conversion so as to become (0, 0), (1, 1) in the UV coordinate system and then, the points tp2 and tp5 on the ON image correspond to these two points.
[0103] By shifting portions to be used in the integral texture in accordance with the selection result of the unit texture to be pasted as above, the image similar to that in the embodiment can be obtained. When the unit texture is stored as an individual image, the unit texture needs to be read each time in accordance with the selection result, while according to the method of the variation, once the integral texture is read, there is no need to read a new texture during the processing of generating a texture, and quickening of the processing can be further promoted.
[0104] In this variation, too, three or more unit textures can be used for nighttime.
[0105] The various variations of this embodiment have been illustrated. The present invention is not limited to the embodiment and the variations described herein, but is capable of configuring further various variations.
[0106] The present invention can be utilized for generating a texture representing an appearance of a feature.