Abstract:
A processing method for rendering a planar arrow object into a 3-dimensional arrow object. The processing method of this invention comprises the steps as follows: setting a total length of an arrow object, wherein the arrow object includes at least one end having the arrowhead portion; determining the arrowhead portion and the line portion of the arrow object; creating a corresponding first mapping data of the line portion, wherein the first mapping data represents the third axis data associated with the pixels of the line portion; extracting a corresponding arrowhead graphical data of the arrowhead portion; creating a corresponding second mapping data of the graphical data of the arrowhead portion, wherein the second mapping data represents the third axis data corresponding to the pixels of the graphical data of the arrowhead portion; creating the respectively corresponding masks of the line portion and the arrowhead portion; superimposing the arrowhead mask and the line mask so as to create an arrow object mask; and creating a 3-dimensional image of the arrow object according to the first mapping data and the second mapping data and utilizing the arrow object mask.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to a computer graphics method, and particularly to a rendering method for rendering an arrow object to a 3-dimensional visual effect. 
     2. Description of the Related Art 
     In the prior art, a 3-dimensional image processing effect on an object, i.e. a solid effect, is typically achieved by a polygonal approach. The polygonal approach can be summarized by the following steps: determine a certain shape 2-dimensional picture, cut the picture into a plurality of polygons using a computer, then change pixel color values in each polygon by interpolation, thereby achieving a solid effect. However, because the shape of a 2-dimensional picture is formed with continuous curve, the operation of display a 2-D graph as a 3-D graph is performed by a high-order polynomial equations and an approach method. This requires the use of complicated computation and results in a rough visual effect. Alternatively, if a 3-dimensional object is directly processed for a 3-dimensional image display, a great amount of computation is required and the resulting display can be rough in quality. 
     Further, the conventional 3-dimensional process has difficulty dealing with specifically 3-dimensional visual effect, for example, rendering a 2D arrow object graphical display from 3-dimensional arrow object image data stored in memory. An arrow object has an arrowhead and a line. Typically, the line portion of an arrow object is rendered using a real 3D pipe object. Because the image data converted from the 3D pipe object is stored in the 3D form but the image data on display is need in the 2D form, further processes using the stored 3D image data are complicated. For example, it is difficult to combine a 3D pipe object with a 3D arrowhead object to form a 3D arrow object graph due to the connection of anti-aliasing boundaries from the 3D-to-2D conversion data. 
     A processing method for rendering a 3-dimensional image effect based on a 2-dimensional image object has been disclosed in U.S. Pat. No. 5,828,380. This processing method finds the corresponding relation mapping function of each pixel of a picture to obtain a pixel vector mapping relation corresponding to a 2-dimensional image object. The pixel vector mapping relation is further used to create an image effect on relation map, thereby creating the 3-dimensional effect. For example, by creating the corresponding length of the third axis (i.e. z-axis), a substantially solid effect is achieved. 
     FIG. 1 is a schematic diagram illustrating a mapping function relative to a certain picture in the prior art. As shown in FIG. 1, a 2-dimensional picture object is a circular area between an outer ring  40  and an internal ring  41 . The 2-dimensional picture object, i.e., the circular area, comprises multiple pixels (in a grid arrangement), for example, A 1 , A 2 , and A 3  in FIG.  1 . The corresponding relation mapping function defines a vector to each pixel, the vector representing the relation of the pixel and the closest vector of the picture object edge, for example, V 1 , V 2 , V 3  of FIG.  1 . 
     The image effect on relation map is the function of performing the 2D to 3-D conversion. A threshold length (hereinafter denoted by r 1 ) is defined in the image effect on relation map to represent a pixel applied to the 2-D to 3-D transform only if the length from the pixel to the edge of the picture object is within the threshold length. Each pixel within the threshold length is determined by a predetermined contour (to describe the z-axis corresponding to each pixel) to present the substantially solid effect. 
     The image processing method in the U.S. Pat. No. 5,828,380 discloses a simple operation to quickly achieve the 3-D display effect. However, the U.S. Pat. No. 5,828,380 does not teach us how to join two objects for displaying on a screen. More importantly, using the vector in the 2-D picture object, the solid arrow object picture difficult to achieve in the prior art can be easily rendered. 
     SUMMARY OF THE INVENTION 
     Accordingly, the primary object of the invention is to provide a processing method for rendering a 3-dimensional display. The processing method can utilize a simple operation to quickly achieve a 3-dimensional display. Further, the processing method can add various additional graphical processes, e.g., converting a line into a dashline, into the 3D display. 
     To realize the above and other objects, the invention provides a processing method for rendering a planar arrow object into a 3-dimensional arrow object, the method comprising the steps as follows: setting a total length of an arrow object, wherein the arrow object includes at least one end having the arrowhead portion; determining the arrowhead portion and the line portion of the arrow object; creating a corresponding first mapping data of the line portion, wherein the first mapping data represents the third axis data associated with the pixels of the line portion; extracting a corresponding arrowhead graphical data of the arrowhead portion; creating a corresponding second mapping data of the graphical data of the arrowhead portion, wherein the second mapping data represents the third axis data corresponding to the pixels of the graphical data of the arrowhead portion; creating the respectively corresponding masks of the line portion and the arrowhead portion; superimposing the arrowhead mask and the line mask so as to create an arrow object mask; and creating a 3-dimensional image of the arrow object according to the first mapping data and the second mapping data and utilizing the arrow object mask. 
     In a second embodiment, other graphical processes to the arrow object can be included when rendering the solid arrow object. For example, the line portion of the arrow object can be converted into a dashline form. The method of the dashline conversion is proceeded as follows: creating a dashline mask based on the line portion, superimposing the line mask and the arrowhead mask, subtracting the dashline mask from the superimposed mask to create an arrow object, and creating a 3-dimensional image of the arrow object. After the processing, the line portion of the arrow object is present in a dashline form. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The aforementioned objects, features and advantages of this invention will become apparent by referring to the following detailed description of a preferred embodiment with reference to the accompanying drawings, wherein: 
     FIG. 1 is a schematic diagram illustrating the relation mapping function of a graph in the prior art; 
     FIG. 2 is a flowchart illustrating the processing method for rendering the solid arrow object according to a first embodiment of the invention; 
     FIG. 3 is a schematic diagram illustrating an arrow object of the first embodiment of the invention; 
     FIG. 4 is a schematic diagram illustrating an arrowhead portion of the first embodiment of the invention; 
     FIGS. 5 a - 5   c  are schematic diagrams illustrating the different contour curves of the bevel; 
     FIG. 6 is a flowchart illustrating the processing method for rendering the solid arrow object according to a second embodiment of the invention; 
     FIG. 7 is a schematic diagram illustrating a dashline mask of the second embodiment of the invention; and 
     FIG. 8 is a schematic diagram illustrating an arrow object with a dotted line of the second embodiment of the invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     This invention provides a processing method for rendering a solid arrow object. The processing method processes a 2-dimensional graph using directional vector mapping to determine an arrowhead portion and a line portion of the arrow object. The method of this invention is quick and effective. 
     FIRST EMBODIMENT 
     Referring to FIG. 2, a flowchart illustrates a processing method for rendering a solid arrow object according to a first embodiment of the invention. Referring FIG. 3, a schematic diagram illustrates an arrow object, the arrow object including an arrowhead portion  20  and a line portion  30 , wherein the length of the arrow object is from point  10  to point  12 . FIG. 4, a schematic diagram illustrates an arrowhead portion  20 , wherein d 1  is the width of the stem of the arrowhead, d 2  is the length of the stem of the arrowhead, and d 3  is a portion of length of the arrowhead. 
     In this embodiment, the arrowhead is created by performing processes (for example, enlarging, shrinking, rotating) for a predetermined arrowhead graph for a graphical database or for an arrowhead prototype. In the processing of the arrowhead prototype, the end of the stem (i.e., the edge d 1 ) is determined. The arrowhead prototype stored in the graphical database is typically stored in the polygon form, i.e., the coordinate value of each terminal is stored without any rotating angle (that is, the arrowhead is directed to the x axis). The change of the x coordinate value between two adjacent terminals and the x value can determine the end of the stem. If no change happens and the x value is the maximum, the two adjacent terminals are the end of the stem. Therefore, the enlarging, shrinking, and rotating processes are performed based on the determined end of the stem. Further, the end position of the stem&#39;s width can be directly specified in the data structure of the arrowhead prototype of the graphical database so that the end of the stem is determined without an additional calculation. However, the data structure in such a process becomes more complicated. 
     For an arrowhead graphical prototype, the graphical parameters have a certain proportion, for example, d 1 :d 2 :d 3 =2:1:4. Therefore, if a user desires an arrowhead size other than that in the graphical database, the desired arrowhead is created by enlarging or shrinking the arrowhead graphical prototype based on the width d 1  of the stem of the desired arrowhead. This is because the length d 2  of the stem and the length d 3  of the arrowhead  20  are determined in proportion to d 1 . Further, an actual arrowhead portion typically appears with a certain rotating angle, while the arrowhead graphical prototypes are stored without any rotating angle. Therefore, a rotating is performed on the prototype is performed to obtain the desired arrowhead. The enlarging, shrinking, and rotating processes are well known to a person skilled in the art. 
     Return to the flowchart for rendering the solid arrow object as shown in FIG.  2 . First, set a total length l for the arrow object and determine if an arrowhead portion exists on either end of the arrow object. If yes, determine the corresponding arrowhead type (s 10 ). In this embodiment, assume that only one arrowhead is located on the end  10  of the arrow object. The arrowhead type indicates the predetermined different arrowhead graph in the graphical database. Then, the length d 3  of the arrowhead portion  20  is determined based on the width d 1  of the arrowhead portion  20  and the arrowhead type (as shown in FIG.  4 ). Because an entire arrow object comprises an arrowhead portion  20  and a line portion  30 , the line portion  30  is obtained by subtracting the length d 3  of the arrowhead portion  20  from the entire length l of the arrow object, i.e., 
     
       
           d   4 = l−d   3   (1). 
       
     
     Therefore, the point  11  on the boundary between the point  10  and the point  12  is determined. The arrowhead portion  20  is between the point  10  and the point  11 , and the line portion  30  is between the point  11  and the point  12  (s 20 ). Finally, the arrowhead  20  and the line portion  30  are processed respectively and connected to be an arrow object. 
     For the line portion  30 , create the directional vector mapping data required by the line portion  30  within a predetermined width of the two laterals of the line portion  30  (s 30 ). The predetermined width is assigned by the user, for example, the dashline portion as shown in FIG.  3 . Assume that the 2-dimensional graphical data of the line portion is O and the directional vector mapping creation function is R(·). Thus, the directional vector mapping data of the line portion  30  is ν 1 =R(o). The directional vector mapping data ν·1 of the line portion  30  capable of representing each corresponding pixel of the third axis (i.e. z axis) is created by the image effect on relation map E(·) to obtain the parameter on the third axis corresponding to each pixel of the line portion. The image effect on relation map E(·) comprises the parameter of a threshold length(r 1 ) and a contour curve for defining the change of each pixel on the third axis (z) within the threshold range starting from the edge. FIGS. 5 a - 5   c  respectively represent three possible contours. FIG. 5 a  is a rounded bevel shape and C 1  represents its contour, FIG. 5 b  is a linear bevel shape and C 2  represents its contour, and FIG. 5 c  is a combinational shape of two rounded bevels and C 3  represents its contour. 
     An explanation is given of the rounded bevel shape of FIG. 5 a.  When the pixel vector (x, y) is within the defined threshold length r 1 , based on the defined contour curve C 1 , the parameter z on the third axis is based on the assumption that the distance from the pixel to the corresponding edge EG of the pixel is L(={square root over (x 2 +y 2 )}). For this point, the pixel vector (x,y) has the parameter on the third axis as follows: 
     
       
           z=L× tan(cos −1 ( rl−L )/ rl ))  (2) 
       
     
     Note that in the step of creating directional vector mapping data, in order to avoid an image defect on the boundary (for example, the point  11  on the boundary of FIG. 3) connecting the arrowhead portion to the line portion, the two ends of the line portion  30  are preferably open boundaries respectively (i.e., the point  11  and the point  12 ). The purpose of the open boundaries is to let the directional vector of the pixels close to the two ends of the line portion be directed to the lateral instead of the points  11  and  12  on their boundaries. This prevents the contour curve from appearing like the image effect on relation map E(·), so that the stem of arrowhead portion  20  and the line portion  30  are completely connected. 
     For the arrowhead portion  20 , at first extract the predetermined arrowhead graph from the graphical database (not shown) assigned by the user, and then enlarge, shrink, and rotate the extracted arrowhead graph based on the width of the stem of the arrowhead portion set by the user. Thereby, an actually used arrowhead graph is obtained (s 40 ). Assuming that the predetermined arrowhead graph is ω, and is subjected to enlarging, shrinking, and rotating, so as to obtain a processed arrowhead graph ω 1 . Using the same method creates a directional vector mapping data ν 2 (s 50 ) of the arrowhead portion  20 , i.e. ν 2 =R(ω 1 ). When the directional vector mapping data ν 2  is created, the boundary of the stem (i.e., the line including the point  11 ) is set as an open boundary, in order to completely connect to the line portion  30 . However, in practice, the boundaries of the line portion  30  and the arrowhead portion  20  can be partially overlapped, thereby avoiding a gap. Preferably, the overlapped width is one pixel. For the overlapped portion, the third axis data from the steps s 30  and s 50   e  is the same (the directional vector point to the lateral of the boundary). 
     The mask α 1  for the line portion and the mask α 2  for the arrowhead portion are created based on the data from the line portion  30  and the arrowhead portion  20 . The masks α 1  and α 2  define the shapes of the line portion  30  and the arrowhead portion  20  in a 2D picture. The mask α 1  is created by applying a 2D space carving function κ(·) to the directional vector mapping function ν 1  of the line portion  30 . The expression is: 
     
       
         α 1 =κ(ν 1 )=κ( R ( O ))  (3) 
       
     
     The mask  2  is created by applying a 2D rendering function φ(·) to a 2D graphical data ω 1  with the enlarged/shrink and rotated processing. The expression is: 
      α 2 =φ(ω 1 )  (4) 
     When the line mask α 1  and the arrowhead mask α 2  are superimposed, the mask for the arrow object is formed, i.e., α=α 1 +α 2 . Therefore, the 3D arrow object is created by combining the directional vector mapping data of the line portion  30  from the step s 30  with the directional vector mapping data of the arrowhead portion  20  from the step s 50 (s 70 ). Assume that the shadow function is S(·), the expression for the 3D arrow object image port of arrow object is: 
     
       
           O=S ( E (ν 1 +ν 2 )), α  (5) 
       
     
     where ν 1  is the directional vector mapping data of the line portion  30  and ν 2  is the directional vector mapping data of the arrowhead portion  20 . 
     As mentioned above, this embodiment utilizes separate 2D graphical processing for the arrowhead and line portions, thereby achieving the object of rendering the 3D arrow object graph. Such a processing method does not require large calculations and can obtain a satisfactory performance. 
     SECOND EMBODIMENT 
     The invention also provides further processing to be applied to the rendered 3D arrow object, for example, to create a dashline on the line portion. 
     Referring to FIG. 6, a flowchart illustrates a processing method for rendering the solid arrow object according to a second embodiment of the invention. 
     In FIG. 6, the processing method for rendering the solid arrow object is the same as that of the first embodiment except for the addition of step s 31  of converting the line portion  30  into a dashline form. In step s 31 , a dashline mask  32  is created based on the defined range of the 2D graphical data of the line portion  30 . Assume that the dashline mask is α 3  and the dash function is D(·), then the expression is: 
     
       
         α 3 = D ( 0 ) 
       
     
     The dashline mask  32  is used to filter partial areas of the line portion  30  as shown in FIG.  7 . FIG. 7 is schematic diagram illustrating the dashline mask of the second embodiment of the invention. In step s 61 , obtain a new line mask  34  after subtracting the dashline mask  32  from the line mask. In step s 70 , the new line mask  34  in conjunction with the arrowhead mask  36  form an arrow object mask as required. The expression is: 
     
       
           M   2 =α 1 +α 2 −α 3   (7) 
       
     
     as shown in FIG.  8 . The created 3D arrow object graph  0 ′ is expressed as follows: 
     
       
           0 ′= S ( E (ν 1 +ν 2 )),  M   2   (8) 
       
     
     where ν 1  is the directional vector mapping data of the line portion  30  and ν 2  is the directional vector mapping data of the arrowhead portion  20 . 
     To summarize, in the invention, additional graphical processes can be added into the process of rendering the solid arrow object, so as to create a variety of graphical presentation effects. 
     Although the present invention has been described in its preferred embodiment, it is not intended to limit the invention to the precise embodiment disclosed herein. Those who are skilled in this technology can still make various alterations and modifications without departing from the scope and spirit of this invention. Therefore, the scope of the present invention shall be defined and protected by the following claims and their equivalents.