This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2014-156677, filed on Jul. 31, 2014, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are related to an 3D-CG processing device, an 3D-CG processing method, and an 3D-CG processing program, for example.
In recent years, with an increasing performance of computers that execute visualization processing, it has become possible to display a visualization object including a large number of three-dimensional polygons. However, in consideration of a long time taken for the processing, techniques for reducing a processing load are being developed. For example, there is provided a method of displaying only an important part of three-dimensional polygons having data volume of as much as gigabytes to terabytes, or a method of simplifying a complicated shape.
However, with a technique of displaying only an important part, processing load is not reduced when the whole body is displayed. Also, with a technique of simplification, polygons are basically integrated and reorganized. Accordingly, it might result in significant deterioration in display precision compared with the original information. Then, simplification processing, and rendering processing are carried out independently, and thus a lot of the processing procedures are involved. As a result, sometimes the processing time becomes long.
Also, in general, a three-dimensional model is often defined using three-dimensional polygons only for the outer shape of the three-dimensional model, and its inner part is often not defined by three-dimensional polygons. However, in the case of performing simulation on a human organ, for example, a heart, or the like, not only three-dimensional polygons for representing an outer shape of the organ, but also three-dimensional polygons for representing an inner structure of the organ are defined. Accordingly, if an attempt is made to simply draw a set of three-dimensional polygons that represent an organ, or the like, processing, such as hidden surface removal, and the like are carried out on a vast number of three-dimensional polygons. For documents on the above-described techniques, for example, Japanese Laid-open Patent Publication No. 2004-46599, and International Publication Pamphlet No. WO 2007/125912 are given.
According to an aspect of the invention, an image processing device includes a processor; and a memory which stores a plurality of instructions, which when executed by the processor, cause the processor to execute: extracting, with a data storage unit configured to store data on a set of three-dimensional polygons disposed in a three-dimensional virtual space, from the three-dimensional polygons stored in the data storage unit, the extracting a three-dimensional polygon disposed on an outer side of the set of three-dimensional polygons; and drawing the extracted three-dimensional polygon.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims. It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
These and/or other aspects and advantages will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawing of which:
First, a description will be given of characteristics of a set of three-dimensional polygons to be handled by embodiments of the present disclosure. In the present embodiment, as illustrated in
An example of a configuration of an image processing device for drawing such an object at a high speed is illustrated in
The first data storage unit 110 stores data of the three-dimensional polygons included in an object to be visualized, for example. The input unit 120 receives, for example input for setting a visual point from a user, and outputs it to the polygon extraction unit 130, and the drawing processing unit 150.
The polygon extraction unit 130 extracts three-dimensional polygons for representing an outer shape of an object to be visualized from a set of three-dimensional polygons stored in the first data storage unit 110 based on the input from the input unit 120, for example, and stores them in the second data storage unit 140.
The drawing processing unit 150 performs drawing processing on a three-dimensional polygon group stored in the second data storage unit 140 based on the input from the input unit 120 to display the object on the display unit 160.
Next, a description will be given of the processing contents of the image processing device 100 using
First, the polygon extraction unit 130 initializes a visual point (
First, the polygon extraction unit 130 sets an initial cutting plane (
Then, the polygon extraction unit 130 extract a three-dimensional polygon group that intersects the cutting plane (step S23). After that, the polygon extraction unit 130 initializes the line on the cutting plane (step S25). For example, the line passing the visual point is rotated about a visual point on the cutting plane, and a point at which the line contacts the three-dimensional polygon group for the first time is identified.
For example, in
However, as schematically illustrated in
Then, the polygon extraction unit 130 extracts a three-dimensional polygon contacting the line on the cutting plane, and the neighboring three-dimensional polygons, and stores the data of the three-dimensional polygons in the second data storage unit 140 (step S27). In the example in
After that, the polygon extraction unit 130 rotates the line about the contact point on the cutting plane, and searches for a contact point at the minimum rotation angle (step S29). In this regard, if there are a plurality of contact points (or intersection points) because of roughness in resolution and in rotation angle, the farthest contact point from the previous contact point ought to be the next center of rotation.
Then, the polygon extraction unit 130 extracts a three-dimensional polygon contacting the line on the cutting plane, and the neighboring three-dimensional polygons, and stores the data of those three-dimensional polygons into the second data storage unit 140 (step S31). In this regard, the data of the three-dimensional polygons that were already stored in the second data storage unit 140 are not redundantly stored.
In the example in
After that, the polygon extraction unit 130 determines whether the line has made a round on the cutting plane or not (step S33).
In the present embodiment, as schematically illustrated in
If the line has not been rotated to make a round on the cutting plane, the processing returns to step S29. On the other hand, if the line has made a round on the cutting plane, the polygon extraction unit 130 determines whether the setting of a cutting plane covering the object to be visualized has been completed or not (step S35).
If the setting of a cutting plane covering the object to be visualized has not been completed, the polygon extraction unit 130 sets a different cutting plane (step S37), and the processing returns to step S23.
On the other hand, if the setting of a cutting plane covering the object to be visualized has been completed, the processing returns to the calling processing.
For example, as schematically illustrated in
On the other hand, even if the cutting plane X is initially set as illustrated in
Returning to the description of the processing in
In the drawing processing, while hidden surface removal is performed using the data of the three-dimensional polygons stored in the second data storage unit 140, projection processing on a projection plane is performed. For example, a polygon disposed at the inner side with reference to the projection plane may be drawn in sequence, or a polygon disposed at the front side with reference to the projection plane may be drawn for each pixel using a Z buffer. Alternatively, the other methods may be used.
Then, if an instruction to change the visual point is given through the input unit 120 (step S7: Yes route), the drawing processing unit 150 sets the visual point in accordance with the instruction from the input unit 120 (step S9), and the processing returns to step S5. On the other hand, when an instruction to change the visual point is not given (step S7: No route), and if an instruction to terminate the processing is given through the input unit 120 (step S11: Yes route), the processing is terminated. Else if an instruction to terminate the processing is not given, (step S11: No route), the processing returns to step S7.
By performing such processing, the three-dimensional polygons to be subjected to the drawing processing are narrowed down out of the objects to be visualized, and thus the processing load of the image processing device 100 is reduced.
For example, it is assumed that there is a situation in which three-dimensional polygons are distributed on a sphere having a radius “r”=30, and one three-dimensional polygon is disposed in a volume 1 inside the sphere. At this time, the total number of polygons are obtained by calculating its volume, and the result is 4πr3/3=about 110 thousand three-dimensional polygons. On the other hand, the surface area is obtained by differentiating the volume, and since 4πr2=about 110 thousand polygons, if the processing like the present embodiment is performed, the number of three-dimensional polygons to be subjected to the drawing processing is reduced. Accordingly, the processing load is reduced.
In this regard, it is thought that three-dimensional polygons located on the surface of an object are extracted by applying a scan line method. That is to say, a projection plane perpendicular to the visual line direction is set, and a perpendicular line is drawn from the projection plane toward the object, and the maximum and the minimum polygon coordinates having intersections are extracted. In
On the other hand, in the present embodiment, as schematically illustrated in
In this regard, the intersection determination between polygons and the line ought to be performed as follows. That is to say, it is assumed that the intersection determination between polygons and the line is carried out by the following procedure. As illustrated in
(1) Determine a starting point P0 and an end point P1 of the line segment.
(2) Obtain the distance d0 between the polygon and the point P0, and the distance d1 between the polygon and the point P1.
(3) A point C obtained by internally dividing the vector P0P1 by the distance ratio d0:d1 becomes the intersection point.
(4) Calculate outer products of the vectors from the vertices of the polygon to the intersection point C, and the sides of the polygon (a total of three by three vertices and three sides), and if their directions match, the intersection point C is in the polygon. That is to say, a determination is made that the line segment intersects the polygon.
In the above, a description has been given of the embodiments of the present disclosure. However, the present disclosure is not limited to these.
For example, the configuration of the functional blocks illustrated in
Further, a plurality of computers may share the above-described processing. Further, the image processing device 100 may be connected to another apparatus through a network, and may obtain data of an object from the other apparatus, and store the data into the first data storage unit 110.
In this regard, the above-described image processing device 100 is a computer. As illustrated in
the memory 2501, but may be stored in the HDD 2505. In the embodiments of the present technique, the application program for performing the above-described processing is stored in the computer-readable removable disk 2511, and is distributed. Then, the application program is installed from the drive unit 2513 to the HDD 2505. The application program is sometimes installed into the HDD 2505 through a network, such as the Internet, or the like, and the communication control unit 2517. Such a computer achieves the above-described various functions by organically cooperating with the hardware, such as the CPU 2503, the memory 2501, and the like, and the programs, such as the OS, the application program, and the like.
The embodiments described above are summarized as follows.
The image processing device according to the present embodiment includes (A) a data storage unit for storing data on a set of three-dimensional polygons disposed in a three-dimensional virtual space, (B) an extraction unit for extracting a three-dimensional polygon that is externally disposed out of the set of three-dimensional polygons from the set of three-dimensional polygons stored in the data storage unit, and (C) a drawing processing unit for performing drawing processing on the three-dimensional polygons extracted by the extraction unit.
In the case of drawing an object including three-dimensional polygons inside in addition to the three-dimensional polygons for expressing an outer shape or a surface, the three-dimensional polygons to be subjected to the drawing processing are narrowed down by the above-described processing so that it becomes possible to reduce the processing load.
In this regard, in the case where the above-described set of three-dimensional polygons includes a three-dimensional polygon having a density equal to or higher than a predetermined density at the inner side rather than the outer side, it becomes more effective.
Also, for each of the plurality of planes cutting a set of three-dimensional polygons, the above-described extraction unit may rotate a line that externally touches a three-dimensional polygon group that intersect the planes so as to extract a three-dimensional polygon externally touching the line, and the neighboring three-dimensional polygons. By performing such processing, it becomes possible to extract three-dimensional polygons that represent an outer shape or a surface with less processing load.
Also, there are cases where the above-described plurality of planes are obtained by rotating an initial plane with a rotation axis passing through the inside of the set of three-dimensional polygons as center. It becomes easy to cover the whole set of three-dimensional polygons.
Further, the above-described plurality of planes may include a first plane, and a plurality of second planes that are perpendicular to the first plane. By such a method, it becomes possible to set a plane that covers the set of three-dimensional polygons.
Further, when the above-described extraction unit detects a contact point with a three-dimensional polygon group by rotating the line, the line may be further rotated with the contact point as center. It is possible to extract three-dimensional polygons with little processing load.
Further, the above-described extraction unit may set an initial contact point based on the minimum value or the maximum value among the coordinate values of the vertices of a three-dimensional polygon group, and may rotate the line passing through the initial contact point with the initial contact point as center. By such a method, it is possible to easily extract a three-dimensional polygon representing an outer shape or a surface.
In this regard, if a visual point is changed, the above-described drawing processing unit may perform the drawing processing (for example, including hidden surface removal, and the like) on the three-dimensional polygons extracted by the extraction unit. By this, the processing load is drastically reduced.
In this regard, it is possible to create a program that causes a processor to perform the above-described processing. The program is stored, for example in a flexible disk, an optical disc, such as a CD-ROM or the like, a magneto-optical disc, a semiconductor memory (for example, a ROM), a computer-readable storage medium, or a storage device, such as a hard disk, and the like. In this regard, the data in the middle of processing is temporarily saved in a storage device, such as a RAM, and the like.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2014-156677 | Jul 2014 | JP | national |