JP6975665B2 - Texture mapping device and texture mapping program - Google Patents
Texture mapping device and texture mapping program Download PDFInfo
- Publication number
- JP6975665B2 JP6975665B2 JP2018046681A JP2018046681A JP6975665B2 JP 6975665 B2 JP6975665 B2 JP 6975665B2 JP 2018046681 A JP2018046681 A JP 2018046681A JP 2018046681 A JP2018046681 A JP 2018046681A JP 6975665 B2 JP6975665 B2 JP 6975665B2
- Authority
- JP
- Japan
- Prior art keywords
- texture
- face
- unit
- pixel
- reconstructed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Image Generation (AREA)
Description
本発明は、テクスチャマッピング装置およびテクスチャマッピング用プログラムに関し、特に、ポリゴンメッシュから成る3Dモデルが有する複数のフェイスにテクスチャを貼り付けるテクスチャマッピングを行う装置およびプログラムに用いて好適なものである。 The present invention relates to a texture mapping device and a texture mapping program, and is particularly suitable for use in a device and program for performing texture mapping in which a texture is attached to a plurality of faces of a 3D model composed of a polygon mesh.
従来、3次元コンピュータグラフィックス(CG)で作成されたポリゴンメッシュ等の3Dモデルの表面にテクスチャ(画像データ)を貼付することにより、3Dモデルに対して所望の色や模様、質感などを付与するようにしたテクスチャマッピングと呼ばれる技術が知られている。 Conventionally, by pasting a texture (image data) on the surface of a 3D model such as a polygon mesh created by 3D computer graphics (CG), a desired color, pattern, texture, etc. is given to the 3D model. A technique called texture mapping is known.
ポリゴンメッシュから成る3Dモデルは、三角形状をした複数のフェイスの集合から構成される。テクスチャは、ポリゴンメッシュの表面を構成する各フェイスに対応するように複数の三角形領域に形成され、各三角形領域のテクチャ画像が各フェイスに対して壁紙のように貼り付けられる。テクスチャの画像データは、格子状に配された画素群で構成され、各画素はRGBα(Rは赤、Gは緑、Bは青、αは色の透明度)の色情報を持つ。以下では、2Dのテクスチャ画像全体を「全体テクチャ」と記述し、それを分割して成る個々の三角形領域(ピース領域)の画像を「テクスチャ」と記述して区別することとする。 A 3D model consisting of a polygon mesh is composed of a set of a plurality of triangular faces. The texture is formed in a plurality of triangular areas corresponding to each face constituting the surface of the polygon mesh, and the texture image of each triangular area is attached to each face like wallpaper. The image data of the texture is composed of a group of pixels arranged in a grid pattern, and each pixel has color information of RGBα (R is red, G is green, B is blue, and α is color transparency). In the following, the entire 2D texture image will be described as "whole texture", and the image of each triangular area (piece area) formed by dividing it will be described as "texture" to distinguish them.
多くの場合、3Dモデル上の位置が3次元のxyz座標(3D座標)で表されるのに対し、全体テクスチャ上の位置は2次元のuv座標(テクスチャ座標)で表される。複数のテクスチャを3Dモデルの各フェイスに貼り付けるためには、3Dモデルの各フェイスが全体テクスチャのどの部分をテクスチャとして使用するかという情報が必要であるが、これはテクスチャ座標で示される。このテクスチャ座標は、正確には画素毎に必要となるが、実際には処理速度確保のためにフェイスの頂点毎に計算され、画素毎の座標は線形補間されることが多い。 In many cases, the position on the 3D model is represented by the three-dimensional xyz coordinates (3D coordinates), while the position on the entire texture is represented by the two-dimensional uv coordinates (texture coordinates). In order to paste multiple textures to each face of the 3D model, information about which part of the entire texture each face of the 3D model uses as the texture is required, which is indicated by the texture coordinates. This texture coordinate is required for each pixel to be exact, but in reality, it is calculated for each vertex of the face in order to secure the processing speed, and the coordinates for each pixel are often linearly interpolated.
ところで、3Dモデルで隣接するフェイスに共通する2頂点に対応するテクスチャのテクスチャ座標値は、常に同一であるとは限らない。このことを、図14を用いて説明する。図14は、隣接する2つのフェイスと、各フェイスに貼られる各テクスチャとの対応関係を模式的に示した図である。このうち、図14(a)は、各フェイスの共通2頂点に対応する各テクスチャのテクスチャ座標値が同一である場合を示している。一方、図14(b)は、各フェイスの共通2頂点に対応する各テクスチャのテクスチャ座標値が異なる場合を示している。 By the way, the texture coordinate values of the textures corresponding to the two vertices common to the adjacent faces in the 3D model are not always the same. This will be described with reference to FIG. FIG. 14 is a diagram schematically showing the correspondence between two adjacent faces and each texture attached to each face. Of these, FIG. 14A shows a case where the texture coordinate values of the textures corresponding to the two common vertices of each face are the same. On the other hand, FIG. 14B shows a case where the texture coordinate values of the textures corresponding to the two common vertices of each face are different.
図14(a1)および(b1)は、3Dモデルで隣接する2つのフェイスFC1,FC2を示している。これら2つのフェイスFC1,FC2に共通する2頂点の3D座標値(x1,y1,z1),(x2,y2,z2)は、何れも2つのフェイスFC1,FC2において共通する値である。 14 (a1) and 14 (b1) show two adjacent faces FC1 and FC2 in a 3D model. The 3D coordinate values (x 1 , y 1 , z 1 ) and (x 2 , y 2 , z 2 ) of the two vertices common to these two faces FC1 and FC2 are all common to the two faces FC1 and FC2. The value.
図14(a2)および(b2)は、2つのフェイスFC1,FC2に貼り付けられる2つのテクスチャTX1,TX2を示している。図14(a2)の場合は、フェイスFC1の2頂点に対応するテクスチャTX1の2頂点のテクスチャ座標値と、フェイスFC2の2頂点(フェイスFC1の2頂点と共通)に対応するテクスチャTX2の2頂点のテクスチャ座標値とが何れも(u1,v1),(u2,v2)であり、3D座標値だけでなくテクスチャ座標値も共通となっている。すなわち、2つの隣接するフェイスFC1,FC2に貼り付けられる2つのテクスチャTX1,TX2も隣接した状態となっている。以下、この状態を「テクスチャが連続」または「連続テクスチャ」という。 14 (a2) and 14 (b2) show two textures TX1 and TX2 attached to the two faces FC1 and FC2. In the case of FIG. 14 (a2), the texture coordinate values of the two vertices of the texture TX1 corresponding to the two vertices of the face FC1 and the two vertices of the texture TX2 corresponding to the two vertices of the face FC2 (common to the two vertices of the face FC1). The texture coordinate values of are (u 1 , v 1 ) and (u 2 , v 2 ), and not only the 3D coordinate values but also the texture coordinate values are common. That is, the two textures TX1 and TX2 attached to the two adjacent faces FC1 and FC2 are also in an adjacent state. Hereinafter, this state is referred to as "texture is continuous" or "continuous texture".
これに対し、図14(b2)の場合は、フェイスFC1の2頂点に対応するテクスチャTX1の2頂点のテクスチャ座標値が(u11,v11),(u21,v21)であり、フェイスFC2の2頂点(フェイスFC1の2頂点と共通)に対応するテクスチャTX2の2頂点のテクスチャ座標値が(u12,v12),(u22,v22)であり、各テクスチャTX1,TX2のテクスチャ座標値が異なっている。すなわち、2つの隣接するフェイスFC1,FC2に貼り付けられる2つのテクスチャTX1,TX2は、隣接した状態となっていない。以下、この状態を「テクスチャが非連続」または「非連続テクスチャ」という。例えば、様々な方向に設置されたカメラで撮影した写真を合成して3Dポリゴンメッシュを作成する場合に、全てのテクスチャが非連続となることがある。 On the other hand, in the case of FIG. 14 (b2), the texture coordinate values of the two vertices of the texture TX1 corresponding to the two vertices of the face FC1 are (u 11 , v 11 ) and (u 21 , v 21 ), and the face. The texture coordinate values of the two vertices of the texture TX2 corresponding to the two vertices of FC2 (common to the two vertices of the face FC1) are (u 12 , v 12 ) and (u 22 , v 22 ), and each texture TX1 and TX2 The texture coordinate values are different. That is, the two textures TX1 and TX2 attached to the two adjacent faces FC1 and FC2 are not in an adjacent state. Hereinafter, this state is referred to as "texture is discontinuous" or "discontinuous texture". For example, when creating a 3D polygon mesh by synthesizing photographs taken by cameras installed in various directions, all textures may be discontinuous.
なお、特許文献1には、複数の立体形状構成要素の集合として表現された3次元立体モデルに対してテクスチャ情報(色彩情報)を付与する場合に、各立体形状構成要素間でのテクスチャ情報の不連続性を抑制しつつ、同時に現実の物体の有するテクスチャ情報により近いテクスチャ情報を各立体形状構成要素に選択的に付与することが開示されている。 In addition, in Patent Document 1, when texture information (color information) is given to a three-dimensional three-dimensional model expressed as a set of a plurality of three-dimensional shape components, the texture information between the three-dimensional shape components is described. It is disclosed that while suppressing discontinuity, texture information closer to the texture information of a real object is selectively added to each three-dimensional shape component.
また、特許文献2には、複数のポリゴンで構成された形状データに基づいて、物体形状を構成するポリゴンを全て展開した展開図を作成し、当該展開図にテクスチャ画像を重ね、移動・回転・スケーリングして所望の状態に合わせ込んだ後、その際に展開図として頂点座標に与えられたテクスチャ座標値をもとに、テクスチャマッピングを施して2次元投影画像を生成することが開示されている。 Further, in Patent Document 2, a developed view in which all the polygons constituting the object shape are expanded is created based on the shape data composed of a plurality of polygons, and the texture image is superimposed on the developed view to move, rotate, and rotate. It is disclosed that after scaling and adjusting to a desired state, texture mapping is performed based on the texture coordinate values given to the vertex coordinates as a developed view to generate a two-dimensional projected image. ..
一般に、3Dモデルにおけるフェイスの数が多いと、その立体形状を3Dプリンタで造形できないことや、操作性が悪化するなど問題が多い。そのため、3Dモデルの立体形状をできるだけ変えずに、フェイスの数を削減する必要がある。このフェイス削減機能は「簡略化」と呼ばれる。簡略化の処理として、フェイスのエッジを「縮約」する処理を繰り返す方法がよく利用される。縮約とは、削除するエッジの両端の頂点を近づけて1つの頂点にすることにより、フェイスを削減する処理のことである。 In general, if the number of faces in a 3D model is large, there are many problems such as the inability to form the three-dimensional shape with a 3D printer and the deterioration of operability. Therefore, it is necessary to reduce the number of faces without changing the three-dimensional shape of the 3D model as much as possible. This face reduction function is called "simplification". As a simplification process, a method of repeating the process of "reducing" the edges of the face is often used. The reduction is a process of reducing the number of faces by bringing the vertices at both ends of the edge to be deleted close to each other to form one vertex.
図15は、この縮約を説明するための模式図である。図15(a)は縮約実行前のフェイス群を示し、図15(b)は縮約実行後のフェイス群を示している。ここでは、図15(a)に示すエッジEGを削除することを考える。この場合、例えばエッジEGの両端の頂点P1,P2を、図15(b)のようにその中点P3に置き換えることにより、フェイスの数を2つ減らしている。 FIG. 15 is a schematic diagram for explaining this reduction. FIG. 15A shows the face group before the reduction execution, and FIG. 15B shows the face group after the reduction execution. Here, it is considered to delete the edge EG shown in FIG. 15 (a). In this case, for example, by replacing the vertices P1 and P2 at both ends of the edge EG with the midpoint P3 as shown in FIG. 15B, the number of faces is reduced by two.
フェイスにテクスチャが貼られている場合、テクスチャの模様をできるだけ変えないように縮約する必要がある。そのためには、3Dモデル上で新たに作られるフェイスの頂点(図15の場合は頂点P3)の3D座標値に対応するテクスチャ座標値を適切に決める必要がある。ここで、図14(a)のようにテクスチャが連続なら、新たに作られる頂点P3の3D座標値をもとに、テクスチャ座標値を推定できる。例えば、新たに作られる頂点P3が、縮約前の頂点P1,P2の中点であるなら、頂点P3に対応するテクスチャ座標値も、頂点P1,P2に対応するテクスチャ座標値の中点であると推定することが可能である。 If the face has a texture, it should be contracted so as not to change the pattern of the texture as much as possible. For that purpose, it is necessary to appropriately determine the texture coordinate value corresponding to the 3D coordinate value of the vertex (vertex P3 in the case of FIG. 15) of the face newly created on the 3D model. Here, if the texture is continuous as shown in FIG. 14A, the texture coordinate value can be estimated based on the 3D coordinate value of the newly created vertex P3. For example, if the newly created vertex P3 is the midpoint of the vertices P1 and P2 before reduction, the texture coordinate value corresponding to the vertex P3 is also the midpoint of the texture coordinate value corresponding to the vertices P1 and P2. It is possible to estimate.
しかしながら、図14(b)のようにテクスチャが非連続だと、3Dモデル上で新たに作られる頂点P3に対応するテクスチャ座標値を推定することができない。そのため、縮約によって削除されるフェイスに貼られていたテクスチャを再現することができない。図16は、そのことを模式的に示す図である。 However, if the texture is discontinuous as shown in FIG. 14 (b), the texture coordinate value corresponding to the newly created vertex P3 on the 3D model cannot be estimated. Therefore, it is not possible to reproduce the texture attached to the face that is deleted by the contraction. FIG. 16 is a diagram schematically showing this.
例えば、図16(a)に示すように、削除されるフェイスFC1,FC2に貼られるテクスチャに“●”の模様があり、その他のフェイスに貼られるテクスチャに“■”の模様がある場合において、図16(b)のようにそれらのテクスチャが非連続であるとする。この場合、縮約を行ってフェイスFC1,FC2を削除すると、“●”の模様がなくなり、このテクスチャ模様を保持できない。このため、貼り付けられるテクスチャが非連続なフェイスは、縮約によって削除することができないという問題があった。全てのフェイスに貼られるテクスチャが非連続だと、縮約を全く行うことができない。上記特許文献1,2には、この縮約に伴う問題の解決手法は示されていない。 For example, as shown in FIG. 16A, when the textures attached to the deleted faces FC1 and FC2 have a pattern of “●” and the textures attached to the other faces have a pattern of “■”. It is assumed that those textures are discontinuous as shown in FIG. 16 (b). In this case, if the faces FC1 and FC2 are deleted by performing reduction, the pattern of "●" disappears and this texture pattern cannot be retained. Therefore, there is a problem that a face whose pasted texture is discontinuous cannot be deleted by contraction. If the textures on all faces are discontinuous, no contraction can be done. The above-mentioned Patent Documents 1 and 2 do not show a method for solving the problem associated with this contraction.
なお、ここで説明した縮約は、フェイスの隣接関係が変わることのある編集処理の一例である。縮約以外のポリゴンメッシュの編集処理においても、フェイスの隣接関係が変わることがある。そのような編集処理に関しても、各フェイスに貼り付けられるテクスチャが非連続な場合には上記と同様の問題が生じる。 The contraction described here is an example of an editing process in which the adjacency relationship of faces may change. Even in the editing process of polygon mesh other than contraction, the adjacency relationship of faces may change. Even in such an editing process, if the textures attached to each face are discontinuous, the same problem as described above occurs.
本発明は、このような問題を解決するために成されたものであり、3Dモデルに貼られるテクスチャが非連続な場合であっても、ポリゴンメッシュの編集処理によって新たに作られるフェイスの頂点の3D座標値に対応するテクスチャ座標値を適切に決定することができるようにして、貼り付けられるテクスチャが非連続なフェイスでもポリゴンメッシュの編集処理を行うことができるようにすることを目的とする。 The present invention has been made to solve such a problem, and even if the texture attached to the 3D model is discontinuous, the top of the face newly created by the editing process of the polygon mesh is formed. It is an object of the present invention to enable the texture coordinate values corresponding to the 3D coordinate values to be appropriately determined so that the polygon mesh can be edited even if the texture to be pasted is a non-continuous face.
上記した課題を解決するために、本発明では、ポリゴンメッシュから成る3Dモデルが有する3Dの各フェイスを2Dの各フェイスに平面化し、当該2Dの各フェイスに対して、元の3D座標値に対応するテクスチャ座標値に基づいて特定されるテクスチャに基づく画像を貼り付けることにより、各テクスチャの位置が再構成された全体テクスチャの2D画像である再構成全体テクスチャを生成する。そして、こうして生成された再構成全体テクスチャとその識別情報、および、当該再構成全体テクスチャ上における各テクスチャを構成する各頂点のテクスチャ座標値である再構成テクスチャ座標値を、元の全体テクスチャとその識別情報およびテクスチャ座標値に代えて利用するように更新処理を行うようにしている。 In order to solve the above-mentioned problems, in the present invention, each 3D face of the 3D model composed of the polygon mesh is flattened into each 2D face, and each face of the 2D corresponds to the original 3D coordinate value. By pasting an image based on the texture specified based on the texture coordinate values to be performed, a reconstructed whole texture which is a 2D image of the whole texture in which the position of each texture is reconstructed is generated. Then, the reconstructed whole texture and its identification information generated in this way, and the reconstructed texture coordinate value which is the texture coordinate value of each vertex constituting each texture on the reconstructed whole texture are set to the original whole texture and its identification. The update process is performed so that it is used instead of the identification information and the texture coordinate value.
上記のように構成した本発明によれば、3Dモデルに貼られるテクスチャが非連続な場合であっても、3Dモデルの連続な各フェイスを平面化することで構成された2Dの連続な各フェイスに対し、元の各テクスチャに基づく画像が貼られることによって再構成全体テクスチャが生成されるので、再構成される各テクスチャは連続となる。そして、この連続な各テクスチャから成る再構成全体テクスチャとその識別情報、および、当該連続な各テクスチャを構成する各頂点の再構成テクスチャ座標値がテクスチャマッピングに利用されるようになる。これにより、3Dモデルについて縮約などの編集処理によって新たに作られるフェイスの頂点の3D座標値に対応する再構成テクスチャ座標値を適切に決定することができ、貼り付けられる元のテクスチャが非連続なフェイスでもポリゴンメッシュの編集処理を行うことができるようになる。 According to the present invention configured as described above, even if the texture applied to the 3D model is discontinuous, each continuous face of the 3D model is formed by flattening each continuous face of the 3D model. On the other hand, since the entire reconstructed texture is generated by pasting the image based on each original texture, each reconstructed texture is continuous. Then, the entire reconstructed texture composed of the continuous textures, the identification information thereof, and the reconstructed texture coordinate values of the vertices constituting the continuous textures are used for the texture mapping. This makes it possible to appropriately determine the reconstructed texture coordinate values corresponding to the 3D coordinate values of the vertices of the face newly created by editing processing such as reduction of the 3D model, and the original texture to be pasted is discontinuous. It will be possible to edit the polygon mesh even with a simple face.
以下、本発明の一実施形態を図面に基づいて説明する。図1は、本実施形態によるテクスチャマッピング装置の機能構成例を示すブロック図である。図1に示すように、本実施形態のテクスチャマッピング装置10は、その機能構成として、領域指定部11、座標情報取得部12、フェイス平面化部13、2D画像生成部14および更新処理部15を備えている。本実施形態のテクスチャマッピング装置10は、例えば、上記各機能を備えたパーソナルコンピュータなどで構成される。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a functional configuration example of the texture mapping device according to the present embodiment. As shown in FIG. 1, the
上記各機能ブロック11〜15は、ハードウェア、DSP(Digital Signal Processor)、ソフトウェアの何れによっても構成することが可能である。例えばソフトウェアによって構成する場合、上記各機能ブロック11〜15は、実際にはコンピュータのCPU、RAM、ROMなどを備えて構成され、RAMやROM、ハードディスクまたは半導体メモリ等の記録媒体に記憶されたテクスチャマッピング用プログラムが動作することによって実現される。 Each of the above functional blocks 11 to 15 can be configured by any of hardware, DSP (Digital Signal Processor), and software. For example, when configured by software, each of the above functional blocks 11 to 15 is actually configured to include a computer CPU, RAM, ROM, etc., and is a texture stored in a recording medium such as RAM, ROM, hard disk, or semiconductor memory. It is realized by operating the mapping program.
また、本実施形態のテクスチャマッピング装置10には、記憶媒体としてのCGデータ記憶部100が接続されている。CGデータ記憶部100は、パーソナルコンピュータであるテクスチャマッピング装置10と有線ケーブルまたは無線LANを介して接続される。あるいは、CGデータ記憶部100は、テクスチャマッピング装置10から通信ネットワークを介して接続可能なサーバに備えられ、テクスチャマッピング装置10からサーバにアクセスしてCGデータ記憶部100と接続する構成としてもよい。
Further, a CG
なお、本実施形態のテクスチャマッピング装置10およびCGデータ記憶部100をサーバが備え、通信ネットワークを介してサーバに接続されたクライアント端末からの要求に応じて、以下に説明するテクスチャマッピング装置10の処理をサーバが実行し、その実行結果をサーバからクライアント端末に提供するように構成してもよい。
The server includes the
CGデータ記憶部100は、ポリゴンメッシュから成る3Dモデルに関する3Dモデルデータ100Aと、当該3Dモデルが有する複数のフェイスに対し貼り付けるテクスチャ画像に関するテクスチャデータ100Bと、紐付けデータ100Cとを含むCGデータを記憶している。
The CG
3Dモデルデータ100Aは、1つ1つが三角形状をした複数のフェイスを有する一般的なポリゴンメッシュのデータである。3Dモデルデータ100Aは、フェイスごとに、3次元空間上のxyz座標(3D座標)における3頂点の座標値(x,y,z)と、3つのエッジ(三角形の辺)を介して隣接する3つのフェイスの情報とを有している。なお、隣接するフェイスの情報は、頂点の周りに存在する複数のフェイスの情報を有する構成など、他の構成でもよい。
The
テクスチャデータ100Bは、ポリゴンメッシュの各フェイスに貼り付ける複数のテクスチャを有する2次元の画像データである。複数のテクスチャは、1枚のテクスチャ画像の全体を三角形状の複数のピース領域に分割して構成されるものである。複数枚のテクスチャ画像から各テクスチャが構成される場合もある。以下では、テクスチャ画像の全体を「全体テクスチャ」と言い、その中の複数のピース領域を「テクスチャ」と言って両者を区別する。
The
本実施形態のテクスチャマッピング装置10は、3Dモデルデータ100Aのポリゴンメッシュから成る3Dモデルが有する複数のフェイスに対し、テクスチャデータ100Bが有する複数のテクスチャを貼り付けるテクスチャマッピングを行うものである。このテクスチャマッピングを行うに当たり、3Dモデルの各フェイスが全体テクスチャの中のどのピース領域をテクスチャとして使用するかという情報が必要である。そして、その情報を記録したのが紐付けデータ100Cである。紐付けデータ100Cは、フェイスごとに、貼り付けられる全体テクスチャの識別情報と、貼り付けられるテクチャに関する2次元空間上のuv座標(テクスチャ座標)における3頂点のテクスチャ座標値(u,v)とを有している。
The
領域指定部11は、3Dモデルの立体形状の中から処理対象とする領域を指定する。領域指定部11により領域が指定された場合、座標情報取得部12、フェイス平面化部13、2D画像生成部14および更新処理部15は、領域指定部11により指定された領域に対して各処理を実行する。例えば、1つの3Dモデルを複数の領域に分割し、当該分割した領域を順に、または同時に指定することにより、領域ごとに各処理を実行する。
The area designation unit 11 designates an area to be processed from the three-dimensional shape of the 3D model. When an area is designated by the area designation unit 11, the coordinate
図2は、領域指定部11により指定される分割領域の一例を示す図である。図2に示すように、3Dモデルの個々の分割領域は、いつくかの連結した(エッジを介して繋がった)フェイス群から成る。ここで、領域指定部11による領域の指定方法は任意である。例えば、CGデータ記憶部100に記憶されている3Dモデルデータ100Aに基づいて3次元形状をディスプレイに画面表示させ、マウスやタッチパネル等のユーザ操作によって領域を指定することが可能である。あるいは、3D形状における複数のエッジを自動的に検出し、当該エッジで囲まれる領域を自動的に指定するようにしてもよい。
FIG. 2 is a diagram showing an example of a divided region designated by the region designation unit 11. As shown in FIG. 2, each divided region of the 3D model consists of several connected (connected via edges) faces. Here, the method of designating the area by the area designating unit 11 is arbitrary. For example, it is possible to display a three-dimensional shape on a screen based on the
領域指定部11が自動的に領域指定を行うケースとして、例えば次の3つが挙げられる。第1は、3D形状の幾何的な特徴を考慮して領域分割する方法である。すなわち、領域指定部11は、3Dの立体形状において、折れている箇所(隣接するフェイスが所定角度以上を成して接する箇所)や、曲率の傾向が変わる箇所などを公知のエッジ検出技術により自動的に検出し、検出したエッジを境界にして領域を分割する。そして、分割した個々の領域を指定する。 For example, the following three cases can be mentioned as a case where the area designation unit 11 automatically designates an area. The first is a method of dividing a region in consideration of the geometrical features of the 3D shape. That is, in the 3D three-dimensional shape, the area designation unit 11 automatically determines a bent portion (a portion where adjacent faces meet at a predetermined angle or more), a portion where the tendency of curvature changes, and the like by a known edge detection technique. The area is divided with the detected edge as the boundary. Then, the divided individual areas are specified.
第2は、フェイス平面化部13による平面化を考慮して領域分割する方法である。本実施形態では、後述するように、3Dの立体形状を2Dに平面化する処理を行う。この場合、3Dモデルを複数の領域に分割し、分割した領域ごとに、領域内に含まれる3Dのフェイス群を2Dのフェイス群に平面化することにより、当該平面化の処理を行いやすくすることができる。よって、各領域の境界となるエッジは、必ずしも立体形状で折れている箇所や曲率の傾向が変わる箇所に限らない。例えば、図2に示す円柱側面のように、滑らかに連続する周期曲面上で、隣接するフェイスが所定角度未満で接する部分をエッジとして領域分割してもよい。
The second method is a method of dividing the area in consideration of flattening by the
第3は、フェイスに貼り付けるテクスチャ画像の単位を考慮して領域分割する方法である。例えば、1つの3Dモデルに対して、領域ごとに異なる全体テクスチャの画像を貼り付ける場合がある。また、3Dモデルの全体のうち一部分のフェイスに対してのみテクスチャを貼り付ける場合もある。このような場合、領域指定部11は、テクスチャ画像の境界で領域を分割する。例えば、領域指定部11は、各フェイスに紐付けられている全体テクスチャの識別情報をもとに、隣接するフェイス間で識別情報が異なる部分をエッジとして自動的に検出し、検出されたエッジで囲まれる領域を自動的に指定する。この場合、領域指定部11は、領域を指定するとともに、その領域に貼り付ける全体テクスチャ(の識別情報)を指定する。 The third method is to divide the area in consideration of the unit of the texture image to be attached to the face. For example, an image of a different overall texture may be pasted for each area for one 3D model. In addition, the texture may be pasted only on a part of the faces of the entire 3D model. In such a case, the area designation unit 11 divides the area at the boundary of the texture image. For example, the area designation unit 11 automatically detects a portion where the identification information differs between adjacent faces as an edge based on the identification information of the entire texture associated with each face, and the detected edge is used. The area to be enclosed is automatically specified. In this case, the area designation unit 11 designates the area and also specifies (identification information) of the entire texture to be attached to the area.
なお、3Dモデルの全体領域のうち、フェイスの縮約を行いたい領域が限定されている場合は、所望の対象領域をユーザ操作により指定して、当該指定した領域のみを対象として、座標情報取得部12、フェイス平面化部13、2D画像生成部14および更新処理部15の処理を実行するようにすることも可能である。
If the area in which the face is to be reduced is limited in the entire area of the 3D model, the desired target area is specified by the user operation, and the coordinate information is acquired only for the specified area. It is also possible to execute the processing of the
座標情報取得部12は、領域指定部11により指定された領域について、3Dモデルデータ100A、テクスチャデータ100Bおよび紐付けデータ100CをCGデータ記憶部100から取得する。ここで取得するデータの中には、3Dモデルのフェイスを構成する各頂点の3D座標値、および、フェイスに貼り付けられるテクチャを構成する各頂点のテクスチャ座標値の各座標情報が含まれている。
The coordinate
フェイス平面化部13は、座標情報取得部12により取得された各フェイスの3D座標値に基づいて、3Dの各フェイス(以下、1つ1つを3Dフェイスという)を2Dの各フェイス(以下、1つ1つを2Dフェイスという)に平面化する。フェイス平面化部13による平面化の手法としては、次の2つが考えられる。図3は、フェイス平面化部13による平面化の2つの手法による処理内容を説明するための模式図である。ここで、図3(a)が第1の手法(投影方法)を示し、図3(b)が第2の手法(展開方法)を示している。
The
第1の手法は、図3(a1)に示すように、3Dの各フェイスを構成する各頂点を、所定の一平面に対して垂直な方向に、当該一平面に投影することにより、3Dフェイスを2Dフェイスに平面化する方法である。この第1の手法は、高速に計算できるというメリットを有する反面、図3(a2)に示すように、3Dフェイスが一平面と平行でなくなるほど、平面化された2Dフェイスの形状が元の3Dフェイスの形状から大きく変形するというデメリットを有する。図3(a3)に示されるように、3Dフェイスから大きく変形した2Dフェイスでは、そこに貼られるテクスチャ画像の画素数が少なくなり、画質が劣化する。 In the first method, as shown in FIG. 3 (a1), each vertex constituting each face in 3D is projected onto the plane in a direction perpendicular to a predetermined plane, whereby the 3D face is projected. Is a method of flattening a 2D face. While this first method has the advantage of being able to calculate at high speed, as shown in FIG. 3 (a2), the shape of the flattened 2D face is the original 3D so that the 3D face is not parallel to one plane. It has the demerit that it is greatly deformed from the shape of the face. As shown in FIG. 3 (a3), in a 2D face that is greatly deformed from a 3D face, the number of pixels of the texture image attached to the 2D face is reduced, and the image quality is deteriorated.
第2の手法は、図3(b1)に示すように、3Dの各フェイスを所定の一平面に展開することにより、3Dフェイスを2Dフェイスに平面化する方法である。この第2の手法は、第1の手法に比べて計算に多くの時間がかかるが、3Dフェイスが一平面と平行でなくても、平面化される2Dフェイスの変形は最小限に抑えられるため、そこに貼られるテクスチャ画像の画質の劣化を最小限に抑えることができる。 The second method is a method of flattening a 3D face into a 2D face by expanding each 3D face into a predetermined one plane as shown in FIG. 3 (b1). This second method takes more time to calculate than the first method, but even if the 3D face is not parallel to one plane, the deformation of the flattened 2D face is minimized. , It is possible to minimize the deterioration of the image quality of the texture image pasted there.
なお、円筒面のような可展面の場合は、フェイスの形を変えずに展開することが可能である。これに対し、球面のような非可展面の場合は、フェイスの隣接関係を保ったまま展開すると、フェイスの形が変わることは避けられない。よって、この場合は、計算の高速性を優先して、第1の手法を適用して平面化を行うようにしてよい。第1の手法または第2の手法のどちらを適用してフェイスの平面化を行うかは、適用が可能な面であるか否かとか、処理の高速性と画像の品質とのどちらを重視するかなどを考慮して、適宜決めればよい。 In the case of a developable surface such as a cylindrical surface, it can be developed without changing the shape of the face. On the other hand, in the case of a non-develable surface such as a spherical surface, it is inevitable that the shape of the face will change if it is developed while maintaining the adjacency of the faces. Therefore, in this case, priority may be given to the high speed of calculation, and the first method may be applied to perform flattening. Whether the face is flattened by applying the first method or the second method emphasizes whether or not the surface is applicable, and whether the processing speed or the image quality is important. It may be decided as appropriate in consideration of such factors.
なお、フェイス平面化部13において、図3(a)のように各3Dフェイスを一平面上に平行投影する場合、領域指定部11は、1つの領域内に含まれる各3Dフェイスの法線ベクトルの向きが一定範囲内に入るように、領域分割する。一方、フェイス平面化部13において、図3(b)のように各3Dフェイスを一平面上に展開する場合、領域指定部11は、可展性を考慮して領域分割することが好ましい。
When each 3D face is projected in parallel on one plane as shown in FIG. 3A in the
図4は、フェイス平面化部13の具体的な処理内容を説明するための模式図である。まず、フェイス平面化部13は、図4(a)に示すように、領域指定部11により指定された3Dモデル上の領域に対して、3D座標上に一平面41を特定し、その一平面41上に指定領域内の各3Dフェイスを投影または展開する。ここで、一平面41の法線方向は、例えば、指定領域内に含まれる各3Dフェイスの法線方向の平均、または、各3Dフェイスの面積を重みとする重み付き平均として算出する。あるいは、ユーザがマウスドラッグ操作により領域を指定した場合は、その領域指定時の視線方向(画面に垂直な方向)を一平面41の法線方向とするようにしてもよい。なお、一平面41の位置は任意であるが、例えば3D座標の原点を通過するように決める。
FIG. 4 is a schematic diagram for explaining the specific processing contents of the
次に、フェイス平面化部13は、図4(b)に示すように、一平面41に投影または展開したフェイス群を2D化するために、一平面41が2Dモデルのx’y’座標の平面に乗るように座標変換する。すなわち、フェイス平面化部13は、一平面41上に投影または展開したフェイス群の各頂点の3D座標値(xyz座標値)を、2D座標値(x’y’座標値)に変換する。この座標変換は、公知の技術を適用して行うことが可能である。
Next, as shown in FIG. 4B, the
2D画像生成部14は、フェイス平面化部13により生成された各2Dフェイスに対して、元の3Dフェイスの3D座標値に対応して座標情報取得部12により取得されたテクスチャ座標値に基づいて特定されるテクスチャ(以下、対応テクスチャという)に基づく画像を貼り付けることにより、各テクスチャの位置が再構成された全体テクスチャの2D画像(以下、再構成全体テクスチャという)を生成する。
The 2D
ここで、対応テクスチャとは、2Dフェイスが平面化される前の元の3Dフェイスに対して貼り付けるものとして紐付けデータ100Cにより紐付けられていたテクスチャのことである。また、平面化された2Dフェイスに対して「対応テクスチャに基づく画像」を貼り付けるというのは、対応テクスチャをそのまま貼り付けるのではなく、対応テクスチャに基づく色情報(RGBα)を各画素に付与した画像を作って貼り付けるという意味である。
Here, the corresponding texture is a texture associated with the
図5は、2D画像生成部14の具体的な機能構成例を示すブロック図である。図5に示すように、2D画像生成部14は、必要画素数算出部51、正規化部52、画素構成部53および画像生成部54を備えて構成される。2D画像生成部14は、この図5に示す機能構成により、2D画像の生成を行う。
FIG. 5 is a block diagram showing a specific functional configuration example of the 2D
必要画素数算出部51は、まず、座標情報取得部12により取得されたテクスチャデータ100Bに基づいて、各3Dフェイスに貼られたテクスチャの3D空間上での画素間隔を求める。例えば、必要画素数算出部51は、各3Dフェイスに貼られた複数のテクスチャ画素間隔の平均値を算出する。次に、必要画素数算出部51は、当該求めた画素間隔(平均値)と、フェイス平面化部13により生成された各2Dフェイスのサイズとに基づいて、再構成全体テクスチャに必要な画素数を算出する。例えば、必要画素数算出部51は、図6に示すように、フェイス平面化部13により生成された各2Dフェイスを包含する最小面積の長方形領域61を設定し、当該長方形領域61の長辺に対して上記求めた画素間隔で置くことのできる画素数を算出する。
First, the required pixel
なお、ユーザの操作に応じて、画素間隔を調整したり、必要画素数を直接入力したりするようにしてもよい。 The pixel spacing may be adjusted or the required number of pixels may be directly input according to the user's operation.
正規化部52は、フェイス平面化部13により生成された各2Dフェイスが全体テクスチャのサイズと合うように(指定領域と同じサイズの範囲内にちょうど収まるように)、各2Dフェイスのサイズを正規化する。図7は、この正規化部52の処理内容を説明するための模式図である。図7に示すように、正規化部52は、図6のように設定した長方形領域61の各辺の長さが“1”となるように(正方形領域71となるように)、長方形領域61と、その中に含まれる各2Dフェイスとをx’方向およびy’方向に独立に拡大または縮小する。さらに、正規化部52は、その正方形領域71の4頂点のうち、x’座標値およびy’座標値がともに最小の頂点が原点と一致するように、拡大/縮小後の2Dフェイス群を平行移動する。
The
画素構成部53は、正規化部52により正規化された各2Dフェイスで特定される範囲(正方形領域71で示される範囲)を、必要画素数算出部51により算出された画素数で分割して格子状に区切り、各格子を再構成全体テクスチャの各画素に割り当てる。すなわち、1つの格子のセルが、再構成全体テクスチャの画素に相当する。
The
画像生成部54は、正規化部52により正規化された各2Dフェイスに対し、上述した「対応テクスチャに基づく画像」を貼り付ける。ここで、画像生成部54は、正規化部52により正規化された各2Dフェイスに対して、画素構成部53により構成された各画素ごとに、対応テクスチャに基づく色情報(RGBα)を与える。
The
図8は、画像生成部54の具体的な機能構成例を示すブロック図である。図8に示すように、画像生成部54は、フェイス存否判定部54Aおよび画素色決定部54Bを備えて構成される。フェイス存否判定部54Aは、画素構成部53により構成された画素の少なくとも一部分に、正規化部52により正規化された2Dフェイスが存在するか否かを判定する。
FIG. 8 is a block diagram showing a specific functional configuration example of the
図9は、フェイス存否判定部54Aの処理内容を説明するための模式図である。図9には、複数の2Dフェイスを含む正方形領域71を、必要画素数算出部51により算出された画素数で区切った複数の格子、つまり再構成全体テクスチャの各画素が示されている。図9から明らかな通り、各画素の中には、2Dフェイスが全く含まれないもの(1つの画素の全域が無色で示されているもの)と、2Dフェイスの少なくとも一部が含まれるもの(1つの画素の中の少なくとも一部の領域が有色で示されているもの)とが存在する。フェイス存否判定部54Aは、正方形領域71内に含まれる各画素が、2Dフェイスの少なくとも一部を含むものか否かを判定する。
FIG. 9 is a schematic diagram for explaining the processing content of the face presence /
画素色決定部54Bは、フェイス存否判定部54Aにより2Dフェイスが存在しないと判定された画素については、特定の色(例えば、黒色)で画素の色を決定する。一方、フェイス存否判定部54Bにより2Dフェイスの少なくとも一部が存在すると判定された画素については、2Dフェイスに対応する対応テクスチャの色をもとに画素の色を決定する。例えば、画素内に1個以上のサンプリング点を設定し、サンプリング点に存在する2Dフェイスに対応する対応テクスチャの色をもとに画素の色を決定する。ここで、1つの画素内に複数の2Dフェイスの一部が存在する場合でも、サンプリング点に対応する当該複数の2Dフェイスの何れかに対応する対応テクスチャの色をもとに画素の色を決定する。
The pixel
以下、サンプリング点数が1つの場合について説明するが、複数のサンプリング点で色を決める場合は、各サンプリング点での色をもとに平均を取るなどして画素の色を決めればよい。サンプリング点を1つとする場合、例えば画素の中心点をサンプリング点とする。この場合、画素色決定部54Bは、フェイス存否判定部54Aにより2Dフェイスの少なくとも一部が存在すると判定された画素について、例えば以下のようにして画素の色を決定する。すなわち、画素色決定部54Bは、画素の中心点に2Dフェイスが存在する場合は、当該中心点に存在する2Dフェイスに対応する対応テクスチャの色を画素の色として決定する。これは、1つの画素内に1つの2Dフェイスの一部が存在する場合も、1つの画素内に複数の2Dフェイスの一部が存在する場合も同様である。一方、画素の中心点に2Dフェイスが存在しない場合は、当該画素内で中心点以外に存在する2Dフェイス(例えば、中心点から最も近い2Dフェイス)に対応する対応テクスチャの色を画素の色として決定する。なお、ここで説明した画素の色の決め方は一例に過ぎず、これ以外の方法で画素の色を決定するようにしてもよい。
Hereinafter, the case where the number of sampling points is one will be described, but when the color is determined by a plurality of sampling points, the pixel color may be determined by taking an average based on the color at each sampling point. When one sampling point is used, for example, the center point of the pixel is set as the sampling point. In this case, the pixel
図10は、画素色決定部54Bの処理内容を説明するための模式図である。図10は、図9に符号91で示す部分を拡大して示したものである。すなわち、図10には、画素構成部53により構成された2つの隣接する画素101,102と、正規化部52により正規化された1つの2Dフェイス103とが示されている。101Cは左側の画素101の中心点、102Cは右側の画素102の中心点である。
FIG. 10 is a schematic diagram for explaining the processing content of the pixel
左側の画素101は、その中心点101Cに2Dフェイス103が存在する。よって、画素色決定部54Bは、左側および画素101について、2Dフェイス103に対応する対応テクスチャ(2Dフェイス103が平面化される前の3Dフェイスに貼り付けられるテクスチャ)の色を画素の色として決定する。
The
一方、右側の画素102は、その中心点102Cに2Dフェイス103が存在しない(中心点102Cにはこれ以外の2Dフェイスも存在しない)。よって、画素色決定部54Bは、右側および画素102について、当該画素102内で中心点102C以外に存在する2Dフェイス(図10の場合は、2Dフェイス103)に対応する対応テクスチャの色を画素102の色として決定する。例えば、画素102の中心点102Cから、2Dフェイス群に最近点102Nを求め、当該最近点102Nを含む2Dフェイスに対応する対応テクスチャの色を画素102の色として決定する。
On the other hand, the
図1に戻り、更新処理部15は、以上のようにして生成された再構成全体テクスチャとその識別情報、および、再構成全体テクスチャ上における各2Dテクスチャを構成する各頂点のテクスチャ座標値(以下、再構成テクスチャ座標値という)を、CGデータ記憶部100にテクスチャデータ100Bとして記憶されている全体テクスチャと、紐付けデータ100Cとして記憶されている全体テクスチャの識別情報およびテクスチャ座標値とに代えて利用するように更新処理を行う。
Returning to FIG. 1, the
具体的には、更新処理部15は、画像生成部54により生成された再構成全体テクスチャを、CGデータ記憶部100にテクスチャデータ100Bとして記憶されている全体テクスチャに代えて利用するようにするとともに、当該再構成全体テクスチャの識別情報を設定して、紐付けデータ100Cとして記憶されている全体テクスチャの識別情報に代えて利用するように更新処理を行う。また、更新処理部15は、正規化部52により正規化された2Dフェイスの各頂点の2D座標値(x’,y’)を、各頂点の3Dモデル座標値と同じ値に置き換えて再構成テクスチャ座標値として設定し、当該設定した再構成テクスチャ座標値を、CGデータ記憶部100に紐付けデータ100Cとして記憶されているテクスチャ座標値に代えて利用するように更新処理を行う。
Specifically, the
ここで、領域指定部11により複数の領域を指定して、領域ごとに2D画像(再構成全体テクスチャ)を生成した場合、更新処理部15は、図11に示すように、領域ごとに生成された再構成全体テクスチャ111〜114を1つの統合テクスチャ115に統合するようにし、統合テクスチャ115とその識別情報、および、統合テクスチャ115上における各テクスチャを構成する各頂点のテクスチャ座標値(以下、統合テクスチャ座標値という)を、CGデータ記憶部100に記憶されている全体テクスチャとその識別情報およびテクスチャ座標値に代えて利用するように更新処理を行うことにより、画像データ数を削減するようにしてもよい。このとき、各テクスチャのu方向、v方向の画素数をもとに、隙間ができるだけ開かないように、テクスチャを詰めて統合テクスチャ115を生成するのが好ましい。
Here, when a plurality of areas are designated by the area designation unit 11 and a 2D image (reconstruction entire texture) is generated for each area, the
更新処理部15が行うCGデータ記憶部100の更新処理は、例えば、CGデータ記憶部100に元々記憶されている全体テクスチャとその識別情報およびテクスチャ座標値の上に、再構成全体テクスチャ(または統合テクスチャ)とその識別情報および再構成テクスチャ座標値(または統合テクスチャ座標値)を上書きすることによって行う。あるいは、CGデータ記憶部100に元々記憶されている全体テクスチャとその識別情報およびテクスチャ座標値の他に、再構成全体テクスチャ(または統合テクスチャ)とその識別情報および再構成テクスチャ座標値(または統合テクスチャ座標値)を追加して記憶し、元のデータを非アクティブ状態とし、追加したデータをアクティブ状態とするようにしてもよい。
The update process of the CG
図12は、以上説明した本実施形態によるテクスチャマッピング装置10の動作の概略を示す図である。図12(a)は、CGデータ記憶部100に記憶されているポリゴンメッシュから成る3Dモデルに関する3Dモデルデータ100Aを模式的に示したものである。図12(b)は、当該3Dモデルが有する複数のフェイスに対して貼り付ける各テクスチャに関するテクスチャデータ100Bを示している。図12(b)に示す通り、図12(a)の3Dモデルの各フェイスに貼り付ける複数のテクスチャは非連続(非連続テクスチャ)となっている。
FIG. 12 is a diagram showing an outline of the operation of the
フェイス平面化部13は、図12(a)に示す複数の3Dフェイスを複数の2Dフェイスに平面化する。図12(c)は、平面化された複数の2Dフェイスを示している。2D画像生成部14は、フェイス平面化部13により生成された図12(c)の各2Dフェイスを正規化し、正規化後の2Dフェイスに対して、2Dフェイスに対応する対応テクスチャ(図12(b)に示す各テクスチャ)に基づく画像を貼り付けることにより、各テクスチャの位置が再構成された全体テクスチャの2D画像(再構成全体テクスチャという)を生成する。
The
図12(d)は、2D画像生成部14により生成された再構成全体テクスチャを示している。図12(d)に示す通り、再構成全体テクスチャに含まれる複数のテクスチャは連続(連続テクスチャ)となっている。更新処理部15は、以上のようにして生成された図12(d)に示す再構成全体テクスチャとその識別情報、および、各2Dテクスチャを構成する各頂点の再構成テクスチャ座標値を、CGデータ記憶部100に記憶されている全体テクスチャとその識別情報およびテクスチャ座標値に代えて利用するように更新処理を行う。これにより、図12(e)に示すように、3Dモデルと再構成全体テクスチャとが紐付けられた状態となる。
FIG. 12D shows the entire reconstruction texture generated by the
このように、再構成全体テクスチャに含まれる複数のテクスチャが連続となっているため、3Dモデルのフェイスを縮約する場合も、縮約によって新たに作られる頂点の3D座標値をもとに、それに対応する新たなテクスチャ座標値を推定することができる。図13は、3Dモデルのフェイスを縮約した場合に、新たなテクスチャ座標値を推定する内容を模式的に示す図である。 In this way, since multiple textures included in the entire reconstructed texture are continuous, even when the face of the 3D model is reduced, the 3D coordinate values of the vertices newly created by the reduction are used as the basis for the reduction. A new texture coordinate value corresponding to it can be estimated. FIG. 13 is a diagram schematically showing the contents of estimating a new texture coordinate value when the face of the 3D model is reduced.
図13(a)は、縮約する前における3Dモデルの各フェイスとそれに貼り付ける各テクスチャ(再構成全体テクスチャの連続テクスチャ)とを示している。図13(a1)に示す3Dモデルは、図15(a)に示した3Dモデルと同じである。この3Dモデルに対し、エッジEGの両端の頂点P1,P2を、その中点P3に置き換えることにより、エッジEGを削減してフェイスの縮約を行ったとする。その結果を示したのが図13(b1)である。ここに示す3Dモデルは、図15(b)に示した3Dモデルと同じである。 FIG. 13A shows each face of the 3D model before reduction and each texture attached to the face (continuous texture of the entire reconstructed texture). The 3D model shown in FIG. 13 (a1) is the same as the 3D model shown in FIG. 15 (a). It is assumed that the edge EG is reduced and the face is reduced by replacing the vertices P1 and P2 at both ends of the edge EG with the midpoint P3 of the 3D model. The result is shown in FIG. 13 (b1). The 3D model shown here is the same as the 3D model shown in FIG. 15 (b).
図13(a1)に示すフェイス群に対して図13(a2)に示す各テクスチャが貼られている場合、テクスチャの模様をできるだけ変えないように縮約する必要がある。そのためには、3Dモデル上で新たに作られるフェイスの頂点P3の3D座標値に対応するテクスチャ座標値P3’を適切に決める必要がある。本実施形態では、図13(a2)のようにテクスチャが連続であるため、新たに作られる頂点P3の3D座標値をもとに、それに対応するテクスチャ座標値P3’(図13(b2)参照)を推定することが可能である。例えば、新たに作られる頂点P3が、縮約前の頂点P1,P2の中点であるなら、頂点P3に対応するテクスチャ座標値P3’も、頂点P1,P2に対応するテクスチャ座標値の中点であると推定することが可能である。 When each texture shown in FIG. 13 (a2) is attached to the face group shown in FIG. 13 (a1), it is necessary to reduce the texture pattern so as not to change it as much as possible. For that purpose, it is necessary to appropriately determine the texture coordinate value P3'corresponding to the 3D coordinate value of the vertex P3 of the face newly created on the 3D model. In this embodiment, since the texture is continuous as shown in FIG. 13 (a2), the corresponding texture coordinate value P3'(see FIG. 13 (b2)) is based on the 3D coordinate value of the newly created vertex P3. ) Can be estimated. For example, if the newly created vertex P3 is the midpoint of the vertices P1 and P2 before reduction, the texture coordinate value P3'corresponding to the vertex P3 is also the midpoint of the texture coordinate values corresponding to the vertices P1 and P2. It is possible to presume that.
以上詳しく説明したように、本実施形態では、ポリゴンメッシュから成る3Dモデルが有する各3Dフェイスを各2Dフェイスに平面化し、当該各2Dフェイスに対して、元の3Dフェイスに貼り付けられる対応テクスチャに基づく画像を貼り付けることにより、再構成全体テクスチャを生成する。そして、こうして生成された再構成全体テクスチャとその識別情報、および、当該再構成全体テクスチャ上における各テクスチャを構成する各頂点の再構成テクスチャ座標値を、元の全体テクスチャとその識別情報およびテクスチャ座標値に代えて利用するように更新処理を行うようにしている。 As described in detail above, in the present embodiment, each 3D face of the 3D model composed of the polygon mesh is flattened into each 2D face, and the corresponding texture to be attached to the original 3D face for each 2D face. Generate the entire reconstruction texture by pasting the based image. Then, the reconstructed whole texture and its identification information thus generated, and the reconstructed texture coordinate values of each vertex constituting each texture on the reconstructed whole texture are set to the original whole texture and its identification information and texture coordinates. The update process is performed so that it is used instead of the value.
このように構成した本発明によれば、3Dモデルに貼られるテクスチャが非連続な場合であっても、再構成されるテクスチャは連続となり、この連続な各テクスチャから成る再構成全体テクスチャとその識別情報、および、当該連続な各テクスチャを構成する各頂点の再構成テクスチャ座標値がテクスチャマッピングに利用されるようになる。これにより、3Dモデルについて縮約によって新たに作られるフェイスの頂点の3D座標値に対応する再構成テクスチャ座標値を適切に決定することができ、貼り付けられる元のテクスチャが非連続なフェイスでも縮約を行うことができるようになる。上記実施形態では、ポリゴンメッシュの編集処理の一例として縮約を説明したが、これ以外のポリゴンメッシュの編集処理についても同様である。すなわち、貼り付けられる元のテクスチャが非連続なフェイスでも、フェイスの隣接関係が変わるような編集処理を行うことが可能である。 According to the present invention configured in this way, even if the texture applied to the 3D model is discontinuous, the reconstructed texture is continuous, and the entire reconstructed texture consisting of each of the continuous textures and its identification. The information and the reconstructed texture coordinate values of each vertex constituting each continuous texture will be used for texture mapping. This makes it possible to appropriately determine the reconstructed texture coordinate values corresponding to the 3D coordinate values of the vertices of the face newly created by reduction for the 3D model, and the original texture to be pasted is reduced even if the face is discontinuous. You will be able to make about. In the above embodiment, the reduction has been described as an example of the polygon mesh editing process, but the same applies to the other polygon mesh editing processes. That is, even if the original texture to be pasted is a discontinuous face, it is possible to perform an editing process that changes the adjacency relationship of the faces.
なお、上記実施形態は、何れも本発明を実施するにあたっての具体化の一例を示したものに過ぎず、これによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその要旨、またはその主要な特徴から逸脱することなく、様々な形で実施することができる。 It should be noted that the above embodiments are merely examples of the embodiment of the present invention, and the technical scope of the present invention should not be construed in a limited manner. That is, the present invention can be implemented in various forms without departing from its gist or its main features.
例えば、上記実施形態では、正規化部52の処理として、図6のように設定した長方形領域61の各辺の長さが“1”となるように、長方形領域61と、その中に含まれる各2Dフェイスとをu方向およびv方向に独立に拡大または縮小する例を示したが、本発明はこれに限定されない。例えば、u方向およびv方向に等倍率に拡大または縮小する構成としてもよい。
For example, in the above embodiment, as the processing of the
10 テクスチャマッピング装置
11 領域指定部
12 座標情報取得部
13 フェイス平面化部
14 2D画像生成部
15 更新処理部
51 必要画素数算出部
52 正規化部
53 画素構成部
54 画像生成部
54A フェイス存否判定部
54B 画素色決定部
100 CGデータ記憶部
100A 3Dモデルデータ
100B テクスチャデータ
100C 紐付けデータ
10 Texture mapping device 11
Claims (10)
上記フェイスを構成する各頂点の3D座標値、および、上記フェイスに貼り付けられるテクチャを構成する各頂点のテクスチャ座標値の各座標情報と、上記全体テクスチャの識別情報とを含むCGデータを記憶したCGデータ記憶部から、上記各座標情報を取得する座標情報取得部と、
上記座標情報取得部により取得された各フェイスの3D座標値に基づいて、3Dの各フェイスを2Dの各フェイスに平面化するフェイス平面化部と、
上記フェイス平面化部により生成された上記2Dの各フェイスに対して、元の3D座標値に対応して上記座標情報取得部により取得されたテクスチャ座標値に基づいて特定されるテクスチャである対応テクスチャに基づく画像を貼り付けることにより、各テクスチャの位置が再構成された全体テクスチャの2D画像である再構成全体テクスチャを生成する2D画像生成部と、
上記再構成全体テクスチャとその識別情報、および、上記再構成全体テクスチャ上における各テクスチャを構成する各頂点のテクスチャ座標値である再構成テクスチャ座標値を、上記CGデータ記憶部に記憶されている上記全体テクスチャとその識別情報および上記テクスチャ座標値に代えて利用するように更新処理を行う更新処理部とを備えたことを特徴とするテクスチャマッピング装置。 It is a texture mapping device that pastes multiple textures, which are piece areas in the entire texture, to multiple faces of a 3D model consisting of polygon meshes.
CG data including the 3D coordinate values of the vertices constituting the face, the texture coordinate values of the vertices constituting the texture attached to the face, and the identification information of the entire texture is stored. A coordinate information acquisition unit that acquires each of the above coordinate information from the CG data storage unit, and
A face flattening unit that flattens each 3D face into each 2D face based on the 3D coordinate value of each face acquired by the coordinate information acquisition unit.
Corresponding texture that is a texture specified based on the texture coordinate values acquired by the coordinate information acquisition unit corresponding to the original 3D coordinate values for each of the 2D faces generated by the face flattening unit. A 2D image generator that generates a reconstructed whole texture, which is a 2D image of the whole texture in which the position of each texture is reconstructed by pasting an image based on.
The reconstructed texture coordinate value, which is the texture coordinate value of each vertex constituting each texture on the reconstructed whole texture, is stored in the CG data storage unit. A texture mapping device including an entire texture, its identification information, and an update processing unit that performs update processing so as to be used in place of the above texture coordinate values.
上記フェイス平面化部により生成された上記2Dの各フェイスが上記全体テクスチャのサイズと合うように、上記2Dの各フェイスのサイズを正規化する正規化部と、
上記正規化部により正規化された2Dの各フェイスに対して上記テクスチャに基づく画像を貼り付ける画像生成部とを備えたことを特徴とする請求項1に記載のテクスチャマッピング装置。 The 2D image generator is
A normalization section that normalizes the size of each face in 2D so that each face in 2D generated by the face flattening section matches the size of the entire texture.
The texture mapping device according to claim 1, further comprising an image generation unit for pasting an image based on the texture on each 2D face normalized by the normalization unit.
上記3Dの各フェイスに貼られたテクスチャの3D空間上での画素間隔を求め、当該求めた画素間隔と、上記フェイス平面化部により生成された上記2Dの各フェイスのサイズとに基づいて、上記再構成全体テクスチャに必要な画素数を算出する必要画素数算出部と、
上記正規化部により正規化された上記2Dの各フェイスで特定される範囲を、上記必要画素数算出部により算出された画素数で分割して格子状に区切り、各格子を上記再構成全体テクスチャの各画素に割り当てる画素構成部とを更に備え、
上記画像生成部は、上記正規化部により正規化された上記2Dの各フェイスに対して、上記画素構成部により構成された各画素ごとに、上記対応テクスチャに基づく色情報を与えることを特徴とする請求項4に記載のテクスチャマッピング装置。 The 2D image generator is
The pixel spacing of the texture attached to each of the 3D faces in the 3D space is obtained, and based on the obtained pixel spacing and the size of each face of the 2D generated by the face flattening unit, the above A required pixel number calculation unit that calculates the number of pixels required for the entire reconstructed texture,
The range specified by each face of the 2D normalized by the normalization unit is divided by the number of pixels calculated by the required pixel number calculation unit and divided into grids, and each grid is divided into grids, and each grid is reconstructed as a whole texture. Further equipped with a pixel component assigned to each pixel of
The image generation unit is characterized in that color information based on the corresponding texture is given to each of the 2D faces normalized by the normalization unit for each pixel configured by the pixel component unit. The texture mapping device according to claim 4.
上記画素構成部により構成された画素の少なくとも一部分に、上記正規化部により正規化された2Dのフェイスが存在するか否かを判定するフェイス存否判定部と、
上記フェイス存否判定部により上記2Dのフェイスが存在すると判定された画素については、上記2Dのフェイスに対応する上記対応テクスチャの色をもとに上記画素の色を決定する一方、上記フェイス存否判定部により上記2Dのフェイスが存在しないと判定された画素については、特定の色で上記画素の色を決定する画素色決定部とを備えたことを特徴とする請求項5に記載のテクスチャマッピング装置。 The above image generation unit
A face presence / absence determination unit that determines whether or not a 2D face normalized by the normalization unit exists in at least a part of the pixels configured by the pixel configuration unit.
For the pixel determined by the face presence / absence determination unit that the 2D face exists, the color of the pixel is determined based on the color of the corresponding texture corresponding to the 2D face, while the face presence / absence determination unit determines the color of the pixel. The texture mapping device according to claim 5, further comprising a pixel color determining unit that determines the color of the pixel with a specific color for the pixel determined to have no 2D face.
上記領域指定部により指定された領域に対して、上記座標情報取得部、上記フェイス平面化部、上記2D画像生成部、上記更新処理部の処理を実行することを特徴とする請求項1〜7の何れか1項に記載のテクスチャマッピング装置。 Further, an area designation unit for designating an area to be processed from the three-dimensional shape of the above 3D model is provided.
Claims 1 to 7 are characterized in that the processing of the coordinate information acquisition unit, the face flattening unit, the 2D image generation unit, and the update processing unit is executed for the area designated by the area designation unit. The texture mapping device according to any one of the above items.
上記フェイスを構成する各頂点の3D座標値、および、上記フェイスに貼り付けられるテクチャを構成する各頂点のテクスチャ座標値の各座標情報と、上記全体テクスチャの識別情報とを含むCGデータを記憶したCGデータ記憶部から、上記各座標情報を取得する座標情報取得手段、
上記座標情報取得手段により取得された各フェイスの3D座標値に基づいて、3Dの各フェイスを2Dの各フェイスに平面化するフェイス平面化手段、
上記フェイス平面化手段により生成された上記2Dの各フェイスに対して、元の3D座標値に対応して上記座標情報取得手段により取得されたテクスチャ座標値に基づいて特定されるテクスチャである対応テクスチャに基づく画像を貼り付けることにより、各テクスチャの位置が再構成された全体テクスチャの2D画像である再構成全体テクスチャを生成する2D画像生成手段、および
上記再構成全体テクスチャとその識別情報、および、上記再構成全体テクスチャ上における各テクスチャを構成する各頂点のテクスチャ座標値である再構成テクスチャ座標値を、上記CGデータ記憶部に記憶されている上記全体テクスチャとその識別情報および上記テクスチャ座標値に代えて利用するように更新処理を行う更新処理手段
として上記コンピュータを機能させるためのテクスチャマッピング用プログラム。 It is a texture mapping program for causing a computer to execute a process related to texture mapping in which a plurality of textures, which are piece areas in the entire texture, are pasted to a plurality of faces of a 3D model composed of polygon meshes.
CG data including the 3D coordinate values of the vertices constituting the face, the texture coordinate values of the vertices constituting the texture attached to the face, and the identification information of the entire texture is stored. Coordinate information acquisition means for acquiring each of the above coordinate information from the CG data storage unit,
A face flattening means for flattening each 3D face to each 2D face based on the 3D coordinate value of each face acquired by the coordinate information acquisition means.
For each of the 2D faces generated by the face flattening means, a corresponding texture is a texture specified based on the texture coordinate values acquired by the coordinate information acquisition means corresponding to the original 3D coordinate values. A 2D image generation means for generating a reconstructed whole texture, which is a 2D image of the whole texture in which the position of each texture is reconstructed by pasting an image based on the above, the above-mentioned reconstructed whole texture and its identification information, and The reconstructed texture coordinate value, which is the texture coordinate value of each vertex constituting each texture on the reconstructed whole texture, is converted into the whole texture stored in the CG data storage unit, its identification information, and the texture coordinate value. A texture mapping program for operating the above computer as an update processing means that performs update processing so that it can be used instead.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018046681A JP6975665B2 (en) | 2018-03-14 | 2018-03-14 | Texture mapping device and texture mapping program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018046681A JP6975665B2 (en) | 2018-03-14 | 2018-03-14 | Texture mapping device and texture mapping program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019159904A JP2019159904A (en) | 2019-09-19 |
JP6975665B2 true JP6975665B2 (en) | 2021-12-01 |
Family
ID=67993482
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018046681A Active JP6975665B2 (en) | 2018-03-14 | 2018-03-14 | Texture mapping device and texture mapping program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6975665B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111127631B (en) * | 2019-12-17 | 2023-07-28 | 深圳先进技术研究院 | Three-dimensional shape and texture reconstruction method, system and storage medium based on single image |
EP4123106A4 (en) * | 2020-03-16 | 2023-08-16 | FUJIFILM Corporation | Image processing device, image processing method, and image processing program |
CN112509105B (en) * | 2020-11-12 | 2024-06-14 | 杭州群核信息技术有限公司 | Building surface paving method and device with continuous textures |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3268665B2 (en) * | 1992-12-08 | 2002-03-25 | 大日本印刷株式会社 | Computer graphics production equipment |
WO2013111195A1 (en) * | 2012-01-27 | 2013-08-01 | 三菱電機株式会社 | Drawing data generation device and image drawing device |
US10249087B2 (en) * | 2016-01-29 | 2019-04-02 | Magic Leap, Inc. | Orthogonal-projection-based texture atlas packing of three-dimensional meshes |
CN108780583A (en) * | 2016-03-15 | 2018-11-09 | 三菱电机株式会社 | Texture mapping unit and texture mapping program |
-
2018
- 2018-03-14 JP JP2018046681A patent/JP6975665B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2019159904A (en) | 2019-09-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4845147B2 (en) | Perspective editing tool for 2D images | |
EP2181433B1 (en) | Methods and apparatus for multiple texture map storage and filtering | |
JP5149288B2 (en) | Composition of ANISOMETRIC texture (TEXTURE) (SYNTHESIS) | |
US9013499B2 (en) | Methods and apparatus for multiple texture map storage and filtering including irregular texture maps | |
JP6975665B2 (en) | Texture mapping device and texture mapping program | |
US6563501B2 (en) | Bicubic surface rendering | |
US7295202B2 (en) | System for approximating and displaying three dimensional CAD data, and system for executing method thereof | |
JP2001052194A (en) | Reconfiguration for curved surface | |
JP3466661B2 (en) | Image processing apparatus and method | |
JP2000182038A (en) | Method for generating perspective sizing data from distorted information, device to be used for this and computer program product | |
JP2010140476A (en) | Image processing method, computer readable medium, and image processing system | |
US8817037B2 (en) | Reconstructing three dimensional oil paintings | |
JP2006190308A (en) | Depth image-based modeling method and apparatus | |
US20190272347A1 (en) | Scalable and precise fitting of nurbs surfaces to large-size mesh representations | |
KR20200056764A (en) | Method for automatically set up joints to create facial animation of 3d face model and computer program | |
WO2018039936A1 (en) | Fast uv atlas generation and texture mapping | |
JPH0636013A (en) | Method and device for generating topographic data | |
JPH11195139A (en) | Sculptured surface generating device, method therefor and providing medium | |
JP2655056B2 (en) | Texture data generator | |
JP7312040B2 (en) | Texture mapping device and program for texture mapping | |
CN114299266B (en) | Color adjustment method and device for model and storage medium | |
JP2011227864A (en) | Viewpoint converting device, method, and program for image | |
JP6634317B2 (en) | Shape deformation device and shape deformation program | |
JP4552115B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP6727932B2 (en) | Curved surface generator by point cloud surface fitting and curved surface generation program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20210203 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20211012 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20211025 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20211108 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6975665 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |