Triangle generation device, triangle generation method, and triangle generation program
The triangle generation device and method address the issue of triangles deviating from an equilateral shape by consistently dividing triangles based on predetermined lengths, enhancing accuracy and reducing calculation time in computer graphics.
Patent Information
- Application Number
- JP2022102150
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2025-06-18
- Estimated Expiration
- 2042-06-24
AI Technical Summary
Existing techniques for tessellation, such as those described in Patent Document 1, often result in new triangles that deviate from an equilateral shape, especially when dividing long and narrow triangles, leading to decreased analysis accuracy and increased calculation time in computer graphics.
A triangle generation device and method that acquire vertex coordinate groups for basic triangles and divide them into subdivided triangles by setting main and sub-division numbers based on a predetermined division length, ensuring that the intervals between main and sub-division points are consistent, thereby maintaining a shape close to an equilateral triangle.
This approach effectively suppresses the deviation of new subdivided triangles from an equilateral shape, improving analysis accuracy and reducing calculation time in image calculation for computer graphics.
Smart Images

Figure 0007694476000016 
Figure 0007694476000017 
Figure 0007694476000018
Abstract
Description
Technical Field
[0001] The present disclosure relates to a technique for dividing a triangle to generate a plurality of new triangles.
Background Art
[0002] For example, Patent Document 1 below discloses a technique related to tessellation for bisecting a triangle so that it becomes a predetermined size or less.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] Tessellation is one of the image calculation methods in computer graphics. Tessellation is a technique for further dividing a large number of polygons (for example, triangular polygons) used to represent a three-dimensional solid on a two-dimensional image, and is a technique for more detailed and smooth representation of a three-dimensional solid based on the divided triangles.
[0005] In the method described in Patent Document 1, a dividing line is drawn from a certain vertex of a triangle toward the opposite side, and this process of bisecting the triangle with this dividing line is repeatedly executed. In this method, for example, when the triangle before division is a relatively long and narrow triangle, the triangle after division may also be a relatively long and narrow triangle. That is, the triangle after division may deviate from an equilateral triangle.
[0006] However, in image calculation in computer graphics, it is known that the further a triangle deviates from an equilateral triangle (that is, the lower the aspect ratio of the triangle), the more likely it is to lead to a decrease in analysis accuracy and an increase in calculation time.
[0007] One aspect of the present disclosure aims to suppress the new triangles generated by dividing a triangle from moving away from an equilateral triangle.
Means for Solving the Problem
[0008] One aspect of the present disclosure is a triangle generation device (20). The triangle generation device (20) includes an acquisition unit (S1) and a triangle division unit (S2, S12). The acquisition unit is configured to acquire a vertex coordinate group including the coordinates of each vertex for one or more basic triangles. The triangle division unit is configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles. Further, the triangle division unit has a main division number setting unit (S21, S240), a sub-division number setting unit (S22, S350), and an execution unit (S23).
[0009] The main division number setting unit is configured to set the main division number (M) when equally dividing a plurality based on a predetermined division length for the first side. The sub-division number setting unit is configured to set the sub-division number (N) when equally dividing a plurality of minor lines set for each of the plurality of main division points on the first side based on the division length. The execution unit is configured to acquire combination information for each of the main division points and calculate the coordinates of the vertices of the subdivided triangles for each pair of minor lines set for each of the main division points using the vertex coordinate group, the main division number, and the combination information.
[0010] A sub-divided triangle refers to, for each pair of minor lines, one or more triangles that divide the area of the basic triangle sandwiched between the pair of minor lines without overlapping each other, with the sub-division points on the two minor lines belonging to the pair of minor lines as vertices. The combination information refers to information specifying how the sub-division points belonging to each sub-divided triangle are combined. The main division points are a plurality (M + 1) of points including both endpoints of the first side and located at positions that equally divide the first side by the main division number. The minor line is a line segment that passes through the main division points, extends from the first side to the second side, and follows the third side. The sub-division points are a plurality (N + 1) of points including both endpoints of the minor line and equally dividing the minor line by the sub-division number. A pair of minor lines is a combination of any two adjacent minor lines in the minor line.
[0011] The triangle generation device of the present disclosure configured as described above can make the intervals between the main division points and the sub-division points substantially the same by performing division based on the division length. That is, among the three sides of the sub-divided triangle, the side along the first side where the main division points are set and the side along the minor line where the sub-division points are set can be made to have substantially the same length. For this reason, the basic triangle can be divided into sub-divided triangles having a shape with a relatively high degree of coincidence with an equilateral triangle. As a result, it is possible to suppress the new sub-divided triangles generated by dividing the basic triangle from moving away from the equilateral triangle.
[0012] Another aspect of the present disclosure is a triangle generation method configured to obtain a vertex coordinate group including the coordinates of each vertex for one or more basic triangles and divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of sub-divided triangles.
[0013] The triangle generation method of the present disclosure configured as described above is a method executed by the triangle generation device of the present disclosure and can obtain the same effects as the triangle generation method of the present disclosure. Still another aspect of the present disclosure is a triangle generation program executed by a triangle generation device, which includes an acquisition step and a triangle division step. The triangle generation program of the present disclosure is a program executed by the triangle generation device of the present disclosure, and by executing this program, the same effects as those of the triangle generation device of the present disclosure can be obtained.
Brief Description of the Drawings
[0014]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
Figure 17
Figure 18
Figure 19
Figure 20
Figure 21
Figure 22
Figure 23
Figure 24
Figure 25
Figure 26
Figure 27
Figure 28
Figure 29
Figure 30
Figure 31
Embodiments for Carrying Out the Invention
[0015] [First Embodiment] The first embodiment of the present disclosure will be described below with reference to the drawings. [1-1. Configuration] As shown in FIG. 1, the radar simulator 1 of this embodiment includes a display unit 11, an operation input unit 12, a data storage unit 13, a data input / output unit 14, and a control unit 15.
[0016] The display unit 11 includes a display device (not shown) and displays various images on the display screen of the display device. The operation input unit 12 outputs input operation information for specifying an input operation performed by a user via a keyboard and a mouse (not shown).
[0017] The data storage unit 13 is a storage device for storing various data. The data input / output unit 14 performs data input / output with an external device connected by wire or wirelessly.
[0018] The control unit 15 is mainly composed of a microcomputer including an electronic arithmetic unit (hereinafter referred to as the arithmetic unit 20), a ROM 23, a RAM 24, and the like. The arithmetic unit 20 includes at least one of a CPU 21 and a GPU 22. Various functions of the microcomputer are realized by the arithmetic unit 20 executing a program stored in a non-transitory tangible recording medium. In this example, the ROM 23 corresponds to the non-transitory tangible recording medium storing the program. Further, by executing this program, a method corresponding to the program is executed. Note that part or all of the functions executed by the arithmetic unit 20 may be configured hardware-wise by one or a plurality of ICs or the like. Also, the number of microcomputers constituting the control unit 15 may be one or plural.
[0019] For example, the ROM 23 stores a simulation program 25, a drawing program 26, and a triangle generation program 27. The simulation program 25, the drawing program 26, and the triangle generation program 27 may be pre-installed in the radar simulator 1, or may be installed via a recording medium or a network. Examples of the recording medium include an optical disk, a magnetic disk, and a semiconductor memory.
[0020] The simulation program 25 is a program for reproducing the three-dimensional shape of a road and the three-dimensional shape around the road in a virtual space, and executing a simulation in which a vehicle travels on the road reproduced in this virtual space. For example, the simulation may include a simulation of transmitting and receiving radar waves by a radar device mounted on a vehicle in a virtual space where a vehicle travels and is displayed on a display device. By starting the simulation program 25, a radar simulation that simulates the travel of a vehicle and the transmission and reception of radar waves by a radar device may be executed. By starting the simulation program 25, data (hereinafter referred to as polygon data) representing the road and the three-dimensional shape around the road to be reproduced in the above virtual space by a large number of polygons may be acquired. Further, calculations for simulating the transmission and reception of radar waves may be performed based on the polygon data indicating the three-dimensional shape. Note that the simulation may include various other simulations.
[0021] For example, the drawing program 26 is a program for generating an image showing the road and the three-dimensional shape around the road reproduced in the virtual space used in the above radar simulation. The drawing program 26 may be started triggered by the start of the simulation program 25, or may be started alone. By starting the drawing program 26, polygon data of the road and the three-dimensional shape around the road to be reproduced in the above virtual space may be acquired, and an image showing the three-dimensional shape may be generated.
[0022] A large number of polygon data representing a three-dimensional shape or the like may be stored in advance in the data storage unit 13, or may be acquired from outside the radar simulator 1 via the data input / output unit 14. The polygon data includes polygon vertex coordinate data indicating the coordinates of each vertex (hereinafter referred to as vertex coordinates) of a large number of polygons (for example, triangular polygons).
[0023] For example, the triangle generation program 27 is a program for dividing each triangular polygon (hereinafter also referred to as a basic triangle) defined by the vertex coordinates included in the polygon vertex coordinate data into a plurality of triangles smaller than the basic triangle. The process performed by executing the triangle generation program 27 by the arithmetic unit 20 is also referred to as triangle generation processing.
[0024] New vertex coordinate data including the vertex coordinates of triangles smaller than the basic triangle is output by the triangle generation processing, and an image showing the three-dimensional shape is generated based on this vertex coordinate data. As a result, a more detailed and smooth image is generated in the drawing or the like on the display device by the display unit 11.
[0025] [1-2. Processing] The procedure of the triangle generation processing executed by the arithmetic unit 20 will be described using the flowchart of FIG. 2. The triangle generation processing is started, for example, triggered by the execution of the simulation program 25 or the execution of the drawing program 26. However, the trigger for executing the triangle generation processing is not limited to the execution of the simulation program 25 and the drawing program 26, and may be executed by any trigger.
[0026] When the triangle generation processing is executed, in S1, the arithmetic unit 20 acquires the polygon vertex coordinate data. For example, the polygon vertex coordinate data includes the vertex coordinates of a plurality of basic triangles.
[0027] Next, in S2, the arithmetic unit 20 performs triangle division. Triangle division divides a basic triangle to generate a plurality of triangles smaller than the basic triangle (hereinafter also referred to as subdivided triangles). Note that generating a triangle as described below includes performing a calculation to calculate the vertex coordinates of the triangle and outputting (i.e., storing) the calculated vertex coordinates in a memory such as the RAM 24.
[0028] In S3, the arithmetic unit 20 outputs new vertex coordinate data including the vertex coordinates of triangles smaller than the basic triangle (i.e., subdivided triangles). For example, the arithmetic unit 20 may output the above-described vertex coordinate data to an arbitrary memory or the like that can be used in the simulation program 25, the drawing program 26, or other applications. The arithmetic unit 20 thus ends the triangle generation process.
[0029] Subsequently, the details of the triangle division (i.e., the triangle generation process) executed by the arithmetic unit 20 in S2 will be described based on the flowchart shown in FIG. 3. In S11, the arithmetic unit 20 performs pre-shaping (i.e., Pre-tessellation Reshaping). Pre-shaping is a process for shaping a triangle having a shape with a relatively small degree of coincidence with an equilateral triangle among basic triangles into a plurality of triangles having a shape with a relatively large degree of coincidence with an equilateral triangle based on polygon vertex coordinate data.
[0030] In the subsequent S12, the arithmetic unit 20 performs cascade division (i.e., Cascade Tessellation). Cascade division is a process for generating subdivided triangles for each basic triangle. In the present embodiment, before cascade division (i.e., before generating subdivided triangles), the above-described pre-shaping process is executed as a pre-process. That is, in the present embodiment, cascade division is performed on basic triangles having a shape relatively close to an equilateral triangle. Also, in the present embodiment, the subdivided triangles are a plurality of triangles smaller than the basic triangle obtained by dividing a basic triangle having a shape relatively close to an equilateral triangle. The arithmetic unit 20 thus ends the triangle division.
[0031] [1-2-1. Pre-shaping] The details of the pre-shaping executed by the arithmetic unit 20 in S11 will be described based on the flowchart shown in FIG. 4.
[0032] <Process> First, in S105, the arithmetic unit 20 acquires polygon vertex coordinate data. The vertex coordinates are three for each basic triangle. Here, it is assumed that the polygon vertex coordinate data includes the vertex coordinates of L basic triangles. For example, each element included in the polygon vertex coordinate data is (v0, v1, v2, v3, v4, v5, ···, v 3k , v 3k+1 , v 3k+2 , ···) as shown. k is an integer from 0 to L-1. v is the vertex coordinate. The vertex coordinate v may be represented by coordinates, for example, (x, y), or may be represented by a position vector.
[0033] Hereinafter, the polygon vertex coordinate data will be described as an array vertices[]. The elements of the array vertices[] are represented by floating-point numbers. Note that for the elements of the array, [] may be omitted and described simply as vertices, for example, for the elements of the array vertices[]. The index (hereinafter, idx) is a variable for specifying the elements of the array, and here, the range is 0 ≦ idx ≦ L-1. That is, the array elements vertices[3idx], vertices[3idx+1], vertices[3idx+2] indicate the vertex coordinates of one basic triangle specified by idx. 3idx, or 3*idx, represents the multiplication of 3 and idx. For example, the basic triangle specified by idx = 0 is a basic triangle having as its vertices the vertex coordinates stored in the array elements vertices[0], vertices[1], vertices[2] (that is, specifically, (v0, v1, v2) described above).
[0034] In S110 - S130, the arithmetic unit 20 identifies triangles that are not target triangles among the basic triangles specified by the value stored in idx. The target triangle refers to a triangle having a shape relatively close to an equilateral triangle. A shape relatively close to an equilateral triangle means a shape with a relatively large degree of coincidence with an equilateral triangle. The degree of coincidence with an equilateral triangle is represented by, for example, the aspect ratio. The aspect ratio ranges from 0 ≤ aspect ratio ≤ 1, and the aspect ratio of an equilateral triangle is 1. The degree of coincidence with an equilateral triangle is larger as the aspect ratio is relatively large (i.e., relatively close to 1). It can also be said that the target triangle is a triangle with a relatively large aspect ratio (i.e., relatively close to 1). Hereinafter, a triangle that is not a target triangle is also referred to as a non - target triangle.
[0035] First, in S110, the arithmetic unit 20 stores 0 in idx. Next, in S115, for the basic triangle specified by the value stored in idx, the arithmetic unit 20 changes the storage order of the vertex coordinates in the array vertices[] so that the lengths of the opposite sides are in descending order. That is, the vertex coordinates stored in the elements vertices[3idx], vertices[3idx + 1], and vertices[3idx + 2] of the array are rearranged so that the lengths of the opposite sides are in descending order. The opposite side refers to the side facing the vertex. Descending order means arranging in order from the longest to the shortest.
[0036] For example, FIG. 5 shows a certain basic triangle specified by idx = k. Each element of the array before rearrangement is shown in FIG. 6. That is, the vertex coordinates stored in the element vertices[3k] of the array are V 3k , the vertex coordinates stored in the element vertices[3k + 1] of the array are V 3k+1 , and the vertex coordinates stored in the element vertices[3k + 2] of the array are V 3k+2 It is assumed that this is the case.
[0037] First, the arithmetic unit 20 determines the length of the opposite side a of the vertex indicated by the vertex coordinate v 3k , the length of the opposite side b of the vertex indicated by the vertex coordinate v 3k+1 , and the length of the opposite side of the vertex indicated by the vertex coordinate v 3k+2Calculate the length of the opposite side c of the vertex shown by, based on each vertex coordinate. Then, the arithmetic unit 20 specifies the order of the opposite sides a, b, and c in descending order of length (i.e., in the order of decreasing length). In the example of FIG. 5, the lengths of the opposite sides are c > b > a. The arithmetic unit 20 rearranges the order of each vertex so that the vertices corresponding to the specified order of the lengths of the opposite sides (i.e., c > b > a) are arranged in order.
[0038] As a result, after the rearrangement, as shown in FIG. 7, v is stored as the element vertices[3k] of the array 3k+1 is stored, and v is stored as the element vertices[3k + 1] of the array 3k+2 is stored, and v is stored as the element vertices[3k + 2] of the array 3k is stored. That is, the vertex coordinates are rearranged so that the lengths of the opposite sides are in descending order.
[0039] Next, in S120, the arithmetic unit 20 determines whether the basic triangle specified by the value stored in idx is the target triangle described above. Here, in the present embodiment, the arithmetic unit 20 determines that it is the target triangle when the maximum value of the interior angles is less than a predetermined allowable angle. On the other hand, the arithmetic unit 20 determines that it is a non-target triangle when the maximum value of the interior angles is greater than or equal to the allowable angle. In the present embodiment, the allowable angle is 120°. Note that the allowable angle is not limited to 120°, and may be any angle within a predetermined range including 120°.
[0040] As described above, the vertex coordinates of the basic triangle specified by the value stored in idx are rearranged in the array vertices[] so that the lengths of the opposite sides are in descending order. That is, among the elements vertices[3idx], vertices[3idx + 1], and vertices[3idx + 2] of the array, the vertex coordinate stored as the element vertices[3idx] of the leading array indicates the vertex with the largest interior angle.
[0041] The arithmetic unit 20 uses the cosine law c 2 = a 2 + b 2-2abcosθ is used to calculate θ as the angle indicating the maximum value of the interior angle. Here, c is the length of the side opposite the vertex with the largest interior angle, and a and b are the lengths of the remaining sides. The side opposite the vertex with the largest interior angle is the side opposite the vertex indicated by the vertex coordinates stored in the element vertices[3idx] of the array, which is the first among the three vertex coordinates. The remaining sides are the sides opposite the vertices indicated by the vertex coordinates stored in the elements vertices[3idx + 1] and vertices[3idx + 2] of the array.
[0042] The array flag[idx] represents the flag value for the basic triangle specified by the value stored in idx. Here, when the arithmetic unit 20 determines that the basic triangle is an asymmetric triangle, that is, when it determines that the maximum value θ of the interior angle is greater than or equal to the allowable angle, it stores 1 in the array flag[idx]. On the other hand, when the arithmetic unit 20 determines that the basic triangle is a symmetric triangle, that is, when it determines that the maximum value of the interior angle is less than the allowable angle, it stores 0 in the array flag[idx].
[0043] In S125, the arithmetic unit 20 increments idx. That is, the arithmetic unit 20 stores in idx the value obtained by adding 1 to the value stored in idx. In S130, the arithmetic unit 20 determines whether the value stored in idx is greater than or equal to L. Here, when the arithmetic unit 20 determines that it is greater than or equal to L, it transfers the process to S135. On the other hand, when the arithmetic unit 20 determines that it is less than L, it transfers to S115 and repeats the processes of S115 - S130 until idx becomes greater than or equal to L.
[0044] In S135, the arithmetic unit 20 stores the cumulative sum of the elements flag[] of the array in the array scan[idx] specified by the value stored in idx. The cumulative sum of the elements flag[] of the array here refers to the sum of the values of each of the elements flag[0] to flag[idx] of the array.
[0045] For example, the value stored as the element flag[0] of the array is stored as the element scan[0] of the array, and the sum of the value stored as the element flag[0] of the array and the value stored as the element flag[1] of the array (i.e., the cumulative sum) is stored as the element scan[1] of the array. Thereby, the total number of non-target triangles among the L basic triangles is stored as the element scan[L - 1] of the array when the value stored in idx is L - 1.
[0046] In S140 - S165, the arithmetic unit 20 divides a basic triangle determined to be a non-target triangle in S120 into a plurality (for example, two in this embodiment) of triangles so that the degree of coincidence with an equilateral triangle is a relatively large shape.
[0047] First, in S140, the arithmetic unit 20 stores 0 in idx. In S145, the arithmetic unit 20 determines whether the basic triangle specified by the value stored in idx is a target triangle or a non-target triangle. Here, when the value stored as the element flag[idx] of the array is 1, the arithmetic unit 20 determines that it is a non-target triangle and transfers the process to S150. On the other hand, when the value stored as the element flag[idx] of the array is 0, the arithmetic unit 20 determines that it is a target triangle and transfers the process to S160.
[0048] In S150, the arithmetic unit 20 divides the basic triangle specified by the value stored in idx into two by the angle bisector of the interior angle indicating the maximum value so that the triangles after division have a relatively large degree of coincidence with an equilateral triangle.
[0049] As described above, in the basic triangle specified by the value stored in idx, the vertex indicated by the vertex coordinates stored in the element vertices[3idx] of the array indicates the vertex with the largest interior angle. For example, as shown in FIG. 8, the vertex with the largest interior angle (for example, vertex coordinates v 3k+1) If the dividing line DL drawn from the vertex to the opposite side (for example, side c) is the angle bisector of this interior angle, let the intersection point of the dividing line DL and the opposite side c be point M. The opposite side c is divided by point M in the ratio m:n = a:b. The arithmetic unit 20 calculates the coordinates of point M based on equation (1).
[0050]
Number
[0051] Here, for the divided triangle, the arithmetic unit 20 stores the vertex coordinates stored in the array element vertices[3idx] (that is, v 3k+1 ), the vertex coordinates stored in the array element vertices[3idx + 1] (that is, v 3k+2 ), and the coordinates of point M as the array elements vertices[3idx], vertices[3idx + 1], and vertices[3idx + 2] respectively.
[0052] On the other hand, for the divided triangle, the arithmetic unit 20 stores the vertex coordinates stored in the array element vertices[idx] (that is, v 3k+1 ), the vertex coordinates stored in the array element vertices[idx + 2] (that is, v 3k ), and the coordinates of point M as the vertex coordinates of the new basic triangle and adds them to the end of the array vertices[].
[0053] Specifically, the arithmetic unit 20 stores, for example, in variable aidx, the value obtained by adding the value stored in the array element scan[idx] to L - 1, which is the value stored in idx that designates the end of the array vertices[]. That is, aidx = (L - 1)+scan[idx]. Then, using aidx as the vertex of the basic triangle designated by idx, the vertex coordinates stored in the array element vertices[3idx] (that is, v 3k+1 ), the vertex coordinates stored in the array element vertices[3idx + 2] (that is, v 3k) Store the coordinates of point M as the elements vertices[3aidx], vertices[3aidx + 1], and vertices[3aidx + 2] of the array respectively. As a result, the vertex coordinates of the new basic triangle are added to the end of the array vertices[].
[0054] Note that the arithmetic unit 20 may reverse the array for storing the vertex coordinates of the divided triangle. That is, in the above example, the vertex coordinates v 3k+1 , the vertex coordinates v 3k , and the coordinates of point M may be stored as the elements vertices[3idx], vertices[3idx + 1], and vertices[3idx + 2] of the array respectively. Then, the vertex coordinates v 3k+1 , the vertex coordinates v 3k+2 , and the coordinates of point M may be stored as the elements vertices[3aidx], vertices[3aidx + 1], and vertices[3aidx + 2] of the array respectively.
[0055] In S160, the arithmetic unit 20 increments idx. That is, the arithmetic unit 20 stores the value obtained by adding 1 to the value stored in idx into idx. In S165, the arithmetic unit 20 determines whether the value stored in idx is greater than or equal to L. Here, when the arithmetic unit 20 determines that it is greater than or equal to L, the process proceeds to S170. On the other hand, when the arithmetic unit 20 determines that it is less than L, the process proceeds to S145, and the processes of S145 - S165 are repeated until idx becomes greater than or equal to L.
[0056] In S170 - S185, for the basic triangle specified by the value stored in idx, the arithmetic unit 20 rearranges the vertex coordinates stored in the array elements vertices[3idx], vertices[3idx + 1], and vertices[3idx + 2] so that the lengths of the opposite sides are in descending order. In S170 - S185, idx ranges from 0 ≤ idx ≤ P. P is the value stored as (L - 1)+array element scan[L - 1]. The processes of S170, S175, and S180 are the same as those of S110, S115, and S125, respectively.
[0057] In S185, when the arithmetic unit 20 determines that idx is greater than or equal to P, the pre - shaping process ends here. As a result, the vertex coordinates of the basic triangles with the maximum value of the interior angle being 120° or less are sequentially stored in the array vertices[].
[0058] <Operation> The operation of the pre - shaping process will be described with reference to FIGS. 9 and 10. FIG. 9 shows an example (i.e., L = 10) in which the vertex coordinates of 10 basic triangles are included in vertices[]. FIG. 10 shows the array vertices[], the array flag[], and the array scan[]. In FIG. 10, for the array vertices[], the value stored in the array vertices[3idx] is described as vert[0], the value stored in the array vertices[3idx + 1] is described as vert[1], and the value stored in the array vertices[3idx + 2] is described as vert[2].
[0059] In S115, the arithmetic unit 20 rearranges the vertices within the basic triangle so that the lengths of the opposite sides are in descending order. As a result, for example, as shown in FIG. 10, each vertex coordinate is stored in the array vertices[] (i.e., vert[0] to vert[2]) as v0, v1, v2, ···.
[0060] In S120, the arithmetic unit 20 identifies non-target triangles. As a result, for example, as shown in FIG. 10, the basic triangles specified by idx = 3, 5, 8, and 9 are identified as non-target triangles, and 1 is stored as the elements of the array flag[3], [5], [8], [9].
[0061] In S135, the arithmetic unit 20 identifies the cumulative sum of flag[]. As a result, for example, as shown in FIG. 10, 1 is stored as the element of the array scan[3] specified by idx = 3, and 4, which is the cumulative value, is stored as the element of the array scan[9] specified by idx = 9.
[0062] In S150, the arithmetic unit 20 divides the basic triangles specified by idx = 3, 5, 8, and 9, which are identified as non-target triangles, and updates the array vertices[] with the divided triangles as new basic triangles. For example, the basic triangle specified by idx = 5 is divided by the dividing line DL into a triangle with vertex coordinates v15, v16, and point M5, and a triangle with vertex coordinates v15, v17, and point M5. The variable aidx stores a value of 11, which is the value obtained by adding 2, the value stored in the element scan[5] of the array, to 9 (i.e., the value indicating L - 1).
[0063] Here, v15, v16, and point M5 are stored as the elements of the array vertices[3*5][3*5+1][3*5+2]. That is, v15, v16, and point M5 are stored as the element vert0[5], the element vert1[5], and the element vert2[5] of the array in the basic triangle specified by idx = 5. On the other hand, v15, v17, and point M are stored as the elements of the array vertices[3*11][3*11+1][3*11+2]. That is, v15, v16, and point M5 are stored as the element vert0
[11] , the element vert1
[11] , and the element vert2
[11] of the array in the new basic triangle specified by the new idx (i.e., aidx) = 11.
[0064] In S175, the arithmetic unit 20 rearranges the vertices within the basic triangle again so that the lengths of the opposite sides are in descending order. As a result, although not shown, in the new array vertices[], the vertex coordinates are stored such that the lengths of the opposite sides are in descending order in the basic triangle specified by the value stored in idx.
[0065] [1-2-2. Overview of multi-stage division] The overview of the multi-stage division executed by the arithmetic unit 20 in S12 will be described based on the flowchart shown in FIG. 11 and FIGS. 12 to 14. The triangles shown in FIGS. 12 to 14 represent one basic triangle defined by the vertex coordinates included in the above-described array vertices[]. In the present embodiment, since pre-shaping is performed as described above, each of the basic triangles defined by the vertex coordinates included in the array vertices[] has a shape with a relatively high degree of coincidence with an equilateral triangle.
[0066] <Name> First, the names of the line segments and vertices in the basic triangle will be described. The first major line is the longest side in the basic triangle, such as the first major line l0 shown in FIG. 12, and is the opposite side of the interior angle IA having the largest angle in the basic triangle. In the basic triangle specified by the value stored in idx, the side connecting the vertex indicated by the vertex coordinates stored in the array element vertices[3idx + 1] and the vertex indicated by the vertex coordinates stored in vertices[3idx + 2] corresponds to the first major line l0.
[0067] The second major line is the second longest side in the basic triangle, such as the second major line l1 shown in FIG. 12, and is the opposite side of the interior angle having the second largest angle after the largest angle in the basic triangle. In the basic triangle specified by the value stored in idx, the side connecting the vertex indicated by the vertex coordinates stored in the array element vertices[3idx] and the vertex indicated by the vertex coordinates stored in vertices[3idx + 2] corresponds to the second major line l1.
[0068] The third major line is, for example, the shortest side in the basic triangle, like the third major line l2 shown in FIG. 12, and is the side opposite the interior angle having the smallest angle in the basic triangle. In the basic triangle specified by the value stored in idx, the side connecting the vertex indicated by the vertex coordinates stored in the element vertices[3idx] of the array and the vertex indicated by the vertex coordinates stored in vertices[3idx + 1] corresponds to the third major line l2. 3
[0069] Also, in the basic triangle, vertex A B is also referred to as base point A B . The base point A B refers to the vertex that is the intersection of the first major line l0 and the second major line l1. Vertex A R is also referred to as the right vertex A R . The right vertex A R refers to the vertex that is the intersection of the first major line l0 and the third major line l2. Vertex A L is Left also referred to as vertex A L . The left vertex A L refers to the vertex that is the intersection of the second major line l1 and the third major line l2.
[0070] <Operator> The operators used in the following description will be described. The operator floor(a) is a function that returns the largest integer less than or equal to a. ceil(a) is a function that returns the smallest integer greater than or equal to a. mod(a, b) is a function that returns the remainder in the division of a by b. a / b represents the division of a by b. Note that float(a) means representing a as a floating point number. Here, when a and b are integers, a / b returns the value obtained by truncating the remainder from the division result. For example, 5 / 2 = 2. On the other hand, when both a and b are floating point numbers, a / b gives the division result, for example, 5.0 / 2.0 = 2.5.
[0071] <Overview of the process> First, in S21, the arithmetic unit 20 executes processing on the major line. In the processing on the major line, the arithmetic unit 20 calculates the main division number (for example, M) in each basic triangle. M is an integer where M ≥ 1. The main division number is the number of divisions when equally dividing the first major line (for example, based on a predetermined division length d0) in each basic triangle. The equal division here includes a plurality of two or more divisions, one division, and one division. The first major line points are a plurality (for example, M + 1) of points located at positions that equally divide the first major line l0 by the main division number. The first major line points are the two end points of the first major line l0 (that is, the base point A B and the right vertex A R ). That is, the points on the first major line l0 include at least two first major line points. The number of first major line points referred to below means the number of first major line points on the first major line (for example, the above-mentioned M + 1). In FIG. 12, an example in which four first major line points are included on the first major line l0 in the basic triangle is shown. Note that maj_vert_num described later corresponds to the number of first major line points.
[0072] Next, in S22, the arithmetic unit 20 executes processing on the minor line. In the processing on the minor line, the arithmetic unit 20 sets a sub-division number (for example, N) for each of the plurality of first major line points set on the first major line l0. N is an integer where N ≥ 0. The sub-division number is the number of divisions when equally dividing the set minor line (for example, based on the above-mentioned division length d0) for each of the plurality of first major line points. The equal division here includes a plurality of two or more divisions, one division, and zero divisions.
[0073] The minor line is a line segment that passes through the first major line upper point, extends from the first major line l0 to the second major line l1, and follows the third major line l2. The line segment along the third major line l2 is a line segment parallel to the third major line l2, and the line segment along the third major line l2 includes the third major line l2 itself. The minor line includes a line segment along the third major line l2 with the base point A as the first major line upper point B and also includes the third major line l2 itself for the set line segment with respect to
[0074] In the example of FIG. 13, the basic triangle has four minor lines (i.e., ml0 to ml3) set for each of the four first major line upper points. The sub-division number of ml0 is 0, the sub-division number of ml1 is 1, the sub-division number of ml2 is 2, and the sub-division number of ml3 is 3. The arithmetic unit 20 calculates the coordinates of the first major line upper points and the second major line upper points. As described above, in the example of FIG. 13, ml3 is the third major line l2 and is also a minor line.
[0075] Subsequently, in S23, the arithmetic unit 20 executes a subdivision process. In the subdivision process, the arithmetic unit 20 uses the array vertices[] after the above-described pre-shaping as the vertex coordinate group, the above-described main division number, and the combination information to calculate the coordinates of the vertices of the subdivided triangles for each pair of minor lines set for each of the above-described first major line upper points. The combination information refers to information specifying how the first major line upper points belonging to each subdivided triangle are combined.
[0076] The first major line upper point includes both endpoints of the minor line and is a point that equally divides the minor line by the above-described sub-division number (e.g., N + 1). The both endpoints of the minor line are points on the first major line and the second major line located at both ends of the minor line. The number of first major line upper points hereinafter refers to the number of first major line upper points on the minor line (e.g., the above-described N + 1). m described later in_vert_num corresponds to the number of points on the minor line. Below, an overview will be given of the minor line pairs, the number of subdivided triangles in the minor line pairs, and the combination information.
[0077] <Regarding minor line pairs> A minor line pair is a combination of any two adjacent minor lines in the minor line. A subdivided triangle is one or more triangles that divide the area of the basic triangle sandwiched between the minor line pair, with the minor line points on the two minor lines belonging to the minor line pair as vertices, without overlapping each other. Below, the area of the basic triangle sandwiched between the minor line pair will also be simply referred to as the area sandwiched between the minor line pair.
[0078] Also, below, the minor line set for each point on the first major line will also be referred to as the reference minor line. In this embodiment, among the minor lines adjacent to the reference minor line, the minor line adjacent to the base point A B side will be referred to as the adjacent minor line. That is, a minor line pair is a combination of the reference minor line and the adjacent minor line. Also, a subdivided triangle is one or more triangles that divide the area sandwiched between the minor line pair, with the minor line points on the reference minor line and the adjacent minor line belonging to the minor line pair as vertices, without overlapping each other.
[0079] In the example of FIG. 13, the two end points of the above-mentioned minor line are points on the first major line l0 and points on the second major line l1. For example, the above-mentioned four minor lines (i.e., ml0 to ml3) have ml0 having one minor line point (i.e., min_vert_num = 1 to be described later), ml1 having two minor line points (i.e., min_vert_num = 2), ml2 having three minor line points (i.e., min_vert_num = 3), and ml3 having four minor line points (i.e., min_vert_num = 4). Base point AB The minor line upper point of the minor line ml0 set to is one (i.e., the base point A B ).
[0080] In the example of FIG. 13, for the right vertex A as the first major line upper point R , for the right vertex A R , the minor line ml3 set for the right vertex A and the minor line ml2 set for the first major line upper point (hereinafter also referred to as point A2) adjacent to the base point A side of the right vertex A R are a pair of minor lines. In this pair of minor lines, ml3 corresponds to the reference minor line and ml2 corresponds to the adjacent minor line. For point A2 as the first major line upper point, the minor line ml2 (i.e., the reference minor line) set for point A2 and the minor line ml1 (i.e., the adjacent minor line) set for the point (hereinafter also referred to as point A1) adjacent to the base point A side of point A2 B are a pair of minor lines. Similarly, for point A1 as the first major line upper point, the minor line ml1 (i.e., the reference minor line) set for point A1 and the minor line ml0 (i.e., the adjacent minor line) set for the point (i.e., the base point A B ) adjacent to the base point A side of point A1 B are a pair of minor lines. B )
[0081] Note that in the basic triangle, in this embodiment where a pair of minor lines is set in order from the first major line upper point far from the base point A B towards the base point A B , the minor line set for the base point A as the first major line upper point B is not set as the reference minor line. That is, as shown in FIG. 13, there are three pairs of minor lines set in the basic triangle as an example.
[0082] <Regarding the number of subdivided triangles in the pair of minor lines> For example, the right vertex A as the upper point on the above-described first major line R Regarding the right vertex A R The region sandwiched by the minor line ml3 set for the right vertex A and the adjacent minor line ml2 is divided into non-overlapping triangles by a pair of minor lines, and the triangles are sub-divided triangles. In the division, the minor line upper points on the two minor lines ml3 (i.e., the reference minor line) and ml2 (i.e., the adjacent minor line) belonging to the pair of minor lines are used as the vertices of the sub-divided triangles. In the above example, as shown in FIG. 13, for example, the right vertex A R The number of sub-divided triangles that divide the region of the basic triangle sandwiched by the reference minor line ml3 set for the right vertex A and the adjacent minor line ml2 is calculated to be 5.
[0083] Each of the sub-divided triangles that divide the region of the basic triangle sandwiched by the pair of minor lines may be individually identified by an in-region identification number (i.e., tess_prim_idx described later). The in-region number is a number assigned to each of the sub-divided triangles that divide the region sandwiched by the pair of minor lines, and may be a number that increases as it moves away from the first major line starting from the first major line side (i.e., 0). For example, the numbers underlined in FIG. 14 correspond to the in-region identification numbers. For example, as shown in FIG. 13, for the right vertex A R The sub-divided triangles that divide the region sandwiched by the reference minor line ml3 set for the right vertex A and the adjacent minor line ml2 may be set with in-region identification numbers in order from the first major line side, such as 0, 1, 2, 3, 4.
[0084] <Regarding combination information> The above combination information specifies the combination method of the minor line upper points belonging to each sub-divided triangle. Although the details will be described later, the combination information specifies the combination method of the major line upper points belonging to each sub-divided triangle in order from the sub-divided triangle on the first major line side.
[0085] For example, for the minor line pair of the reference minor line ml3 and the adjacent minor line ml2, first, for the first subdivided triangle as seen from the first major line, the combination method of the points on the minor line is specified as follows. The first subdivided triangle as seen from the first major line is the subdivided triangle with the in-region identification number = 0. That is, the first one is the point on the minor line on ml3 that is the first point on the minor line as seen from the first major line. The second one is the point on the minor line on ml2 that is the first point on the minor line as seen from the first major line. The third one is the point on the minor line on ml3 that is the second point on the minor line as seen from the first major line.
[0086] Also, for the second subdivided triangle as seen from the first major line, the combination method of the points on the minor line is specified as follows. The second subdivided triangle as seen from the first major line is the subdivided triangle with the in-region identification number = 1. That is, the first one is the point on the minor line on ml2 that is the first point on the minor line as seen from the first major line. The second one is the point on the minor line on ml3 that is the second point on the minor line as seen from the first major line. The third one is the point on the minor line on ml2 that is the second point on the minor line as seen from the first major line.
[0087] For the third subdivided triangle as seen from the first major line, the combination information is the same as that of the first subdivided triangle, that is, the base point A BSpecify how to combine the points on the minor line so that it forms a triangle that bulges to the side. The third sub-divided triangle as seen from the first major line is the sub-divided triangle with the in-region identification number = 2. That is, for the first one, use the point on the minor line on ml3 that is the second point on the minor line as seen from the first major line. For the second one, use the point on the minor line on ml2 that is the second point on the minor line as seen from the first major line. For the third one, use the point on the minor line on ml3 that is the third point on the minor line as seen from the first major line. At this time, the point on the minor line specified first shall be the point on the minor line adjacent in the direction along the minor line (that is, the direction away from the first major line) to the point on the minor line specified first in the first sub-divided triangle.
[0088] For the combination information regarding the fourth sub-divided triangle as seen from the first major line, similar to the second sub-divided triangle, that is, the base point A B Specify how to combine the points on the minor line so that it forms a triangle that bulges to the side opposite to the base point A. The fourth sub-divided triangle as seen from the first major line is the sub-divided triangle with the in-region identification number = 3. That is, for the first one, use the point on the minor line on ml2 that is the second point on the minor line as seen from the first major line. For the second one, use the point on the minor line on ml3 that is the third point on the minor line as seen from the first major line. For the third one, use the point on the minor line on ml2 that is the third point on the minor line as seen from the first major line. At this time, the point on the minor line specified first shall be the point on the minor line adjacent in the direction along the minor line (that is, the direction away from the first major line) to the point on the minor line specified first in the second sub-divided triangle. The same shall apply hereinafter.
[0089] That is, the combination information specifies how to combine the points on the minor line for each pair of minor lines, as shown by the dotted line with arrows in Fig. 14, for example. In other words, the combination information, for example, when the in-region identification number is even, is the base point A BThe combination method of points on the minor line may be specified so as to form a triangle that bulges to the side (hereinafter also referred to as the first specified pattern). Also, when the in-region identification number is odd, the base point A B The combination method of points on the minor line may be specified so as to form a triangle that bulges to the opposite side of (hereinafter also referred to as the second specified pattern).
[0090] Each of the points on the minor line can be specified by the main division point identification number (that is, maj_div_idx described later) and the sub-division point identification number (that is, m in _div_idx) described later. As will be described later, the combination information identifies the sub-divided triangles that divide the region sandwiched between the minor line pairs by the in-region identification number, and specifies the combination method of the points on the minor line belonging to the identified sub-divided triangles based on the main division point identification number and the sub-division Point identification number. Note that, as will be described later, the combination information may specify the combination method of the points on the minor line belonging to the sub-divided triangles based on the displacement amount of the main division point identification number and the displacement amount of the sub-division point identification number.
[0091] In this embodiment, the arithmetic unit 20 generates the combination information that specifies the combination method of the points on the minor line belonging to the sub-divided triangles as described above. The arithmetic unit 20 calculates the coordinates of the vertices of the sub-divided triangles for each pair of minor lines set for each of the points on the first major line using the vertex coordinate group, the main division number, and the combination information. The arithmetic unit 20 generates sub-divided triangles at all the basic triangles, in other words, at all the points on the first major line, and ends the multi-stage division.
[0092] [1-2-3. Details of Multi-Stage Division] Specifically, the details of the multi-stage division will be described. (1) Processing on the Major Line The major line processing executed in the multi-segment splitting S21 will be described based on the flowchart shown in FIG. 15. In this process, the array vertices[] after the above-described pre-shaping is used as the input array, and the following arrays are output. Outputting an array means generating an array (i.e., storing values in the elements of the array). The output array is also referred to as the output array. The output arrays are the array prim_id[idx], the array maj_vert_num[idx], and the array csum_maj_vert_num[idx].
[0093] Here, the variable idx (hereinafter referred to as idx) ranges from 0 ≤ idx ≤ P - 1. The total number of idx used in this process is equal to the total number of basic triangles (hereinafter also referred to as the number of basic triangles P) defined by the vertex coordinates stored in the array vertices[]. Note that idx used in the major line processing is hereinafter also referred to as idx_p for distinction.
[0094] <Explanation of each array> The array prim_id[idx] is an array that stores a value (hereinafter also referred to as the basic ID) corresponding to an identification number for identifying each of the basic triangles specified by idx among the basic triangles defined by the vertex coordinates stored in the array vertices[]. The array maj_vert_num[idx] is an array that stores the above-described number of points on the first major line for the basic triangle specified by idx. In the following, similar to the description of multi-segment splitting, the elements of the array may be described simply as, for example, prim_id. Note that the elements of the array vertices[] are represented as floating-point numbers, the elements of the array prim_id[] are represented as integers of 0 or more, and the elements of the array maj_vert_num[] are represented as positive integers.
[0095] <Process> First, in S200, the arithmetic unit 20 stores 0 in idx. Next, in S210, the arithmetic unit 20 sets the basic triangle number P. The arithmetic unit 20 stores the number of basic triangles defined by the vertex coordinates stored in the array vertices[] after the pre-shaping process in the basic triangle number P. The basic triangle number P corresponds to the number of loop iterations (i.e., the number of repetitions) of the processes in S220 to S260 described later.
[0096] Next, in S220, the arithmetic unit 20 stores the value stored in idx in the array prim_id[idx]. For example, if idx = 0, 0 is stored as the element prim_id[0] of the array, and 0 is set as the basic ID of the first basic triangle defined by the array vertices[].
[0097] Next, in S230, the arithmetic unit 20 acquires the vertex coordinates for the basic triangle specified by the value stored in idx. That is, the arithmetic unit 20 acquires the elements vertices[3idx], vertices[3idx + 1], and vertices[3idx + 2] of the array.
[0098] Subsequently, in S240, the arithmetic unit 20 calculates the number of points on the first major line for the basic triangle specified by the value stored in idx. As described above, the points on the first major line include the vertices A B , A R at both ends of the first major line l0 as shown in FIG. 12 above. The arithmetic unit 20 calculates the number of points on the first major line based on equation (2) and stores the calculated value in the array maj_vert_num[idx].
[0099]
Equation
[0100] (2) The first term in the formula corresponds to the above-mentioned main division number. That is, the arithmetic unit 20 calculates the value obtained by dividing the length of the first major line by the division length d0, rounds the calculated value to the nearest integer greater than or equal to the calculated value, and calculates the value obtained by adding 1 to the rounded value as the number of points on the first major line. Since the rounded value is used, the interval between the points on the first major line is a length corresponding to the division length d0. The length corresponding to the division length d0 does not necessarily exactly match the division length d0, but refers to a length within a predetermined range including the division length d0. The division length d0 may be stored in advance in a memory such as the ROM 23. The division length d0 is a value that can be appropriately set according to the application (for example, the accuracy required for computer graphics, etc.). According to the formula (2), the number of points on the first major line is calculated as an integer of 2 or more.
[0101] The length of the first major line is calculated based on the vertex coordinates stored in the array elements vertices[3idx + 1] and vertices[3idx + 2]. For example, assuming that the value stored in idx is 0, for the basic triangle with the value 0 stored in the array element prim_id[0] as the basic ID, the value indicating the number of points on the first major line is stored as the array element maj_vert_num[0].
[0102] Next, in S250, the arithmetic unit 20 increments idx. That is, the arithmetic unit 20 stores the value obtained by adding 1 to the value stored in idx into idx. In the subsequent S260, the arithmetic unit 20 determines whether the value stored in idx is greater than or equal to the basic triangle number P. Here, if the value stored in idx is greater than or equal to the basic triangle number P, the process proceeds to S270.
[0103] On the other hand, if the value stored in idx is less than the basic triangle number P, the arithmetic unit 20 proceeds to S220 and repeats the processes of S220 to S260 based on the newly stored value in idx.
[0104] In S270, for example, the arithmetic unit 20 may change idx by 1 within the range of 0 ≦ idx ≦ P - 1, calculate the total number of elements maj_vert_num[idx] in the array, and store the calculated total number in csum_maj_vert_num[idx]. The total number of elements maj_vert_num[idx] in the array refers to the sum of the elements maj_vert_num[0] to maj_vert_num[idx] in the array.
[0105] When P - 1 is stored in idx, the element csum_maj_vert_num[P - 1] in the array corresponds to the total number Q (hereinafter also referred to as the cumulative sum Q) of the first major line points included in all P basic triangles. Then, the arithmetic unit 20 finishes the processing on the major line.
[0106] <Operation> An example of the operation of the processing on the major line will be described with reference to FIGS. 20 and 29. In FIG. 20, an example where the number of basic triangles P = 3 will be described. Assuming that the number of loop iterations of the processing on the major line is equal to the value stored in the number of basic triangles P as described above, values are stored in the arrays prim_id[0] to prim_id[P - 1] (for example, P = 2) by repeating S220. In the example of FIG. 20, as shown in FIG. 29, 0, 1, and 2 are stored as the elements prim_id[0] to prim_id[2] of the array, and basic IDs such as 0, 1, and 2 are set in order from the first triangle.
[0107] Also, assuming that the number of first major line points is calculated for each basic triangle by repeating S240, as shown in FIG. 20, 4, 3, and 3 are stored as the elements maj_vert_num[0] to maj_vert_num[2] of the array, as shown in FIG. 29.
[0108] Also, when S270 is executed, as shown in FIG. 29, 4, 7, and 10 are stored as the elements csum_maj_vert_num[0] to csum_maj_vert_num[2] of the array, respectively. That is, the value 10 stored as the element csum_maj_vert_num[P - 1] (for example, P = 3) of the array is calculated as the total number Q (i.e., the cumulative sum Q) of the points on the first major line in all the basic triangles.
[0109] Hereinafter, the arrays prim_id[], maj_vert_num[], and csum_maj_vert_num[] are also collectively referred to as the triangle parameter arrays. (2) Processing on the minor line The processing on the minor line executed in S22 of the multi-stage division will be described based on the flowchart shown in FIG. 16. In this processing, the array vertices[] and the above-described triangle parameter arrays are used as input arrays, and the following arrays are used as output arrays.
[0110] The output arrays are the arrays prim_lookup_idx[idx], maj_div_idx[idx], point_on_maj_line0[idx], point_on_maj_line1[idx], min_vert_num[idx], prim_num_per_edge[idx], and csum_prim_num_per_edge[idx].
[0111] Here, idx indicating the elements of the array ranges from 0 ≤ idx ≤ Q - 1. The total number of idx used in this processing is equal to the total number Q (i.e., the cumulative sum Q) of the points on the first major line included in all the basic triangles. Note that idx used in the processing on the minor line is hereinafter also referred to as idx_m for distinction.
[0112] <Explanation of each array> The array prim_lookup_idx[idx] is a so-called lookup table used to reference the above-described triangle parameter array during the execution of the minor line processing. In other words, the array prim_lookup_idx[idx] is correspondence information for associating one major line point specified by idx (i.e., idx_m) with the basic ID of the basic triangle containing this major line point (i.e., idx_p).
[0113] The array maj_div_idx[idx] stores the main division point identification number for the major line point specified by the value stored in idx (i.e., idx_m). The array point_on_maj_line0[idx] stores the position vector for the major line point specified by the value stored in idx (i.e., idx_m). The array point_on_maj_line1[idx] stores the position vector of the major line point on the second major line corresponding to the major line point on the first major line specified by the value stored in idx (i.e., idx_m). The major line point on the second major line is a point located at a position that equally divides the second major line with the same division ratio as the division ratio that divides the first major line.
[0114] The array min_vert_num[idx] stores the number of minor line points on the minor line set for the major line point specified by the value stored in idx (i.e., idx_m).
[0115] The array prim_num_per_edge[idx] stores the number of the above-described subdivided triangles that divide the region sandwiched between the pair of minor lines set for the major line point specified by the value stored in idx (i.e., idx_m) using the minor line points. Note that the elements of the array prim_lookup_idx[], the elements of the array maj_div_idx[], the elements of the array prim_num_per_edge[], and the elements of the array csum_prim_num_per_edge[] are represented as integers greater than or equal to 0. The elements of the array min_vert_num[] are represented as positive integers. The elements of the array point_on_maj_line0[] and the elements of the array point_on_maj_line1[] are represented as floating-point numbers.
[0116] <Processing> First, in S300, the arithmetic unit 20 executes a prim_lookup_idx array generation process to generate the array prim_lookup_idx[idx].
[0117] In the prim_lookup_idx array generation process, as shown in FIG. 17, first, in S400, the arithmetic unit 20 acquires the cumulative sum Q. Next, in S401, the arithmetic unit 20 stores 0 in idx.
[0118] In the subsequent S402, the arithmetic unit 20 stores the element maj_vert_num[idx] of the array in the variable rep_num. Also, the arithmetic unit 20 stores the difference between the element csum_maj_vert_num[idx] of the array and the element maj_vert_num[idx] of the array in the variable ofs_idx.
[0119] Next, in S403, the arithmetic unit 20 determines whether the value stored in rep_num is greater than 0. When the value stored in rep_num is greater than 0, the arithmetic unit 20 transfers the process to S404. When the value stored in rep_num is 0 or less, the arithmetic unit 20 transfers the process to S408. In S404, the arithmetic unit 20 stores 0 in the variable m.
[0120] Next, in S405, the arithmetic unit 20 stores the value stored in idx as the element prim_lookup_idx[ofs_idx + m] of the array specified by "ofs_idx + m".
[0121] In the subsequent S406, the arithmetic unit 20 increments the variable m. That is, the arithmetic unit 20 stores in the variable m a value obtained by adding 1 to the value stored in the variable m. Next, in S407, the arithmetic unit 20 determines whether the value stored in the variable m is greater than or equal to the value stored in rep_num. Here, if the value stored in the variable m is greater than or equal to the value stored in rep_num, the process proceeds to S408.
[0122] On the other hand, if the value stored in the variable m is less than the value stored in rep_num, the arithmetic unit 20 proceeds to S405 and repeats the processes of S405 to S407 based on the newly stored value in the variable m.
[0123] In S408, the arithmetic unit 20 increments idx. That is, the arithmetic unit 20 stores in idx a value obtained by adding 1 to the value stored in idx. Next, in S409, the arithmetic unit 20 determines whether the value stored in idx is greater than or equal to the cumulative sum Q. Here, if the value stored in idx is greater than or equal to the cumulative sum Q, the generation process of the present prim_lookup_idx array ends here.
[0124] On the other hand, if the value stored in idx is less than the cumulative sum Q, the arithmetic unit 20 proceeds to S402 and repeats the processes of S402 to S409 based on the newly stored value in idx. Then, when the value stored in idx becomes greater than or equal to the cumulative sum Q, the generation process of the present prim_lookup_idx array ends here.
[0125] Returning to FIG. 16, the description continues. In S310, the arithmetic unit 20 stores 0 in idx. Next, in S320, the arithmetic unit 20 acquires the total number Q of points on the first major line (that is, the cumulative sum Q). The cumulative sum Q corresponds to the number of loop iterations (that is, the number of repetitions) of S350 to S380 described later.
[0126] First, in S330, the arithmetic unit 20 calculates a main division point identification number for the first major line upper point specified by the value stored in idx. The main division point identification number is a number assigned to each first major line upper point within the basic triangle containing the first major line upper point specified by idx. In the present embodiment, the main division point identification number is the base point A that is the vertex of the basic triangle and connects the first major line and the second major line B in order from B starting from 0 with the base point A B and increasing towards the right vertex A B . The arithmetic unit 20 stores the calculated main division point identification number in the array maj_div_idx[idx]. The main division point identification number, that is, the element maj_div_idx[idx] of the array, is calculated based on equations (3) and (4).
[0127]
Equation
[0128] The lookup_idx shown in equation (3) corresponds to the index (i.e., idx_p) for specifying the triangle parameter array to be referred to. Next, in S340, the arithmetic unit 20 calculates the position vector for the first major line upper point specified by the value stored in idx and stores it in the array point_on_maj_line0[idx]. Also, the arithmetic unit 20 calculates the position vector for the second major line upper point corresponding to the first major line upper point specified by the value stored in idx and stores it in the array point_on_maj_line1[idx]. Here, the so-called corresponding means that the order counted from the base point A B is the same.
[0129] The coordinates of the point on the first major line are calculated by dividing the first major line at a ratio of maj_div_idx[idx] / maj_vert_num[idx]. Similarly, the coordinates of the point on the second major line are calculated by dividing the second major line at a ratio of maj_div_idx[idx] / maj_vert_num[idx]. Note that when the point on the first major line specified by the value stored in idx is the base point A B if so, the coordinates of the point on the first major line and the coordinates of the corresponding point on the second major line match.
[0130] The arithmetic unit 20 first calculates lookup_idx in the same manner as in the above equation (3). Next, the arithmetic unit 20 stores the coordinates of the base point A B in the variable org.
[0131]
Number
[0132] Subsequently, the arithmetic unit 20 calculates the side vector edge0 of the first major line, which is the longest side, and the side vector edge1 of the second major line, which is the second longest side, based on equations (6) and (7).
[0133]
Number
[0134] Then, the arithmetic unit 20 calculates the coordinates of the point on the first major line with reference to the base point A B (that is, the vertex with the third major line, which is the shortest side, as the opposite side) and stores them in the array point_on_maj_line0[idx]. Similarly, the arithmetic unit 20 calculates the coordinates of the point on the second major line with reference to the base point A B and stores them in the array point_on_maj_line1[idx].
[0135] [Number]
[0136] In the subsequent S350, for the first major line upper point specified by the value stored in idx, the arithmetic unit 20 calculates the number of minor line upper points on the minor line set for this point. The arithmetic unit 20 stores the calculated number of minor line upper points in the array min_vert_num[idx]. The length of the minor line is calculated based on the element point_on_maj_line0[idx] of the array and the element point_on_maj_line1[idx] of the array. That is, the element min_vert_num[idx] of the array is calculated by the following formula (10) in the same manner as the above-described array maj_vert_num[idx].
[0137] [Number]
[0138] The first term in formula (10) corresponds to the above-described sub-division number. Among the first major line upper points specified by the value stored in idx, the first major line upper point where the element maj_dev_idx[idx] of the array is 0 corresponds to the base point A B corresponds to. For the base point A B , 1 is stored as the element min_vert_num[idx] of the array.
[0139] In the subsequent S360, for the first major line upper point specified by the value stored in idx, for each minor line pair set for this point, the arithmetic unit 20 calculates the number of sub-division triangles that divide the area sandwiched by the minor line pair. The arithmetic unit 20 stores the calculated number in the array prim_num_per_edge[idx].
[0140] Note that the reference minor line upper point referred to below means the minor line upper point on the reference minor line. The adjacent minor line upper point means the minor line upper point on the adjacent minor line. That is, the adjacent minor line upper point means the minor line (i.e., the reference minor line) set for the first major line specified by the value stored in idx, which is the minor line upper point on the minor line adjacent to the base point A B side. In the present embodiment, among the two minor lines that form a pair, the minor line set for the first major line upper point with the larger maj_div_idx is used as the reference minor line. In the region of the basic triangle sandwiched between the reference minor line and the adjacent minor line that forms a pair with it, the number of vertices constituting the subdivided triangle is the total value of the reference minor line upper point and the adjacent minor line upper point. Paying attention to the case where 0 is stored in idx, the number of subdivided triangles that divide the region sandwiched between the minor line pair is calculated based on the formula (11). The calculated value is stored in the array prim_per_edge[idx].
[0141] [Number]
[0142] Next, in S370, the arithmetic unit 20 increments idx. That is, the arithmetic unit 20 stores in idx the value obtained by adding 1 to the value stored in idx. In the subsequent S380, the arithmetic unit 20 determines whether the value stored in idx is greater than or equal to the cumulative sum Q. Here, if it is determined that the value stored in idx is greater than or equal to the cumulative sum Q, the process proceeds to S390.
[0143] On the other hand, if it is determined that the value stored in idx is less than the cumulative sum Q, the arithmetic unit 20 proceeds to S330 and repeats the processes of S330 to S380 based on the newly stored value in idx.
[0144] In the S390, for example, the arithmetic unit 20 may calculate the total number of elements prim_num_per_edge[idx] of the array by incrementing idx by 1 in the range of 0 ≦ idx ≦ Q-1, and store the calculated total number in the array csum_prim_num_per_edge[idx]. The total number of elements prim_num_per_edge[idx] of the array is the sum of the elements prim_num_per_edge[0] to prim_num_per_edge[idx] of the array.
[0145] When Q-1 is stored in idx, the element csum_prim_num_per_edge[Q-1] of the array corresponds to the total number R of sub-divided triangles (hereinafter also referred to as the cumulative sum R) that divides the region sandwiched by the minor line pairs set for all Q first major line points. In other words, the cumulative sum R is the total number of sub-divided triangles included in all the basic triangles (i.e., P). The arithmetic unit 20 ends the processing on the minor line as described above.
[0146] <Operation> The operation of the processing on the minor line will be described with reference to FIGS. 20 to 22, FIG. 24, and FIG. 29. Assuming that the number of loop iterations is the cumulative sum Q as described above, values are stored in the elements prim_lookup_idx[0] to prim_lookup_idx[Q-1] of the array by S300. For example, as shown in FIG. 21, assuming that the first major line points are arranged with Q = 10, as shown in FIGS. 24 and 29, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2 are stored in the elements prim_lookup_idx[0] to prim_lookup_idx[9] of the array, respectively. That is, for each of the first major line points, the index (i.e., the basic ID) when referring to the triangle parameter array is stored.
[0147] Also, by repeating S330, as shown in FIGS. 21 and 29, as the elements maj_div_idx[0] to maj_div_idx[9] of the array, 0, 1, 2, 3, 0, 1, 2, 0, 1, 2 are stored respectively. That is, for each basic triangle, for each point on the first major line, the base point A B is set as 0 and the main division point identification numbers are set in order.
[0148] Also, by repeating S340, as shown in FIG. 29, as the elements point_on_maj_line0[0] to point_on_maj_line0[9] of the array, mv00, mv01,... mv09 are stored respectively. Similarly, as the elements point_on_maj_line1[0] to point_on_maj_line1[9] of the array, mv10, mv11,... mv19 are stored respectively. mv is a position vector.
[0149] Also, by repeating S350, as shown in FIGS. 21 and 29, as the elements min_vert_num[0] to min_vert_num[9] (i.e., the number of points on the minor line) of the array, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3 are stored respectively. Also, by repeating S360, as shown in FIGS. 22 and 29, as the elements prim_num_per_edge[0] to prim_num_per_edge[9] of the array, 0, 1, 3, 5, 0, 1, 3, 0, 1, 3 are stored respectively.
[0150] For example, in the basic triangle specified by prim_id = 0 shown in FIG. 21, the point on the first major line specified by idx = 3 is the right vertex A RIt is. In this case, the number of sub - divided triangles that divide the region sandwiched between the minor line pairs is 5 as shown in Fig. 22, and as shown in Fig. 29, 5 is stored in prim_num_per_edge[3]. In this minor line pair, the reference minor line is the minor line set for the point on the first major line specified by idx = 3, and the adjacent minor line is the minor line set for the point on the first major line specified by idx = 2.
[0151] Also, when S390 is executed, as shown in Figs. 22 and 29, 0, 1, 4, 9, 9, 10, 13, 13, 14, 17 are stored as the elements csum_prim_num_per_edge[0] to csum_prim_num_per_edge[9] of the array respectively.
[0152] In the examples of Figs. 20 to 22, the value 17 stored as the element csum_maj_vert_num[9] of the array corresponds to the total number of sub - divided triangles (i.e., the cumulative sum R) that divide the region sandwiched between the minor line pairs set for 9 (i.e., Q = 9) points on the first major line. In other words, 17 corresponds to the total number R of sub - divided triangles included in all 3 (i.e., P = 3) basic triangles shown in Figs. 20 to 22.
[0153] Note that hereinafter, the arrays prim_lookup_idx[idx], maj_div_idx[idx], point_on_maj_line0[idx], point_on_maj_line1[idx], min_vert_num[idx], prim_num_per_edge[idx], csum_prim_num_per_edge[idx] are collectively also referred to as the major line parameter arrays.
[0154] (3) Sub - division processing The sub-division process executed in the multi-segment division S23 will be described based on the flowchart shown in FIG. 18. In this process, the above-described major line parameter array is used as the input array, and the following arrays are used as the output arrays. The output arrays are the array maj_line_lookup_idx[idx] and the array tess_vert[idx].
[0155] Here, idx indicating the element of the array ranges from 0 ≤ idx ≤ R - 1. The total number of idx used in this process is equal to the total number of sub-divided triangles R (i.e., the cumulative sum R) included in all the basic triangles. Note that idx used in the sub-division process is also described as idx_sub below for distinction.
[0156] <Explanation of each array> The array maj_line_lookup_idx[idx] is a lookup table used to refer to the above-described major line parameter array during the execution of the sub-division process. In other words, the array maj_line_lookup_idx[idx] is correspondence information for associating one sub-divided triangle specified by idx (i.e., idx_sub) with the number (i.e., idx_m) identifying the first major line upper point that sets the minor line pair including this sub-divided triangle.
[0157] The array tess_vert[idx] stores the vertex coordinates for the subdivided triangle specified by the value stored in idx (i.e., idx_sub). The elements of the array tess_vert[3idx], tess_vert[3idx + 1], and tess_vert[3idx + 2] represent the three vertex coordinates in one subdivided triangle, respectively. Similar to the above-mentioned array vertices[], the array tess_vert[idx] may be described as tess_vert[idy][idx]. idy ranges from 0 ≤ idy ≤ 2. That is, tess_vert[0][idx] stores the first specified vertex coordinate for the subdivided triangle specified by the value stored in idx. Similarly, tess_vert[1][idx] stores the second specified vertex coordinate for the subdivided triangle specified by the value stored in idx, and tess_vert[2][idx] stores the third specified vertex coordinate for the subdivided triangle specified by the value stored in idx. Note that the element maj_line_lookup_idx[idx] of the array is represented as an integer greater than or equal to 0, and the element tess_vert[idx] of the array is represented as a floating point number.
[0158] <Process> As shown in FIG. 18, first in S500, the arithmetic unit 20 executes a maj_line_lookup_idx array generation process to generate the array maj_line_lookup_idx[idx]. The maj_line_lookup_idx array generation process, as shown in FIG. 19, is the same as the prim_lookup_idx array generation process shown in FIG. 17 except that S410, S412, S415, and S419 are different, so the description is omitted here. That is, the cumulative sum R is used instead of the cumulative sum Q in the prim_lookup_idx array generation process, and the prim_num_per_edge[] is used instead of the array maj_vert_num[]. Also, the array csum_prim_num_per_edge[] is used instead of the array csum_maj_vert_num[]. Thereby, the array maj_line_lookup_idx[idx] is output. Returning to FIG. 18, the description continues.
[0159] In S505, the arithmetic unit 20 stores 0 in idx. Next in S510, the arithmetic unit 20 acquires the total number of subdivided triangles R (that is, the cumulative sum R). The cumulative sum R corresponds to the number of loop iterations (that is, the number of repetitions) of S515 to S570.
[0160] In S515 - S570, the arithmetic unit 20 calculates the vertex coordinates for the subdivided triangle specified by the value stored in idx, and stores the calculated vertex coordinates in tess_vert[idy][idx].
[0161] First in S515, the arithmetic unit 20 stores the value of the index (that is, idx_m) used to refer to the major line parameter array for the subdivided triangle specified by the value stored in idx (that is, idx_sub) in the variable lookup_idx as shown in Equation (12).
[0162]
Equation
[0163] Accordingly, it is possible to specify the major line parameters for the subdivided triangle specified by the value stored in idx (i.e., idx_sub). That is, it is not necessary to newly load the major line parameter array, and the major line parameters already stored in the memory can be referred to.
[0164] In subsequent S520, the arithmetic unit 20 calculates, based on Equation (13), the number indicating which position the subdivided triangle specified by the value stored in idx (i.e., idx_sub) is among the subdivided triangles that divide the region sandwiched between the minor line pairs including this subdivided triangle, as viewed from the first major line. That is, the in-region identification number described above is calculated. The arithmetic unit 20 stores the calculated in-region identification number in the array tess_prim_id[idx].
[0165] [Number]
[0166] In S525 and S530, the arithmetic unit 20 generates combination information. As described above, the combination information identifies the subdivided triangles that divide the region sandwiched between the minor line pairs by the in-region identification number, and specifies the combination method of the points on the minor line belonging to the identified subdivided triangles based on the main division point identification number and the sub-division Point identification number. In the present embodiment, as described above, when the in-region identification number is even, the combination information specifies the combination method so as to be the first specified pattern, and when the in-region identification number is odd, the combination information specifies the combination method so as to be the second specified pattern. The first specified pattern is a pattern that specifies the combination method of the points on the minor line so as to form a triangle that is convex on the AB side of the base point, and the second specified pattern is a pattern that specifies the combination method of the points on the minor line so as to form a triangle that is convex on the side opposite to the base point AB. Here, the even number includes 0.
[0167] In this embodiment, the combination information specifies the combination method of the minor line upper points belonging to the subdivided triangle based on the displacement amount of the main division point identification number and the displacement amount of the sub-division point identification number.
[0168] First, in S525, the displacement amount of the main division point identification number is calculated. Here, when only focusing on the main division point identification number (i.e., maj_div_idx), in the first specified pattern, as shown in FIG. 26, the combination method of the minor line upper points is represented as maj_div_idx[idx] → maj_div_idx[idx - 1] → maj_div_idx[idx] with the main division point number of the first major line upper point where the minor line pair is set as maj_div_idx[idx]. Here, based on maj_div_idx[idx] which is the main division point number of the first major line upper point where the minor line pair is set, the combination method of the minor line upper points is indicated by the displacement amount of the main division point identification number as 0 → -1 → 0. On the other hand, in the second specified pattern, based on maj_div_idx[idx] which is the main division point number of the first major line upper point where the minor line pair is set, the combination method of the minor line upper points is indicated by the displacement amount of the main division point identification number as -1 → 0 → -1.
[0169] Therefore, in this step, the arithmetic unit 20 calculates the value to be stored in the variable maj_div_of f set for the subdivided triangle specified by the value stored in idx based on Equation (14). The value stored in the variable maj_div_of f set indicates the displacement amount of the main division point identification number.
[0170]
Equation
[0171] As a result, as shown in Fig. 27, when tess_prim_idx[idx] is even, (0, -1, 0) is calculated as the displacement amount of the main division point identification number. When tess_prim_idx[idx] is odd, (-1, 0, -1) is calculated as the displacement amount of the main division point identification number.
[0172] Next, in S530, the displacement amount of the secondary division point identification number is calculated. Here, only the secondary division point identification number (i.e., m in _div_idx) is considered. In the first specified pattern, as shown in Fig. 26, the combination method of the points on the minor line is represented as 0→0→1 (for example, the subdivided triangle with the in-region identification number = 0), 1→1→2 (for example, the subdivided triangle with the in-region identification number = 2), 2→2→3 (for example, the subdivided triangle with the in-region identification number = 4), and so on. On the other hand, in the second specified pattern, the combination method of the points on the minor line is represented as 0→1→1 (for example, the subdivided triangle with the in-region identification number = 1), 1→2→2 (for example, the subdivided triangle with the in-region identification number = 3), and so on.
[0173] Here, the secondary division Point identification number of the point on the minor line specified second in each combination method (hereinafter also referred to as the reference secondary division Point identification number) is used as a reference. In the first specified pattern, the combination method of the points on the minor line is, for example, for the subdivided triangle with the in-region identification number = 0, the displacement amount of the secondary division point identification number is represented as 0→0→+1 (for example, the reference secondary division Point identification number = 0) with respect to the reference secondary division Point identification number. Similarly, for the subdivided triangle with the in-region identification number = 2, the displacement amount of the secondary division point identification number is represented as 0→0→+1 (for example, the reference secondary division Point identification number = 1) with respect to the reference secondary division Point identification number. On the other hand, in the second specified pattern, the combination method of the points on the minor line is, for the subdivided triangle with the in-region identification number = 1, -1→0→0 with respect to the reference secondary division Point identification number (for example, the reference secondary division PointIt is indicated by the displacement amount of the sub-division point identification number, such as Identification number = 1). Similarly, for the finely divided triangle with Region identification number = 3, with respect to the reference sub-division Point identification number, -1 → 0 → 0 (for example, reference sub-division Point identification number = 2), is indicated by the displacement amount of the sub-division point identification number.
[0174] Therefore, in this step, the arithmetic unit 20 calculates the value to be stored in the variable m in _div_of f set for the finely divided triangle specified by the value stored in idx based on Equation (15). The value to be stored in the variable m in _div_of f set indicates the displacement amount of the sub-division point identification number.
[0175]
Equation
[0176] As a result, as shown in FIG. 28, when tess_prim_idx[idx] as the region identification number is even, (0, 0, 1) is calculated as the displacement amount of the sub-division point identification number. When tess_prim_idx[idx] is odd, (-1, 0, 0) is calculated as the displacement amount of the sub-division point identification number.
[0177] Next, in S535 - S560, for the finely divided triangle specified by the value stored in idx, the combinations of points on the minor line are sequentially stored in the array tess_vert[idy][idx]. When specifying the combinations of points on the minor line, the major division point identification number and the sub-division point identification number are used. In this embodiment, based on the above-described displacement amounts of the major division point identification number and the sub-division point identification number, the major division point identification number and the sub-division point identification number for specifying the combinations of points on the minor line are determined.
[0178] First, in S535, the arithmetic unit 20 stores 0 in the variable idy. Next, in S540, the arithmetic unit 20 calculates the coordinates of both end points of the minor line including the point for the minor line point specified by the value stored in idy among the minor line points belonging to the subdivided triangle specified by the value stored in idx. The minor line point specified by the value stored in idy refers to the minor line point specified as the (idy + 1)-th in the combination method based on the combination information. The both end points are the first major line point and the second major line point.
[0179] Based on equation (16), the arithmetic unit 20 stores the position vector (i.e., coordinates) of the first major line point, which is one of the both end points, in the variable point_0. Also, based on equation (17), the arithmetic unit 20 stores the position vector (i.e., coordinates) of the second major line point, which is the other of the both end points, in the variable point_1.
[0180] [Number]
[0181] In the subsequent S545, first, the arithmetic unit 20 calculates a sub-division Point identification number for the minor line point specified by the value stored in idy in the subdivided triangle specified by the value stored in idx based on equation (18). The sub-division Point identification number is calculated based on the reference sub-division Point identification number and the displacement amount of the sub-division Point identification number calculated in S530. The arithmetic unit 20 stores the calculated sub-division Point identification number in the variable min_div_idx. floor((tess_prim_id[idx]+1) / 2) in equation (18) indicates the sub-division Point identification number. Then, the arithmetic unit 20 calculates the internal division ratio based on equation (19) using the calculated sub-division Point identification number and stores it in the variable div_ratio.
[0182] [Number]
[0183] The internal ratio represents the division ratio at which the minor line point specified by the value stored in idy among the minor line points belonging to the subdivided triangle specified by the value stored in idx divides the minor line containing this point.
[0184] Next, in S550, the arithmetic unit 20 stores the calculated coordinates in the array tess_vert[idy][idx] based on equation (20).
[0185] [Number]
[0186] In the subsequent S555, the arithmetic unit 20 increments idy. That is, the arithmetic unit 20 stores the value obtained by adding 1 to the value stored in idy in idy. Next, in S560, the arithmetic unit 20 determines whether the value stored in idy is 3 or more. Here, when it is determined that the value is 3 or more, the arithmetic unit 20 transfers the process to S565. On the other hand, when it is determined that the value is less than 3, the arithmetic unit 20 transfers to S540 and repeats the processes of S540 - S560 until idy becomes 3 or more.
[0187] In S565, the arithmetic unit 20 increments idx. That is, the arithmetic unit 20 stores the value obtained by adding 1 to the value stored in idx in idx. In S570, the arithmetic unit 20 determines whether the value stored in idx is R or more. Here, when it is determined that the value is less than R, the arithmetic unit 20 transfers the process to S515 and repeats the processes of S515 - S570. On the other hand, when it is determined that the value is R or more, the arithmetic unit 20 ends the present subdivision process.
[0188] [Operation] The operation of the sub-division process will be described with reference to FIGS. 20 to 23, FIG. 25, and FIG. 29. Assuming that the number of loop iterations is the cumulative sum R as described above, the elements maj_line_lookup_idx[0] to maj_line_lookup_idx[R - 1] of the array are stored by repeating S515. For example, as shown in FIG. 22, assuming Q = 10 and the minor line upper points are arranged. As shown in FIG. 29, as the elements maj_line_lookup_idx[0] to maj_line_lookup_idx[Q - 1] of the array, 1, 2, 2, 2, 3, 3, 3, 3, 3, 5,... are stored respectively. That is, for each sub-divided triangle specified by the value stored in idx, an index (i.e., idx_m) for referring to the major line parameter array is set.
[0189] Hereinafter, the operation in the case of idx = 9 (i.e., idx_sub = 9) will be described among the examples shown in FIGS. 20 to 23. The sub-divided triangle specified by idx = 9 is included in the basic triangle specified by prim_id = 1 as shown in FIG. 22.
[0190] In S515, for the sub-divided triangle specified by idx = 9, maj_line_lookup_idx[9] = 5 is set as lookup_idx. As a result, for example, as indicated by the arrow in FIG. 29, it becomes possible to refer to the major line parameter array. For example, the main division point identification number (maj_div_idx) for the major line upper point where the minor line pair including the sub-divided triangle specified by idx = 9 is set is specified as 1. That is, maj_div_idx[lookup_idx] = 1 (for example, lookup_idx = 5).
[0191] In S520, for the sub-divided triangle specified by idx = 9, the in-region identification number (i.e., tess_prim_id[9]) is calculated as 9 - 10 + 1 = 0 based on the formula (13).
[0192] In S525, maj_div_offset is calculated as (0, -1, 0) based on equation (14), and in S530, m in _div_offset is calculated as (0, 0, 1) based on equation (15).
[0193] In S535 to S560, when idy = 0, in S540, both endpoints of the reference minor line among the minor line pairs (i.e., the minor line set for the point on the first major line where maj_div_idx = 1) are specified. In S545, the sub-division Point identification number is calculated as 0 based on equation (18), and the internal division ratio is calculated as 0. In S550, based on the internal division ratio, the coordinates of the point on the first major line, which is one of the two endpoints of the reference minor line, are specified as the first minor line point belonging to the subdivided triangle.
[0194] Similarly, when idy = 1, in S540, both endpoints of the adjacent minor line among the minor line pairs (i.e., the minor line set for the point on the first major line where maj_div_idx = 0) (i.e., in this example, base point A B ) are specified. In S545, the sub-division Point identification number is calculated as 0 based on equation (18), and the internal division ratio is calculated as 0. In S550, based on the internal division ratio, the coordinates of the point on the first major line, which is one of the two endpoints of the adjacent minor line (i.e., in this example, base point A B ) are specified as the second minor line point belonging to the subdivided triangle.
[0195] Similarly, when idy = 2, in S540, both endpoints of the reference minor line among the minor line pairs (i.e., the minor line set for the point on the first major line where maj_div_idx = 1) are specified. In S545, the sub-division PointThe identification number is calculated as 1 based on the formula (18), and the internal ratio is calculated as 1 / 1 = 1. In S550, based on the internal ratio, the coordinates of the point on the second major line, which is the other of the two endpoints of the reference minor line, are specified as the third point on the minor line belonging to the subdivided triangle.
[0196] In this way, for the subdivided triangle specified by idx = 9, the combination method of the points on the minor line belonging to the subdivided triangle is specified (that is, the first specified pattern). Then, the position vectors (that is, coordinates) specified in the order according to the combination method are stored in the array tess_vert[idy][idx].
[0197] The arithmetic unit 20 executes the same process for the subdivided triangles specified by idx = 0 to R - 1. As a result, an array tess_vert[idy][idx] including the vertex coordinates of a total of R subdivided triangles is obtained.
[0198] In this way, according to a simple rule using the displacement amount as combination information, the regions sandwiched by the minor line pairs are divided without overlapping each other, and subdivided triangles connecting the points on the minor lines close to each other are generated.
[0199] [1 - 3. Effect] According to the first embodiment described in detail above, the following effects are obtained. (1a) In each basic triangle, in S21, the arithmetic unit 20 sets the main division number as the number of divisions when equally dividing the first major line into a plurality of parts. The first major line is equally divided based on the division length d0. In S22, for each of the plurality of points on the first major line set on the first major line, the arithmetic unit 20 sets the sub - division number when equally dividing the set minor line. The minor line is equally divided based on the same division length d0 as when dividing the point on the first major line.
[0200] In S23, the arithmetic unit 20 calculates the coordinates of the vertices of the subdivided triangles for each pair of minor lines set for each point on the first major line, using the array vertices[], maj_vert_num, and combination information. The combination information is information that specifies how the points on the minor lines belonging to each subdivided triangle are combined for each pair of minor lines set for each point on the major line. The subdivided triangles are one or more triangles that divide the region of the basic triangle sandwiched by the pair of minor lines, with the points on the minor lines belonging to the pair of minor lines as vertices, without overlapping each other.
[0201] By dividing based on the division length d0, such an arithmetic unit 20 can make the intervals between the points on the first major line and the intervals between the points on the minor line substantially the same. That is, among the three sides of the subdivided triangle, the sides along two of the sides can be made to have substantially the same length. The two sides are the side along the first major line where the points on the first major line are set, and the minor line where the points on the minor line are set. For this reason, the basic triangle can be divided into subdivided triangles having a shape with a relatively large degree of coincidence with an equilateral triangle. As a result, it is possible to suppress the new subdivided triangles generated by dividing the basic triangle from moving away from the equilateral triangle. In the present embodiment, a greater effect can be obtained when the basic triangle has a shape with a relatively large degree of coincidence with an equilateral triangle.
[0202] (1b) In the basic triangle, the arithmetic unit 20 sets the side opposite the interior angle having the largest angle as the first major line, the side opposite the interior angle having the second largest angle as the second major line, and the side opposite the interior angle having the smallest angle as the third major line. That is, the second major line has a length relatively closer to the first major line than the third major line. By dividing the second major line at the same division ratio as the first major line, the interval between the points on the second major line can be made relatively closer to the interval between the points on the first major line (i.e., the division length d0).
[0203] Such an arithmetic unit 20 can relatively approximate the side along the second major line on which the second major line upper point is set among the three sides of the subdivided triangle to the division length d0. As a result, the subdivided triangle can be made closer to a shape having a relatively large degree of coincidence with an equilateral triangle.
[0204] (1c) When specifying the minor line upper points belonging to one subdivided triangle, the combination information specifies the minor line upper points as follows for each minor line pair set for the first major line upper point. The combination information alternately specifies, in order along the minor line, the minor line upper point on the minor line set for each of the first major line upper points (that is, the reference minor line upper point) and the minor line upper point on the adjacent minor line (that is, the adjacent minor line upper point).
[0205] Specifying in order along the minor line means the order of the minor line upper points on the minor line. Alternately means that after specifying the reference minor line upper point, the adjacent minor line upper point is specified next, and after specifying the adjacent minor line upper point, the reference minor line upper point is specified next.
[0206] The arithmetic unit 20 can specify the minor line upper points belonging to the subdivided triangle including two sides corresponding to the division length d0 by alternately moving the two minor lines in the minor line pair to specify the minor line upper points belonging to the triangle. The two sides corresponding to the division length d0 are the side parallel to the first major line and the side included on the minor line in the subdivided triangle that divides the region sandwiched by the minor line pair. As a result, the basic triangle can be divided into a plurality of subdivided triangles having a shape with a relatively large degree of coincidence with an equilateral triangle.
[0207] (1) Also, in the above (1c), specifically, the combination information may include at least one of the first designation pattern and the second designation pattern when designating a point on the minor line belonging to the subdivided triangle. The first designation pattern designates the points on the minor line belonging to the subdivided triangle in the order of the reference point on the minor line, the adjacent point on the minor line, and the other adjacent reference point on the minor line. That is, the points on the minor line that are closest to each other and belong to the triangle are designated. The second designation pattern designates the points on the minor line belonging to the subdivided triangle in the order of the adjacent point on the minor line, the reference point on the minor line, and the other adjacent point on the adjacent minor line. That is, similar to the first designation pattern, the points on the minor line that are closest to each other are designated.
[0208] The arithmetic unit 20, in the first designation pattern, is the base point A B For the subdivided triangle that is convex on the side, and for the subdivided triangle that is convex on the side opposite to the base point A in the second designation pattern B A shape with a relatively large degree of coincidence with an equilateral triangle can be obtained.
[0209] (2) In the above (1c)'s (1), when there are a plurality of subdivided triangles that divide the region sandwiched between the minor line pairs, the combination information may alternately designate the first designation pattern and the second designation pattern. The arithmetic unit 20 can divide the region of the basic triangle sandwiched between the minor line pairs without overlapping each other by repeatedly dividing the subdivided triangles according to the first designation pattern and the second designation pattern based on the combination information.
[0210] (1d) In any one of the above (1c), (1c)'s (1), and (2), the arithmetic unit 20 sets the main division point identification number (that is, maj_div_idx) for the first major line point at S330. The arithmetic unit 20, at S545, sets the sub-division point identification number (that is, m inSet (_div_idx). For example, the secondary division point identification numbers are set in order from the first major line side. Each point on the minor line is specified by the major division point identification number and the secondary division point identification number. The combination information specifies how the points on the minor line belonging to the sub-divided triangles that divide the area of the basic triangle sandwiched between the pair of minor lines are combined, based on the major division point identification number and the secondary division point identification number.
[0211] The arithmetic unit 20 can uniquely identify how the points on the minor line belonging to the sub-divided triangles are combined using the combination information.
[0212] (1) In the above (1d), in the arithmetic unit 20, the combination information may specify how the points on the minor line belonging to the sub-divided triangles are combined, based on the displacement amount of the major division point identification number and the displacement amount of the secondary division point identification number.
[0213] Since the combination information can be made into simple information having regularity based on the displacement amount, the amount of information of the combination information can be reduced. As a result, when the arithmetic unit 20 generates the combination information, the generation becomes easy, and when the arithmetic unit 20 stores the combination information in advance, its memory capacity can be reduced.
[0214] (2) In the above (1) of (1d), in the arithmetic unit 20, the displacement amount of the major division point identification number may be expressed as the displacement amount with respect to the major division point identification number that the point on the minor line set for the point on the first major line has. Secondary division PointThe displacement amount of the identification number may be expressed as the displacement amount with respect to the sub-division point identification number of the minor line point specified second when specifying the minor line point belonging to the subdivided triangle. The arithmetic unit 20 can generate subdivided triangles such as the above-described first specification pattern and second specification pattern for each major line point in the same manner using the combination information based on the displacement amount. When the arithmetic unit 20 is a device capable of parallel processing, the same parallel processing can be executed for each major line point.
[0215] (3) As described above, the arithmetic unit 20 may generate combination information. Since it is not necessary to store in advance a table showing the combination information in a storage device or the like, the memory capacity can be suppressed in the arithmetic unit 20.
[0216] (1e) In S11, the arithmetic unit 20 executes pre-shaping. In the pre-shaping, in S120, for each basic triangle defined by the polygon vertex coordinate data (that is, the array vertices[]), the arithmetic unit 20 determines whether it is the target triangle. In S150, the arithmetic unit 20 divides a basic triangle determined not to be the target triangle (that is, a basic triangle determined to be a non-target triangle) into a plurality of triangles so that the degree of coincidence with an equilateral triangle becomes a relatively large shape. In S155, the arithmetic unit 20 generates a new array vertices[] including the vertex coordinates of the divided triangles. For each basic triangle defined by the coordinates of each vertex included in the new array vertices[] generated in S11, the arithmetic unit 20 sets the main division number in S21 and sets the sub-division number in S22. Then, in S23, the arithmetic unit 20 calculates the coordinates of the vertices of a plurality of subdivided triangles that further divide the area of the basic triangle.
[0217] Such an arithmetic unit 20 can perform multi-stage division on the pre-shaped basic triangle shaped so that the degree of coincidence with an equilateral triangle is relatively large. Compared with the case of performing multi-stage division without performing pre-shaping, the arithmetic unit 20 can obtain a finely divided triangle with a relatively large degree of coincidence with an equilateral triangle.
[0218] (1e) Specifically, for each of the basic triangles, the arithmetic unit 20 determines whether the maximum value of the interior angles is less than the allowable angle, and when the maximum value of the interior angles is less than the allowable angle, determines that the basic triangle is the target triangle. Also, when the maximum value of the interior angles is greater than or equal to the allowable angle, the arithmetic unit 20 determines that the basic triangle is not the target triangle. The arithmetic unit 20 can easily determine whether the basic triangle is the target triangle or not by a mathematical formula using the maximum value of the interior angles.
[0219] (1f) When it is determined that the basic triangle is not the target triangle, the arithmetic unit 20 divides the basic triangle into two by a bisector that bisects the interior angle having the maximum value in the basic triangle. Thereby, for example, when the triangle before division has a shape that is not relatively close to an equilateral triangle, such as when the maximum interior angle is 120° or more, the triangle is divided into two so as to bisect the maximum interior angle. The arithmetic unit 20 can make the shape of the triangle after division have a relatively large degree of coincidence with an equilateral triangle compared with the case of repeatedly bisecting an arbitrary interior angle (for example, the minimum interior angle) to divide the triangle.
[0220] (1g) For example, the allowable angle is 120°. Thereby, the arithmetic unit 20 can make the maximum interior angle of the triangle after division satisfy 60° ≤ maximum interior angle < 90°, and can make the shape of the triangle after division approach a shape with a relatively large degree of coincidence with an equilateral triangle.
[0221] <Correspondence of Japanese and Chinese> The arithmetic unit 20 corresponds to a triangle generation device. The array vertices[] corresponds to a vertex coordinate group. The value of the first term in equation (2) corresponds to the main division number, and the value of the first term in equation (10) corresponds to the sub-division number. The first major line corresponds to the first side, the second major line corresponds to the second side, and the third major line corresponds to the third side. The point on the first major line corresponds to the main division point, and the point on the minor line corresponds to the sub-division point. maj_div_idx corresponds to the main division point identification number, and min_div_idx corresponds to the sub-division point identification number. maj_div_offset corresponds to the displacement amount of the main division point identification number, and min_div_offset corresponds to the displacement amount of the sub-division point identification number.
[0222] S1 corresponds to the process as an acquisition unit, S2 corresponds to the process as a triangle division unit, and S11 corresponds to the process as a pre-shaping unit. S120 corresponds to the process as an object determination unit, S150 corresponds to the process as a pre-shaping execution unit, and S155 corresponds to the process as an addition unit. S21 and S240 correspond to the process as a main division number setting unit, S22 and S350 correspond to the process as a sub-division number setting unit, and S23 corresponds to the process as an execution unit. S330 corresponds to the process as a main identification setting unit, and S545 corresponds to the process as a sub-identification setting unit.
[0223] [2. Second Embodiment] [2-1. Configuration] The second embodiment of the present disclosure will be described below with reference to the drawings. In the second embodiment, the parts different from the first embodiment will be described. The same reference numerals are given to the common configurations.
[0224] The arithmetic unit 20 of the second embodiment is different from the first embodiment in that it includes a GPU 22 and executes various processes in parallel using the GPU 22. For example, the GPU 22 as the arithmetic unit 20 may execute pre-shaping in S11 and multi-stage division in S12.
[0225] For example, in the pre-shaping executed at S11, the GPU 22 may execute in parallel, by parallel processing, the processes repeatedly executed for each basic triangle specified by the value stored in idx.
[0226] Specifically, since S105 to S130 shown in FIG. 4 are repetitive processes for each idx, the GPU 22 may provide a thread for each idx in S105 to S130 and execute the processes of S105 to S120 in parallel in each thread. Also, since S140 to S165 are repetitive processes for each idx, the GPU 22 may provide a thread for each idx in S140 to S165 and execute the processes of S140 to S155 in parallel in each thread. Also, since S170 to S185 are repetitive processes for each idx, the GPU 22 may provide a thread for each idx in S170 to S185 and execute the processes of S170 to S175 in parallel in each thread.
[0227] Also, for example, in the multi-stage division executed at S12, the GPU 22 may execute in parallel, by parallel processing, the processes repeatedly executed for each basic triangle specified by the value stored in idx, or the processes repeatedly executed for each point on the first major line specified by the value stored in idx.
[0228] Specifically, since S200 to S260 shown in FIG. 15 are repetitive processes for each idx, the GPU 22 may provide a thread for each idx in S200 to S260 and execute the processes of S200 to S240 in parallel in each thread. Also, since S300 to S380 shown in FIG. 16 are repetitive processes for each idx, the GPU 22 may provide a thread for each idx in S300 to S380 and execute the processes of S300 to S360 in parallel in each thread. Also, since S500 to S570 shown in FIG. 18 are repetitive processes for each idx, the GPU 22 may provide a thread for each idx in S500 to S570 and execute the processes of S500 to S560 in parallel in each thread.
[0229] [2-2. Effect] (2a) In such an arithmetic unit 20, in pre-shaping, for each basic triangle in parallel, the vertex coordinates are sorted in descending order to determine whether it is the target triangle, so that the processing speed of pre-shaping and thus triangle division can be improved.
[0230] Also, in such an arithmetic unit 20, in multi-stage division, for each basic triangle in parallel, the first major line points are set, so that the processing speed of multi-stage division and thus triangle division can be improved. Also, in such an arithmetic unit 20, in multi-stage division, for each first major line point in parallel, the coordinates of the vertices of the sub-divided triangles are calculated, so that the processing speed of multi-stage division and thus triangle division can be improved.
[0231] In the second embodiment, the GPU 22 corresponds to the triangle processing unit. Note that instead of the GPU 22, a CPU 21 capable of executing parallel processing may execute the above parallel processing. In this case, the CPU 21 capable of executing parallel processing corresponds to the triangle generation device.
[0232] [2. Third Embodiment] [3-1. Configuration] The third embodiment of the present disclosure will be described below with reference to the drawings. Note that in the third embodiment, the parts different from the second embodiment will be described. The same reference numerals are given to the common configurations.
[0233] In the above-described second embodiment, for example, in the process of calculating the cumulative sums such as S135, S270, and S390, a form in which parallel processing by the GPU 22 is not executed was shown. However, the GPU 22 may execute parallel processing also in the process of calculating the cumulative sum, for example, by executing the cumulative sum parallel processing described later.
[0234] [3-2. Processing] The cumulative sum parallel processing will be described based on the flowchart shown in FIG. 30. [Explanation of Array] In this process, the array input[idx] is used as the input array. The array input[idx] is an array in which the values for which the cumulative sum is to be calculated are stored.
[0235] When the cumulative sum parallel processing ends, the cumulative sum of the array input[idx] is stored in the array input[idx]. For example, for the arrays input[0] to input[S-1], when calculating S cumulative sums, when the cumulative sum parallel processing ends, the element input[0] of the array specified by idx = 0 is stored in the array input[0]. In the array input[1], the sum of the element input[0] of the array specified by idx = 0 and the element input[1] of the array specified by idx = 1 is stored. And in the array input[S-1], the total sum of each of the elements input[0] to input[S-1] of the array is stored.
[0236] <Process> First, in S600, the GPU22 acquires an array input[idx] with the number of elements being S. The range of idx is 0 ≦ idx ≦ S-1.
[0237] Next, in S610, the GPU22 stores 1 in the variable stride. In the subsequent S620, the GPU22 stores 0 in idx. Next, in S630, the GPU22 determines whether idx - stride ≧ 0. Here, if idx - stride < 0, the GPU22 transfers the process to S650. On the other hand, if idx - stride ≧ 0, the GPU22 transfers the process to S640.
[0238] In S640, the sum of the element input[idx] of the array and the element input[idx - stride] of the array is stored as the element input[idx] of a new array. In S650, the GPU22 increments idx. That is, the GPU22 stores in idx the value obtained by adding 1 to the value stored in idx.
[0239] In S670, GPU22 determines whether the value stored in idx is greater than or equal to S. Here, if it is determined that the value is greater than or equal to S, GPU22 transfers the process to S670. On the other hand, if it is determined that the value is less than S, GPU22 transfers the process to S630 and repeats the processes of S630 to S660.
[0240] In S670, store stride * 2 as the value of the new stride. In S680, increment stride. That is, GPU22 stores the value obtained by adding 1 to the value stored in stride into stride.
[0241] In S690, GPU22 determines whether the value stored in stride is greater than or equal to S. Here, if it is determined that the value is less than S, GPU22 transfers the process to S620 and repeats the processes of S620 to S690. On the other hand, if the arithmetic unit 20 determines that the value is greater than or equal to S, the cumulative sum parallel processing ends here.
[0242] <Operation> By executing the cumulative sum parallel processing, as shown in FIG. 31, the sum of each of the elements input[0] to input[S - 1] of the array is stored in the array input[S - 1].
[0243] For example, at S135, the above-mentioned array input[] may be replaced with the array flag[]. By executing the above-mentioned cumulative sum parallel processing, the sum of the elements flag[idx] of the array (i.e., the cumulative sum) is stored in the element flag[L - 1] of the array.
[0244] Also, for example, at S270, the above-mentioned array input[] may be replaced with the array maj_vert_num[]. By executing the above-mentioned cumulative sum parallel processing, the cumulative sum Q is stored in the element maj_vert_num[P - 1] of the array.
[0245] For example, in S390, the above-mentioned array input[] may be replaced with the array prim_num_per_edge[]. By executing the above-mentioned cumulative sum parallel processing, the cumulative sum R is stored in the element maj_vert_num[Q - 1] of the array.
[0246] [3 - 3. Effect] In this way, the arithmetic unit 20 can further improve the processing speed by executing parallel processing for each idx even in the case of the cumulative sum. Further, since the arithmetic unit 20 can set a thread for each point on the first major line and execute triangle division in parallel for each point on the first major line, the processing speed can be further improved.
[0247] In the third embodiment, the GPU 22 corresponds to the triangle processing device. Note that instead of the GPU 22, the CPU 21 capable of executing parallel processing may execute the above-mentioned parallel processing. In this case, the CPU 21 capable of executing parallel processing corresponds to the triangle generation device.
[0248] [4. Other Embodiments] As described above, the embodiments of the present disclosure have been described. However, the present disclosure is not limited to the above-described embodiments and can be implemented with various modifications.
[0249] (4a) In the above-described embodiment, a form is shown in which when the maximum interior angle in the basic triangle is less than a predetermined angle (for example, 120°), it is determined to be the target triangle. However, in the basic triangle, when the ratio of the lengths of the remaining sides to the length of one side is within a predetermined range, it may be determined to be the target triangle. For example, h1 ≦ ratio of lengths ≦ h2 (for example, h1 < 1, h2 ≧ 1) may be satisfied. The range in which the ratio of lengths can be taken is not limited to this and may be arbitrarily set.
[0250] (4b) In the above-described embodiment, the arithmetic unit 20 generates combination information and generates sub-divided triangles based on the generated combination information (i.e., acquires the generated combination information). However, the arithmetic unit 20 may store the combination information in the memory in advance as a table and generate sub-divided triangles based on the combination information stored in the memory. Thereby, the processing load on the arithmetic unit 20 can be reduced.
[0251] (4c) In the above-described embodiment, the main division point identification number is the base point A that is the vertex of the basic triangle and connects the first major line and the second major line. B It has been shown in the form set in order from. However, the main division point identification number may be set with either of the two end points of the first major line as 0. For example, the main division point identification number may be set in order as 0, 1, 2,... from the right vertex A R which is the vertex of the basic triangle and the intersection point of the first major line and the second major line, toward the base point A B . In this case, in the minor line pair, the main division point identification number +1 of the point on the reference minor line becomes the main division point identification number of the point on the adjacent minor line. In this case, for example, when tess_prim_idx[idx] is an even number, (0, +1, 0) may be calculated as the displacement amount of the main division point identification number. Also, for example, when tess_prim_idx[idx] is an odd number, (+1, 0, +1) may be calculated as the displacement amount of the main division point identification number.
[0252] (4d) In the above-described embodiment, the sub-division point identification number is shown in the form set in order from the first major line side in the basic triangle. However, the sub-division point identification number may be set with either of the two end points of the minor line as 0. For example, the sub-division point identification number may be set in order as 0, 1, 2,... from the second major line side as the starting point toward the first major line side. In this case, the same displacement amount as in the above-described embodiment may be used as the displacement amount of the sub-division point identification number.
[0253] (4e) In the above-described embodiment, the arithmetic unit 20 is shown in a form that executes both pre-shaping and multi-stage division in the triangle division process. However, the arithmetic unit 20 may execute only multi-stage division in the triangle division process.
[0254] (4f) In the above-described embodiment, in the basic triangle, the first major line is the opposite side of the interior angle having the largest angle, the second major line is the opposite side of the interior angle having the second largest angle after the largest angle, and the third major line is the opposite side of the interior angle having the smallest angle. However, for example, the first major line may be the opposite side of the interior angle having the second largest angle after the largest angle, the second major line may be the opposite side of the interior angle having the largest angle, and the third major line may be the opposite side of the interior angle having the smallest angle.
[0255] (4g) The arithmetic unit 20 and its method described in the present disclosure may be realized by a dedicated computer configured by a processor and a memory programmed to execute one or more functions embodied by a computer program. Alternatively, the arithmetic unit 20 and its method described in the present disclosure may be realized by a dedicated computer provided by configuring a processor with one or more dedicated hardware logic circuits. Or, the arithmetic unit 20 and its method described in the present disclosure may be realized by one or more dedicated computers configured by a combination of a processor and a memory programmed to execute one or more functions and a processor configured by one or more hardware logic circuits. Also, the computer program may be stored in a computer-readable non-transitory tangible recording medium as instructions to be executed by a computer. The method for realizing the functions of each part included in the arithmetic unit 20 does not necessarily have to include software, and all of its functions may be realized using one or more hardware.
[0256] (4h)In the above-described embodiment, a plurality of functions of one component may be realized by a plurality of components, or one function of one component may be realized by a plurality of components. Also, a plurality of functions of a plurality of components may be realized by one component, or one function realized by a plurality of components may be realized by one component. Further, a part of the configuration of the above-described embodiment may be omitted. Also, at least a part of the configuration of the above-described embodiment may be added to or replaced with the configuration of another of the above-described embodiments.
[0257] (4i)In addition to the arithmetic unit 20 described above, the present disclosure can also be realized in various forms such as a device or system having the arithmetic unit 20 as a component, a program for operating the arithmetic unit 20, a non-transitory tangible recording medium such as a semiconductor memory storing this program, a triangle generation method, etc. The device having the arithmetic unit 20 as a component may include, for example, a radar simulator.
[0258] [Technical idea disclosed in this specification] [Item 1] A triangle generation device, an acquisition unit (S1) configured to acquire a vertex coordinate group including the coordinates of each vertex for one or a plurality of basic triangles; a triangle division unit (S2) configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles; comprising the triangle division unit a main division number setting unit (S21, S240) configured to set a main division number (M) when equally dividing a first side based on a predetermined division length; a sub-division number setting unit (S22, S350) configured to set a sub-division number (N) when equally dividing a set minor line for each of a plurality of main division points set on the first side based on the division length; for each of the main division points, for each set pair of minor lines, the minor line The region of the basic triangle sandwiched between the ins is defined as one or more triangles that divide the region without overlap, with the sub-division points on two minor lines belonging to the minor line pair as vertices, and the information specifying how the combinations of the sub-division points belonging to each sub-divided triangle are combined is defined as combination information. The execution unit (S23) is configured to calculate the coordinates of the vertices of the sub-divided triangles for each minor line pair set for each of the main division points using the vertex coordinate group, the main division number, and the combination information. has The main division points are a plurality (M + 1) of points including both end points of the first side and located at positions that equally divide the first side by the main division number. The minor line is a line segment that passes through the main division points, extends from the first side to the second side, and follows the third side. The sub-division points are a plurality (N + 1) of points including both end points of the minor line and equally dividing the minor line by the sub-division number. The minor line pair is a combination of any two adjacent minor lines in the minor line. Triangle generation device (20). [Item 2] The triangle generation device according to Item 1, wherein In the basic triangle, the first side is the side opposite the interior angle with the largest angle, the second side is the side opposite the interior angle with the second largest angle after the largest angle, and the third side is the side opposite the interior angle with the smallest angle. [Item 3] The triangle generation device according to Item 1 or Item 2, wherein When specifying the sub-division points belonging to one sub-divided triangle, for each minor line pair set for each of the main division points, the sub-division points on the minor line set for each of the main division points and the sub-division points on the adjacent minor line are alternately specified. Triangle generation device. [Item 4] The triangle generation device according to Item 3, wherein A main division point identification setting unit (S330) configured to set a main division point identification number for identifying each of the main division points; A sub-division point identification setting unit (S545) configured to set a sub-division point identification number for identifying each of the sub-division points; further comprising: each of the sub-division points is specified by the main division point identification number and the sub-division point identification number; the combination information specifies the combination method of the sub-division points belonging to the finely divided triangle based on the main division point identification number and the sub-division Point identification number; A triangle generation device. [Item 5] The triangle generation device according to any one of Items 1 to 4, wherein the execution unit calculates the coordinates of the vertices of the finely divided triangle in parallel for each of the main division points. A triangle generation device. [Item 6] The triangle generation device according to any one of Items 1 to 5, wherein the triangle division unit further has a pre-shaping unit (S11), the pre-shaping unit includes an object determination unit (S120) configured to determine, for each of the basic triangles defined by the vertex coordinate group, whether it is an object triangle having a shape with a relatively high degree of coincidence with an equilateral triangle; a pre-shaping execution unit (S150) configured to divide the basic triangles determined not to be the object triangles into a plurality of triangles so as to have a shape with a relatively high degree of coincidence with the equilateral triangle; an addition unit (S155) configured to generate a new vertex coordinate group including the vertex coordinates of the triangles after division; and includes For each of the basic triangles defined by the coordinates of each vertex included in the new vertex coordinate group generated by the pre-shaping unit, the main division number is set by the main division number setting unit, the sub-division number is set by the sub-division number setting unit, and the coordinates of the vertices of a plurality of the finely divided triangles that further divide the area of the basic triangle are calculated by the execution unit. Triangle generation device. [Item 7] The triangle generation device according to Item 6, wherein For each of the basic triangles, the target determination unit determines whether the maximum value of the interior angles is less than the allowable angle. When the maximum value of the interior angles is less than the allowable angle, it is determined that the basic triangle is the target triangle. When the maximum value of the interior angles is greater than or equal to the allowable angle, it is determined that the basic triangle is not the target triangle. Triangle generation device. [Item 8] The triangle generation device according to Item 6 or Item 7, wherein When the pre-shaping execution unit determines that the basic triangle is not the target triangle by the target determination unit, the basic triangle is divided into two by a bisector that bisects the interior angle having the maximum value in the basic triangle. Triangle generation device. [Item 9] For one or a plurality of basic triangles, a vertex coordinate group including the coordinates of each vertex is obtained. A triangle generation method configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of finely divided triangles, wherein The main division number (M) when equally dividing the first side based on a predetermined division length is set. For each of the plurality of main division points set on the first side, the sub-division number (N) when equally dividing the set minor line based on the division length is set. For each of the main division points, for each set of minor lines to be set, the region of the basic triangle sandwiched between the set of minor lines is divided into one or more triangles that do not overlap with each other, with the secondary division points on the two minor lines belonging to the set of minor lines as vertices, and the triangles are defined as the finely divided triangles. Information specifying the combination method of the secondary division points belonging to each finely divided triangle is defined as combination information, and the combination information is obtained. Using the vertex coordinate group, the main division number, and the combination information, for each set of minor lines set for each of the main division points, the coordinates of the vertices of the finely divided triangles are calculated. The main division points are a plurality (M + 1) of points including both end points of the first side and located at positions that equally divide the first side by the main division number. The minor line is a line segment that passes through the main division point, extends from the first side to the second side, and follows the third side. The secondary division points are a plurality (N + 1) of points including both end points of the minor line and equally dividing the minor line by the secondary division number. The set of minor lines is a combination of any two adjacent minor lines in the minor line. Triangle generation method. [Item 10] A triangle generation program that causes a computer to function as a triangle generation device, An acquisition step (S1) configured to acquire a vertex coordinate group including the coordinates of each vertex for one or more basic triangles; A triangle division step (S2, S12) configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of finely divided triangles. The triangle division step includes: A main division number setting step (S21, S240) configured to set the main division number (M) when equally dividing the first side based on a predetermined division length; For each of a plurality of main division points set on the first side, a sub-division number setting step (S22, S350) configured to set a sub-division number (N) when equally dividing a set minor line based on the division length. For each of the main division points, for each set minor line pair, the area of the basic triangle sandwiched by the minor line pair is divided into one or more triangles with sub-division points on two minor lines belonging to the minor line pair as vertices without overlapping each other. The sub-division triangles are defined as such, and information specifying the combination method of the sub-division points belonging to each sub-division triangle is used as combination information. The combination information is obtained, and using the vertex coordinate group, the main division number, and the combination information, for each minor line pair set for each of the main division points, the coordinates of the vertices of the sub-division triangles are calculated. An execution step (S23) configured as such. having The main division points include both end points of the first side and are a plurality (M + 1) of points at positions where the first side is equally divided by the main division number. The minor line is a line segment passing through the main division point, reaching from the first side to the second side, and along the third side. The sub-division points include both end points of the minor line and are a plurality (N + 1) of points at positions where the minor line is equally divided by the sub-division number. The minor line pair is a combination of any two adjacent minor lines in the minor line. Triangle generation program.
Explanation of symbols
[0259] 20... arithmetic unit, 21... CPU, 22... GPU.
Claims
1. A triangle generation device, an acquisition unit (S1) configured to acquire a vertex coordinate group including the coordinates of each vertex for one or more basic triangles; a triangle division unit (S2) configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles; comprising the triangle division unit a main division number setting unit (S21, S240) configured to set a main division number (M) when equally dividing a first side based on a predetermined division length; for each of a plurality of main division points set on the first side, a sub-division number setting unit (S22, S350) configured to set a sub-division number (N) when equally dividing a set minor line based on the division length; for each of the main division points, for each set pair of minor lines, regarding the region of the basic triangle sandwiched by the pair of minor lines, using two sub-division points on the two minor lines belonging to the pair of minor lines as vertices, one or more non-overlapping triangles obtained by dividing the region into triangles are used as the subdivided triangles, information specifying the combination method of the sub-division points belonging to each subdivided triangle is used as combination information, and using the vertex coordinate group, the main division number, and the combination information, for each pair of minor lines set for each of the main division points, the coordinates of the vertices of the subdivided triangles are calculated by an execution unit (S23); having the main division points include both end points of the first side and are a plurality (M + 1) of points located at positions where the first side is equally divided by the main division number; the minor line is a line segment passing through the main division point, extending from the first side to the second side and along the third side; the sub-division points include both end points of the minor line and are a plurality (N + 1) of points located at positions where the minor line is equally divided by the sub-division number; The minor line pair is a combination of any two adjacent minor lines in the minor line. Triangle generation device (20).
2. The triangle generation device according to claim 1, In the basic triangle, the first side is the side opposite the interior angle having the largest angle, the second side is the side opposite the interior angle having the second largest angle after the largest angle, and the third side is the side opposite the interior angle having the smallest angle. Triangle generation device.
3. The triangle generation device according to claim 1 or claim 2, When specifying the sub-division points belonging to one of the sub-divided triangles, for each minor line pair set for each of the main division points, the sub-division points on the minor line set for each of the main division points and the sub-division points on the adjacent minor line are alternately specified. Triangle generation device.
4. The triangle generation device according to claim 1 or claim 2, A main division point identification setting unit (S330) configured to set a main division point identification number for identifying each main division point for each of the main division points; A sub-division point identification setting unit (S545) configured to set a sub-division point identification number for identifying each sub-division point for each of the sub-division points; Further comprising Each of the sub-division points is specified by the main division point identification number and the sub-division point identification number. The combination information specifies the combination method of the sub-division points belonging to the sub-divided triangle based on the main division point identification number and the sub-division point identification number. Triangle generation device.
5. The triangle generation device according to claim 1, The execution unit calculates the coordinates of the vertices of the sub-divided triangle in parallel for each main division point. Triangle generation device.
6. The triangle generation device according to claim 1, wherein the triangle division unit further has a pre-shaping unit (S11), and the pre-shaping unit includes a target determination unit (S120) configured to determine, for each of the basic triangles defined by the vertex coordinate group, whether the target triangle has a shape with a relatively large degree of coincidence with an equilateral triangle; a pre-shaping execution unit (S150) configured to divide the basic triangles determined not to be the target triangles into a plurality of triangles so as to have a shape with a relatively large degree of coincidence with the equilateral triangle; an additional unit (S155) configured to generate a new vertex coordinate group including the vertex coordinates of the triangles after division; and for each of the basic triangles defined by the coordinates of each vertex included in the new vertex coordinate group generated by the pre-shaping unit, the main division number is set by the main division number setting unit, the sub-division number is set by the sub-division number setting unit, and the coordinates of the vertices of a plurality of the finely divided triangles for further dividing the area of the basic triangle are calculated by the execution unit; Triangle generation device.
7. The triangle generation device according to claim 6, wherein the target determination unit determines, for each of the basic triangles, whether the maximum value of the interior angles is less than the allowable angle, determines that the basic triangle is the target triangle when the maximum value of the interior angles is less than the allowable angle, and determines that the basic triangle is not the target triangle when the maximum value of the interior angles is greater than or equal to the allowable angle Triangle generation device.
8. The triangle generation device according to claim 6 or claim 7, When the pre-shaping execution unit determines that the basic triangle is not the target triangle by the target determination unit, the basic triangle is divided into two by a bisector that bisects the interior angle having the maximum value in the basic triangle. Triangle generation device.
9. For one or more basic triangles, obtain a vertex coordinate group including the coordinates of each vertex. A triangle generation method configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles, Set the main division number (M) when equally dividing the first side based on a predetermined division length. For each of the plurality of main division points set on the first side, set the sub-division number (N) when equally dividing the set minor line based on the division length. For each of the main division points, for each set pair of minor lines, the region of the basic triangle sandwiched by the pair of minor lines is divided into one or more triangles that do not overlap with each other, with the sub-division points on the two minor lines belonging to the pair of minor lines as vertices, and the combination information specifying the combination method of the sub-division points belonging to each subdivided triangle is used as the combination information. Using the vertex coordinate group, the main division number, and the combination information, calculate the coordinates of the vertices of the subdivided triangles for each pair of minor lines set for each of the main division points. The main division points are a plurality (M + 1) of points including both ends of the first side and located at positions where the first side is equally divided by the main division number. The minor line is a line segment that passes through the main division point, extends from the first side to the second side, and along the third side. The sub-division points are a plurality (N + 1) of points including both ends of the minor line and equally dividing the minor line by the sub-division number. The pair of minor lines is a combination of any two adjacent minor lines in the minor line. Triangle generation method.
10. A triangle generation program that causes a computer to function as a triangle generation device, An acquisition step (S1) configured to acquire a vertex coordinate group including the coordinates of each vertex for one or more basic triangles; A triangle division step (S2, S12) configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles, and comprising: The triangle division step includes: A main division number setting step (S21, S240) configured to set a main division number (M) when equally dividing a first side based on a predetermined division length; A sub-division number setting step (S22, S350) configured to set a sub-division number (N) when equally dividing a plurality of minor lines set on the first side based on the division length for each of the plurality of minor lines; For each of the main division points, for each set of minor lines, the area of the basic triangle sandwiched between the set of minor lines is divided into one or more triangles that do not overlap with each other with the sub-division points on the two minor lines belonging to the set of minor lines as vertices, and the combination information specifying how the combinations of the sub-division points belonging to each subdivided triangle are used as combination information, and the combination information is obtained. Using the vertex coordinate group, the main division number, and the combination information, for each set of minor lines set for each of the main division points, the coordinates of the vertices of the subdivided triangles are calculated Execution step (S23) configured to: having, The main division points include both ends of the first side and are a plurality (M + 1) of points located at positions where the first side is equally divided by the main division number; The minor line is a line segment passing through the main division point, extending from the first side to the second side, and along the third side; The sub-division points include both ends of the minor line and are a plurality (N + 1) of points where the minor line is equally divided by the sub-division number; The minor line pair is, in the minor line, any combination of two adjacent minor lines. Triangle generation program.
Citation Information
Patent Citations
Smooth free deformation algorithm for quick segmentation of triangle
CN106960469A
Three-dimensional geological analysis prediction model construction method
CN112562078A
Tessellation method using displacement factors
US10832473B2
Accelerated ray tracing using shallow bounding volume hierarchies
US20100053162A1