JP2009146368A - Visible collision detection circuit - Google Patents
Visible collision detection circuit Download PDFInfo
- Publication number
- JP2009146368A JP2009146368A JP2007341766A JP2007341766A JP2009146368A JP 2009146368 A JP2009146368 A JP 2009146368A JP 2007341766 A JP2007341766 A JP 2007341766A JP 2007341766 A JP2007341766 A JP 2007341766A JP 2009146368 A JP2009146368 A JP 2009146368A
- Authority
- JP
- Japan
- Prior art keywords
- collision
- identifier
- moving
- cube
- stationary
- 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.)
- Pending
Links
Images
Abstract
Description
この発明は コンピュータグラフィックス技術において物体間の衝突を検出するための手段と、それを実現するための回路の実装に関する。 The present invention relates to a means for detecting a collision between objects in computer graphics technology, and a circuit implementation for realizing the means.
コンピュータグラフィックスのアプリケーションには、物体同士の衝突を含むアニメーションが多く制作されている。従来から衝突検出は、アプリケーションプロセッサ(以下APという)側のプログラミングによるバウンダリーボックスや物体のツリー構造法に基づき高速処理が図られてきた。実時間描画が必要なゲーム等のアニメーションでは、これら衝突検出の計算負荷は極めて大きい。このためCG映像の現実感や実時間描画を得るためには、描画量の増加と物理モデル等の複雑系処理等が必須であり、APの負荷は今後一層深刻となる。正確な衝突検出をAP側のソフトウエアで対応する限り、高速化とデータ量削減との相反する問題を解決しなければならない問題をこれまでに抱えていた。 Many computer graphics applications have produced animations involving collisions between objects. Conventionally, collision detection has been performed at high speed based on a boundary box or object tree structure method by programming on the application processor (hereinafter referred to as AP) side. In an animation such as a game that requires real-time drawing, the calculation load of these collision detections is extremely large. For this reason, in order to obtain the realism and real-time drawing of CG video, an increase in the drawing amount and complex system processing such as a physical model are essential, and the load on the AP will become more serious in the future. As long as accurate collision detection is supported by the software on the AP side, there has been a problem that has to solve the conflicting problem between speedup and data volume reduction.
本発明はAPに実装されるプログラムを用いて物体間の衝突を検出するのではなく、ピクセルシェーダーあるいはラスタライザーと言われるレンダラー側のハードウエアで衝突を検出する。AP側から衝突検出処理を無くし、APは一般描画と同じ物体プリミティブ(ポリゴン)をレンダラーに出力するのみとし、ハードウエアによって衝突検出を行うことでAPの負荷の軽減と描画の高速化を図ることが本発明の課題である。 In the present invention, the collision between objects is not detected using a program installed in the AP, but the collision is detected by hardware on the renderer side called a pixel shader or a rasterizer. By eliminating collision detection processing from the AP side, the AP only outputs the same object primitives (polygons) as the general drawing to the renderer, and reduces the load on the AP and speeds up the drawing by performing collision detection by hardware. Is the subject of the present invention.
レンダラーには通常、ポリゴン描画、テキスチャマッピング、環境マッピング、照明のためのシェーダー等がハードウエア実装されている。本発明はこれらグラフィックスプロセッサが具備する既存の機能群と同化した構造で物体間衝突検出回路を導入する。 The renderer is usually implemented with hardware such as polygon drawing, texture mapping, environment mapping, and a shader for illumination. The present invention introduces a collision detection circuit between objects with a structure assimilated with the existing function group included in these graphics processors.
視覚的に物体が衝突しているか否かは、衝突箇所に遮蔽物体がなければ複数の視角から物体を眺めることで認知できる。このアルゴリズムとして描画空間全体を取り囲む6面体(立方体あるいは直方体のいずれかで、以下Cubeという)を設定し、これら6面からCube内部を見て、動く物体(以下動体という)と他の物体(以下静体という)との接触の可否を検査することで衝突が認知できる。このため描画空間全体を仮想的にCubeで囲み、Cubeのそれぞれの面にはCube外部から内部を投影した画像を写像し、この6面分の写像図をCubeパターンとして保存する。衝突箇所が完全に遮蔽された空間内でない限り、複数の面から見て、動体と静体とが重なり合っていれば衝突と見なすことができる。これは人間が視覚的に物体衝突を認知するプロセスと同じである。 Whether the object is visually colliding can be recognized by looking at the object from a plurality of viewing angles if there is no shielding object at the collision location. As this algorithm, a hexahedron (either a cube or a cuboid, hereinafter referred to as Cube) surrounding the entire drawing space is set, and a moving object (hereinafter referred to as a moving object) and another object (hereinafter referred to as a moving object) are viewed from inside these Cubes. Collisions can be recognized by examining the possibility of contact with a still body. For this reason, the entire drawing space is virtually surrounded by Cube, and images of the inside projected from the outside of the Cube are mapped onto each surface of the Cube, and mapping maps for these six planes are stored as Cube patterns. Unless the collision point is in a completely shielded space, it can be regarded as a collision if the moving body and the stationary body overlap each other when viewed from a plurality of surfaces. This is the same process in which humans visually recognize object collisions.
前記Cubeそれぞれの6面にCube内部の映像を投影する手段として本発明では、6面それぞれに直交する座標軸上から並行投影でCube内部画像を、隠面消去法を用い6面それぞれに描画する。投影中心がCubeの内部と外部、あるいは透視投影と並行投影の違いを除くと、この方法はレンダリング前に予め作成される環境マッピング技術の環境Cube生成法と類似する。 In the present invention, as a means for projecting an image inside the Cube on each of the six surfaces of the Cube, a Cube internal image is drawn on each of the six surfaces by parallel projection from a coordinate axis orthogonal to each of the six surfaces. If the projection center is the inside and outside of the Cube, or the difference between perspective projection and parallel projection is excluded, this method is similar to the environment Cube generation method of the environment mapping technique created in advance before rendering.
環境マッピング同様に動く物体が生じれば、その都度Cubeパターンは再生成しなければならない。これは6面分の描画となり負荷が大きい。本発明ではこれを避けるため全ての描画物体を、動体と静体とにそれぞれ分け、静体のみをCube6面それぞれに予めパターンとして作成する。画像表示段階では、静体を先に、次に動体をレンダリングする。動体のポリゴンを内挿補間する段階で、補間点が静体と交差するか否かを、Cube6面それぞれのパターン(以下画像情報という)と比較し判定する。この判定には動体の内挿補間点を6面それぞれの座標系に変換し、面の画像と内挿補間点がオーバーラップするか否かのテストを行う。 The Cube pattern must be regenerated each time a moving object occurs as in the environment mapping. This is a drawing for 6 faces, and the load is large. In the present invention, in order to avoid this, all drawing objects are divided into a moving object and a static object, and only the static object is created in advance as a pattern on each of the Cube 6 surfaces. In the image display stage, the static object is rendered first, and then the moving object is rendered. At the stage of interpolating the polygon of the moving object, whether or not the interpolation point intersects with the static object is determined by comparing with the patterns on the Cube 6 surfaces (hereinafter referred to as image information). For this determination, the interpolation point of the moving object is converted into the coordinate system of each of the six surfaces, and a test is performed to determine whether or not the surface image and the interpolation point overlap.
遮蔽物体がなければCube画像情報と内挿補間点とのxy座標の重なりテストのみであり、画像情報として記憶する情報は、環境マッピングのような色情報は必要ない。記憶される情報は画素あたり1ビットの画像の有無を示すフラグと静体の識別子のみとなる。衝突が検出された場合APに戻す値は、動体と静体それぞれの識別子と、衝突点の3次元座標値となる。これにより、衝突物体名と位置がAP側で判断できる。動体と静体とを分離することによって、大半を占める静体のCubeへの書き込みは前処理1回のみとなる。 If there is no shielding object, only the xy coordinate overlap test between the Cube image information and the interpolation point is performed, and the information stored as the image information does not need color information such as environment mapping. The information stored is only a flag indicating the presence or absence of a 1-bit image per pixel and a still body identifier. When a collision is detected, the values returned to the AP are the identifiers of the moving object and the stationary object, and the three-dimensional coordinate value of the collision point. Thereby, the collision object name and position can be determined on the AP side. By separating the moving body and the stationary body, writing of the stationary body, which occupies the majority, to the Cube is performed only once.
動体が複数存在した場合、動体間の衝突の検出も必要となる。本発明は複数の動体がある場合、動体専用の6面Cubeを別途用意し、内挿補間時に衝突検出処理と並行してこのCubeに描画する。静体と動体Cubeそれぞれをテストすることで静体の再描画を不要とする。 When there are a plurality of moving objects, it is also necessary to detect a collision between the moving objects. In the present invention, when there are a plurality of moving objects, a six-surface Cube dedicated to the moving object is separately prepared and drawn on the Cube in parallel with the collision detection process at the time of interpolation. By testing each of the stationary body and the moving body Cube, redrawing of the stationary body becomes unnecessary.
動体のCubeを定義する場合、複数の動体を纏めて1組のCubeに書くか、動体毎にそれぞれ専用のCubeを作成するかは同時に動く物体数あるいはハードウエア・コストに関係する。動体数が多く、一時的に動くものと、常時動くものがある場合には、それぞれの物体毎にCubeを作成することによって効率を図ることができる。この場合は動体のためのCubeは動体を取り囲む空間サイズでよい。 When defining a moving object Cube, whether a plurality of moving objects are collectively written in a set of Cube or a dedicated Cube is created for each moving object is related to the number of moving objects or the hardware cost. If there are a large number of moving bodies, and there are those that move temporarily and those that move constantly, efficiency can be achieved by creating a Cube for each object. In this case, Cube for a moving body may be a space size surrounding the moving body.
静体Cube画像情報を前処理で求めておくことは本発明の高速化の条件である。表示(レンダリング)段階では静体、動体のいずれの描画順でもよいが、静体を描画した後に動体を描画し、この動体描画時にのみ衝突検出処理を行うことで高速化が可能となる。実時間アニメーションでは1/30秒あるいは1/60秒以内で1フレームを描画するため、フレーム内で検出が可能となればよい。本発明では映像の描画中に、内挿補間処理の一つとして衝突を検出し、これをAPに戻すため(衝突が生じてから)1フレーム分の遅れをもって、APは次の映像を決定することになる。 It is a condition for speeding up the present invention that static body Cube image information is obtained by preprocessing. In the display (rendering) stage, the drawing order of either a static object or a moving object may be used. However, the dynamic object is drawn after the static object is drawn, and the speed can be increased by performing the collision detection process only at the time of the dynamic object drawing. In real-time animation, one frame is drawn within 1/30 seconds or 1/60 seconds, and it is only necessary to be able to detect within a frame. In the present invention, during video rendering, a collision is detected as one of interpolation processes, and this is returned to the AP (after the collision occurs), the AP determines the next video with a delay of one frame. It will be.
レンダリング時の座標系は任意の視野方向をもつ視点座標系である。内挿補間点のCube6面の画像情報とのオーバーラップ・テストは、内挿補間点座標値をCube面それぞれの座標系に変換する。視点方向が任意角の場合は3次元回転が必要となる。内挿補間点毎の回転計算の負荷を避けるため、本発明ではCubeをワールド座標で定義しCubeの6面はそれぞれxy、yz、xz面と平行とすることで回転計算を削減する。 The coordinate system at the time of rendering is a viewpoint coordinate system having an arbitrary visual field direction. In the overlap test with the image information of the Cube 6 surface of the interpolation point, the interpolation point coordinate value is converted into the coordinate system of each Cube surface. When the viewpoint direction is an arbitrary angle, three-dimensional rotation is required. In order to avoid the load of rotation calculation for each interpolation point, in the present invention, Cube is defined by world coordinates, and the six planes of Cube are parallel to the xy, yz, and xz planes, respectively, thereby reducing the rotation calculation.
また本発明では、動体のポリゴン頂点に視点系座標値と共に、ワールド座標値を付加し、これを同時にレンダリングし、視点座標値は描画に、一方ワールド座標値はCube座標との衝突検出に用いることで面毎の回転計算処理を省き置換処理で対応する。 Also, in the present invention, a world coordinate value is added to a polygon vertex of a moving object together with a world coordinate value, and this is rendered at the same time, and the viewpoint coordinate value is used for drawing, while the world coordinate value is used for collision detection with a Cube coordinate. Therefore, the rotation calculation process for each surface is omitted and the replacement process is used.
6面のいずれから見ても視点との間に遮蔽物がない場合は、互いに直交するCube3面以上で交差していれば衝突の検出ができる。遮蔽物がある場合は追加情報が必要となる。本発明では複雑な形状同士の衝突を検出する手段として、静体のZ値(Cube面からの距離)、静体の識別子および静体画像の有無を示すフラグをそれぞれCube画像情報として記憶する。衝突判定は内挿補間点が、全てのCube面で同一の識別子である静体とオーバーラップしている場合はその静体と衝突となる。また対面する面同士で動体が同一の識別子をもつ静体とオーバーラップし、いずれもZ値比較において静体の後方に位置する場合も衝突と見なすことができる。Cube面によっては複数の物体が遮蔽する場合があり、内挿補間点でCube面のそれぞれの識別子が異なる場合がある。この場合は動体のZ値とオーバーラップする静体のZ値と比較し、動体が静体に対してCube面(手前)側に位置する場合は、静体とは衝突がないとする。一方、動体のZ値が静体の内側(遠方)に位置するCube面とそれぞれ直交する他のCube4面でも動体が同一識別子(これを識別子Aとする)をもつ物体の遠方でオーバーラップしている場合は衝突。さらに、多数の面で同一識別子Aと遠方でオーバーラップするものの識別子の異なる物体(以下遮蔽体という)ともCube面のいずれかでオーバーラップしていた場合、動体と遮蔽体とのそれぞれのZ値を比較し、動体のZ値が遮蔽体よりCube面から遠方にある場合は、識別子Aの物体とは衝突、手前にある場合は衝突していないものとする。 When there is no shielding object between the viewpoints when viewed from any of the six surfaces, a collision can be detected as long as they intersect at or above the Cube3 surfaces that are orthogonal to each other. If there is a shield, additional information is required. In the present invention, as means for detecting a collision between complex shapes, the Z value (distance from the Cube surface) of the still body, the identifier of the still body, and the flag indicating the presence or absence of the still body image are stored as Cube image information. In the collision determination, when the interpolation point is overlapped with the still body having the same identifier on all the Cube surfaces, the collision is made with the still body. In addition, a moving body overlaps with a stationary body having the same identifier between the faces facing each other, and both of them are positioned behind the stationary body in the Z value comparison, and can be regarded as a collision. Depending on the Cube surface, a plurality of objects may block, and the identifier of the Cube surface may be different at the interpolation point. In this case, the Z value of the moving body is compared with the Z value of the overlapping still body. When the moving body is located on the Cube surface (front side) side with respect to the stationary body, it is assumed that there is no collision with the stationary body. On the other hand, the moving object also overlaps in the distance of the object having the same identifier (this is referred to as identifier A) in the other Cube4 planes, each of which is orthogonal to the Cube plane located inside (distant) of the stationary object. If there is a collision. Furthermore, when the same identifier A on a large number of surfaces overlaps in the distance but an object with a different identifier (hereinafter referred to as a shield) overlaps on either of the Cube surfaces, each Z value of the moving object and the shield If the Z value of the moving object is farther from the Cube surface than the shield, it is assumed that it collides with the object of the identifier A, and does not collide when it is in front.
動体描画のリフレッショは映像表示のための走査フレーム単位で行われる。動体が静体(描画が終了した動体も静体と定義する)と衝突する場合は、Cube面から見て動体の一部が静体と交差した状態となる。動体が極めて高速に移動し1/60秒以内で静体を通り抜ける場合は通常衝突検出不能となるが、互いの物体が交差状態にあれば動体と静体のZ値とを動体の内挿補間時で画素毎に差分すれば、ある箇所で差分符号は背後から手前あるいはその逆に変化する。この変化時を捕えて衝突と見なすことができる。このために、動体の内挿補間段階で前記静体のZ値および識別子を読み出し、内挿補間Z値と前記読み出したZ値をそれぞれ比較する。 Reflection of moving object drawing is performed in units of scanning frames for video display. When a moving body collides with a stationary body (a moving body that has finished drawing is also defined as a stationary body), a part of the moving body intersects the stationary body when viewed from the Cube surface. When a moving object moves at a very high speed and passes through a still body within 1/60 seconds, it is usually impossible to detect a collision. However, if each object is in an intersecting state, interpolation of the moving object and the Z value of the moving object is performed. If there is a difference for each pixel in time, the difference code changes from behind to the front or vice versa at a certain point. This change can be caught and regarded as a collision. For this purpose, the Z value and identifier of the stationary body are read out at the interpolation stage of the moving object, and the interpolation interpolation Z value and the read Z value are respectively compared.
衝突検出によるAPへの戻し情報として[008]では、レンダラーは衝突それぞれの物体識別子と衝突位置を返すものとした。一方、衝突によって跳ね返りや静体が衝突によって移動する場合には、動体の動き方向、動体および静体それぞれの衝突点の面法線、質量や弾性等の物体の属性が必要となる。物体の速度や属性は識別子によってそれを所有し、制御しているAP側で高速に判断できるが、衝突時点の動き方向や面法線はレンダラー側あるいはグラフィックス・エンジン内の中間処理段階で時系列的変化を伴って生成されている場合があり、これをAP側で求めようとすると、衝突点から形状モデルの幾何学的展開が必要となる。この負荷は極めて大きい。本発明では、識別子や衝突位置に加えて、衝突点の動体および静体の面法線および動体の進行方向ベクトルをAPに返す。 In [008] as return information to the AP by collision detection, the renderer returns the object identifier and collision position of each collision. On the other hand, when the rebound is caused by the collision or the stationary body is moved by the collision, the attributes of the object such as the moving direction of the moving body, the surface normal of the collision point of each of the moving body and the stationary body, and mass and elasticity are required. The speed and attributes of an object are owned by an identifier, and can be judged at high speed on the controlling AP side. However, the direction of movement and surface normal at the time of collision can be determined at the renderer side or at an intermediate processing stage in the graphics engine. There is a case where it is generated with a series change, and if it is to be obtained on the AP side, geometrical development of the shape model is required from the collision point. This load is extremely large. In the present invention, in addition to the identifier and the collision position, the moving body and stationary surface normals of the collision point and the moving direction vector of the moving body are returned to the AP.
前記手段として、動体の面法線は通常のシステムで多角形頂点データあるいは法線マップとして内挿補間処理に含まれており衝突検出段階で衝突点での面法線を得ることができる。また動体の動き方向は、これに基づきエンジン側で動体の次の座標値が決定されており、フレームサイクル毎のアップデートな情報として、レンダラーに動きベクトルを出力すれば、これをレンダラー側からAPに返すことができる。一方、静体の衝突点の面法線は、予め静体を記憶したCube面情報として追加記憶する。以上から本発明ではCube画像情報としてフラグ、識別子、z座標値、面法線を記憶する手段をもつ。 As the means, the surface normal of the moving object is included in the interpolation processing as polygon vertex data or normal map in a normal system, and the surface normal at the collision point can be obtained at the collision detection stage. Based on this, the next coordinate value of the moving object is determined on the engine side, and if the motion vector is output to the renderer as updated information for each frame cycle, this is sent from the renderer side to the AP. Can return. On the other hand, the surface normal of the collision point of the stationary body is additionally stored as Cube surface information in which the stationary body is stored in advance. As described above, the present invention has means for storing a flag, an identifier, a z-coordinate value, and a surface normal as Cube image information.
静体の面法線は衝突の際にのみ必要であることから、Cube画像情報のような高速読み出しに2次元メモリ構造は必要がなく、低速1次元バッファでもよい。さらにLOD(Level of Detail)については、衝突箇所を厳密に1画素単位で検出が必要であるかどうかの問題がある。本発明でもアプリケーションに対応した解像度対コストの最適化を考慮すると、Cube面静体情報としてはパターンサイズを表示解像度の1/4から1/16程度とすることで、Cube面情報のメモリコストは大幅に削減可能となる。 Since the surface normal of the stationary body is necessary only at the time of collision, a two-dimensional memory structure is not necessary for high-speed reading such as Cube image information, and a low-speed one-dimensional buffer may be used. Further, with respect to LOD (Level of Detail), there is a problem as to whether or not a collision point needs to be detected strictly in units of pixels. In the present invention, considering the optimization of the resolution versus cost corresponding to the application, the memory cost of the Cube surface information can be reduced by setting the pattern size to about 1/4 to 1/16 of the display resolution as the Cube surface still body information. Significant reduction is possible.
以上から本発明は、物体間の衝突を検出する手段として、検出対象となる映像表示空間を取り囲む6面体を定義し、それぞれの面の外部から空間内部を見た空間内部の静止物体を6面のそれぞれに投影し、投影された物体の有無フラグ、識別子、Z値、法線をそれぞれ画像情報として6面分レンダリング前に生成・記憶する手段と、映像を表示するレンダリング段階において、動体の内挿補間時に内挿補間点を6面それぞれの座標系に変換して、前記6面内にある静体のフラグ、識別子、Z値、法線を読み出し、内挿補間点のオーバラップの有無や、その点での静止物体の識別子やZ値から内挿補間点の衝突を判定する手段と、動く物体の方向や法線、また衝突される物体のそれぞれの法線から、衝突するそれぞれの物体の衝突後の動きを求めるための情報をAPに出力する手段のそれぞれからなる可視化衝突検出回路となる。 As described above, the present invention defines a hexahedron surrounding the image display space to be detected as means for detecting a collision between objects, and six stationary objects inside the space as viewed from outside the respective surfaces. Means for generating / storing the presence / absence flag, identifier, Z value, and normal of the projected object as image information for each of the six planes before rendering, and in the rendering stage for displaying video, At the time of interpolation, the interpolation point is converted to the coordinate system of each of the six planes, the flag, identifier, Z value, and normal line of the still body in the six planes are read, , Means for determining the collision of the interpolation point from the identifier or Z value of the stationary object at that point, the direction and normal of the moving object, and the respective normals of the colliding object Motion after collision The visualization collision detection circuit comprising a respective means for outputting order information to the AP.
本発明により、コンピュータグラフィックスにおける物体間の衝突を、アプリケーションプロセッサ側のソフトウエアではなく、レンダラーのハードウエアあるいは組込ソフトウエアにより検出することで、アプリケーションプロセッサの演算負荷が低減し、描画の高速化が可能となり、実時間描画システムに有効となる。 According to the present invention, collision between objects in computer graphics is detected not by the software on the application processor side but by the renderer hardware or embedded software, thereby reducing the computational load on the application processor and increasing the drawing speed. This is effective for a real-time drawing system.
本発明の回路はグラフィックスLSIに実装するか、IP(Intelligent Property)としての形態で実施される。 The circuit of the present invention is mounted on a graphics LSI or implemented as an IP (Intelligent Property).
以下、本発明の実施例を説明する。図1に本発明に係わるCubeを示す。図1AではCubeの6面をそれぞれ前面、後面、右面、左面、上面、下面と定義する。Cube面に投影される画像は、それぞれの面の外側から矢印で示す方向に内部を見た内部物体の画像であり、これら画像情報をそれぞれ記憶する。この画像は面に垂直な並行投影図とし、それぞれの面に最も近い物体の画素を隠面消去で描画する。またCubeのそれぞれの面を平面上に展開すると図1Bの関係となる。本発明では、画像情報は色情報ではなく投影された物体の有無フラグ、識別子、Z値、法線となる。 Examples of the present invention will be described below. FIG. 1 shows a Cube according to the present invention. In FIG. 1A, the six surfaces of Cube are defined as a front surface, a rear surface, a right surface, a left surface, an upper surface, and a lower surface, respectively. The image projected on the Cube surface is an image of an internal object viewed from the outside in the direction indicated by the arrow from the outside of each surface, and stores the image information. This image is a parallel projection perpendicular to the surface, and the pixel of the object closest to each surface is drawn by hidden surface removal. Moreover, when each surface of Cube is developed on a plane, the relationship shown in FIG. 1B is obtained. In the present invention, image information is not color information but a projected object presence / absence flag, an identifier, a Z value, and a normal line.
図2は本発明に係わる静止物体と動く物体との、Cube面20における位置関係(6面図)を示したものである。図2Aで灰色の球体21は、すでにCubeに記憶された静体、黒い小球体22は動体を示す。球体22はCube面に描画した図形ではなく、レンダリング時の内挿点位置を示す。Cube上面の白い小球体は球体22が物体(図では21)の背後に位置することを示す。また図2Aでは、静止物体21と動体22以外には物体がない状態となる。図2Aにおいて全ての面で静止物体21と動体22の一部がオーバーラップしている。オーバーラップとはxy座標軸上の重なりを意味するものとする。本発明の衝突の検出手順は以下となる。
動体22の内挿補間毎に補間点をCube6面の座標系に変換し、それぞれの面から静体の有無を示すフラグおよび識別子を読む。全ての面の識別子が同一で且つ、全ての面で動体22がオーバーラップしていれば動体22は静体21と衝突しているとする。内挿点がワールド座標系で与えられている場合は、Cube6面の座標変換は簡素化される。FIG. 2 shows the positional relationship (6 plane view) on the
For each interpolation of the moving
一つの面、例えばCube下面において直交する4面、すなわち上面を除く全ての面で物体22の内挿点が同じ識別子を持つ静体とそれぞれオーバーラップしている場合も衝突と見なすことが出来る。
一方、それぞれの対面する面(上下面、左右面あるいは前後面のいずれか)に対し、動体の内挿点のZ値と、静体のZ値とを比較する。対面する面の双方で物体22の内挿点が、同一識別子となる静体21で共に後方に位置した場合は内挿点は物体21の内部の点と見なすことができ、衝突状態と判断される。
図2Bは物体22と物体21の別の関係図を示す。前記衝突判断の方法の一つとして、Z値を用いない方法によれば衝突に該当しない。Z値を用いる方法では、図2Bにおいて対面するZ値の比較結果で物体22が物体21の遠方に共に位置しない。例えば後面では物体22は物体21の背後に位置するが、後面に対面する前面において物体22は物体21の前方に位置し、条件を満たさない。他の面では物体21と物体22とはオーバーラップをしている物体がない。この結果動体22は衝突していないと判断できる。One surface, for example, four surfaces orthogonal to the lower surface of the Cube, that is, all surfaces except the upper surface, can be regarded as a collision when the interpolation point of the
On the other hand, the Z value of the interpolation point of the moving object is compared with the Z value of the stationary object for each facing surface (any one of the upper and lower surfaces, the left and right surfaces, and the front and rear surfaces). When the interpolation point of the
FIG. 2B shows another relationship diagram between the
図3は本発明に係わる遮蔽物体がある場合の関係を示す。図3AにおいてCube面30に記憶された静体は灰色球体31と3角平面体33で、動体(黒丸)を32とする。動体32の図形は前記同様に、Cube面に記憶されているのではなく静体との位置関係を示す。図3Aにおいて、それぞれの物体はCube前面を基準に調べれば、最も手前に3角形体33があり、その背後に動く物体32が、さらにその後方に球体31がある。動体32は静体33とオーバーラップする。前面と直交する他の4面を調べると、上下、左右面ではいずれも3角形体33と同一識別子をもつ物体とのオーバーラップがない。よって静体33とは衝突はないものと判断される。また対面に位置する後面では、動体32は3角形体33とオーバーラップしている。しかしここではZ値比較の結果、3角形体33の手前に位置し衝突の条件を満たさない。
さらに後面では、動体32は静体31とオーバーラップする点があり、この点での識別子は31となる。後面と直交する4面は左右、上下であるが、これらには31と同一識別子でオーバーラップする面はない。よって動体32は衝突する物体はないと判断される。FIG. 3 shows the relationship when there is a shielding object according to the present invention. In FIG. 3A, the still body stored in the
Further, on the rear surface, the moving
一方、図3Bでは図3Aと同様に動体32はCube前面で、静体33とオーバーラップしており、動体32は33の背後に位置する。読みだされる識別子は3角形体33となる。次にこの面と直交する4面とテストすると、3角形体33の識別子をもつ物体とのオーバーラップは他に検出されない。一方、Cube後面では静体31とオーバーラップし、静体31に対してCube後面に直交する4面をテストする。動く物体32の内挿点がこれら4面にある物体31とすべてオーバーラップしていることが判定でき動体32は、静体31と衝突していると判断できる。これは左右あるいは上下のCube対面でのテスト(それぞれの面で同一識別子をもち、且つ動体は背後に位置する)によっても検出できる。 On the other hand, in FIG. 3B, as in FIG. 3A, the moving
図4は本発明に係る遮蔽物体に囲まれた場合のCube面40を示す。遮蔽物体41は底面と前面のない立方体形状とする。遮蔽物体41と、灰色球体42は静体とし、動体43が内挿補間されている。前面で動体43は静体42とオーバーラップしている。前面と直交する4面を調べると、動体43は上面、左右面はいずれもCube前面とは異なる識別子をもつ静体41とのオーバーラップであり、静体42の識別子と同じものは下面のみとなる。しかし動体43は、上面、左右面でオーバーラップする静体41に対し全て背後となる。Z値との比較により、動体とオーバーラップする同一識別子をもつものが2つ以上あり、その位置はその識別子の物体の背後に位置し(図では42)、且つ、それ以外の識別子をもつ物体(図では41)とのオーバーラップにおいて、それらとは全て背後に位置している場合は衝突と見なす。一方、静体41と動体43との関係で、Cube後面を基にテストをした場合、動体43は静体41の背面にあり、それと対面するCube前面、あるいはCube後面に直交する4面に対してZ値テストを行うと、動体43はいずれか(前面あるいは下面)で静体41の前方となり、衝突の条件を満たさない。一つでも同一識別子をもつ静止物体上で動体のZ値が手前にあるとすれば、その識別子をもつ物体との衝突と見なさない。 FIG. 4 shows a
本発明では、動体とオーバーラップする物体全てが同一識別子をもっており、また動体が全て、その背後に位置する場合、すなわち静止物体の内部に動体が位置する場合は衝突と見なしている。よって内部が空洞で動体がその中に浮かんで位置する場合は、衝突が内部で生じていなくても衝突と見なされる。このような幾何学的関係においては可視化方式であるかぎり対応はできない。一方、図4において静体41は底面もあるとするとCube下面の動体は静体41の背後となり動体43の黒丸は白丸となる。よって静体42と動体43の関係を示す面情報はCube前面のみとなる。ここで動体43を内挿補間する過程で動体43のZ値が最も手前に位置(可視化可能な位置)する一部の画素を有し、また一部の画素が物体42の背後に移動する関係(あるいはその逆でも同じ)となった場合は、動体43の一部が静体42にのめり入り込んでいることを意味する。この結果物体42と43は衝突と見なすことができる。 In the present invention, all objects that overlap the moving object have the same identifier, and if all the moving objects are located behind them, that is, if the moving object is located inside a stationary object, it is regarded as a collision. Therefore, when the inside is a cavity and the moving body is floating inside, it is regarded as a collision even if the collision does not occur inside. Such a geometric relationship cannot be handled as long as the visualization method is used. On the other hand, in FIG. 4, if the stationary body 41 also has a bottom surface, the moving body on the lower surface of the Cube is behind the stationary body 41 and the black circle of the moving
図5は本発明の衝突検出システム図を示す。Cubeそれぞれの面から見た静止物体の投影画像情報は2次元のパターンとしてメモリ52の0−5に予め記憶される。これら情報は、面に最も近い物体の識別子ID0−5、Z値Zd0−5、面法線Nd0−5および静止物体有無フラグfd0−5のそれぞれである。但し、面法線は2次元パターンでなくてもよい。
物体は通常、多数のポリゴンで構成されている。またポリゴンは頂点座標値列でデータ化されている。このポリゴン列から物体の映像を描画するために、まずポリゴン内部を塗りつぶすための内挿補間回路50にポリゴン頂点列を与える。内挿補間回路50ではポリゴン内部の内挿点座標値Xs,Ys,Zsおよび面法線を順次、またIDsは物体あるいはポリゴン毎に1度出力する。この座標値は視点座標系で求められており、この位置をCube6面座標系のそれぞれへ座標変換回路51で座標変換する。回路51ではメモリ52の6面のそれぞれのXYアドレスXd0−5,Yd0−5を出力する。これらのアドレスでメモリ52からは、メモリに記憶されている前記識別子IDd0−5、Z値Zd0−5、面法線Nd0−5および静止物体有無フラグfd0−5を読みだす。ポリゴンの頂点座標値が視点座標系だけでなく、ワールド座標系の両方で定義し両者を同時に回路50で内挿補間すれば座標変換回路51ではCube6面座標系変換は極めて簡素化される。これら情報は次に衝突検出回路53に加わる。回路53には座標変換回路51で求めた内挿補間点のCubeそれぞれの面に対応するZ値Z0−5も与えられる。衝突検出回路ではこれらの情報を基に[023]から[028]までの条件に対応した衝突の検出処理を行う。FIG. 5 shows a collision detection system diagram of the present invention. The projection image information of the stationary object viewed from each surface of the Cube is stored in advance in the
An object is usually composed of a large number of polygons. Polygons are converted into data in a vertex coordinate value sequence. In order to draw an image of an object from this polygon row, first, a polygon vertex row is given to the interpolation circuit 50 for painting the inside of the polygon. The interpolation circuit 50 sequentially outputs the interpolation point coordinate values Xs, Ys, Zs and the surface normal inside the polygon, and IDs is output once for each object or polygon. This coordinate value is obtained in the viewpoint coordinate system, and this position is coordinate-converted by the coordinate conversion circuit 51 to each of the Cube 6 plane coordinate systems. The circuit 51 outputs the XY addresses Xd0-5 and Yd0-5 of the six surfaces of the
前記図5の衝突検出回路53の内部構成を図6に示す。前記図5のメモリ52から読みだされたそれぞれ6組の識別子IDd0−5、Z値Zd0−5、面法線Nd0−5および静止物体有無フラグfd0−5の内、有無フラグfd0−5と識別子IDd0−5は、有無フラグ・識別子選択回路60に加えられる。ここでは有無フラグが立っている、すなわち静体が存在するメモリ52の面0−5の識別子IDd0−5をそれぞれ選択する。回路60では0−5面それぞれに対応するレジスタを設け、ここに識別子と有効ビットを記憶する。有無フラグがなければレジスタには無効ビットがセットされる。前記図5において内挿点から6面座標に変換した座標値のうちZ値Z0−5と、メモリ52から読みだしたZ値Zd0−5はZ値比較回路61に与えられる。ここではZ0−5がZd0−5の手前にあるか、背後にあるかの差分符号をそれぞれ求め、その結果を衝突ID検出回路62に出力する。回路62では、前記選択回路60での結果を受けて、有効ビットが立っている識別子のみを選択し、同一識別子同士で、また回路61からのZ値比較結果と合せて、衝突の有無を前記[024]から[028]のそれぞれの条件に沿って判定する。この判定には同一識別子が存在する面番号と、その面に対応するZ値比較符号を判定テーブルに加える等の手段で容易に判断できる。すなわち、最大取りうる組み合わせとして、面情報が6ビット(このうち有効で且つ同一識別子のある面を1ビットとする)であり、またZ値比較結果は6ビットであるため、組み合わせとして合計12ビットとなる。テーブルは4096のアドレスと1ビットの衝突を示す出力をもつ容量でよい。この出力でテスト中の識別子を回路62から出力する。同時にマルチプレクサ回路63では、テスト中の識別子をもつ面番号の一つを回路62から受け、それぞれの面の6種類の静止物体の衝突点の面法線から、所定の面の面法線Ndを選択する。また内挿点の座標値XYZ、面法線Ns、物体の動き方向ベクトルMsを、マルチプレクサ回路を通して出力する。回路62において、複数の識別子が存在した場合は、逐次それぞれの識別子毎に6面分を走査し、同一識別子を検出して、その面のフラグを立て、前記同様にテーブルに加えることで対応できる。 FIG. 6 shows the internal configuration of the
一方、識別子とZ値判定からだけでは衝突の検出ができない場合がある。前記[015]の条件においては、動く物体を内挿補間している1画素前の情報(識別子とZの差分結果)を6面それぞれに対応したバッファを用いて記憶し、Z値が同一識別子上で前面から背後に変化した時点を検出する。図6の履歴回路64では静止物体有無フラグ、識別子、Z差分結果情報を受ける回路62から、内挿補間毎に6面それぞれの静止物体有無フラグ、Z値差分符号と、識別子を記憶し、新しく補間されて回路62に入力し、さらに回路64に送出される前記情報を比較し、動く物体の画素点が同一静止物体の前面から内部に移った場合を衝突として回路62に信号を送り、その時点での前記[029]に記載の識別子や法線等を出力する。 On the other hand, there is a case where collision cannot be detected only from the identifier and the Z value determination. In the condition of [015], information (pixel difference result) of one pixel before interpolating a moving object is stored using a buffer corresponding to each of the six surfaces, and the Z value is the same identifier. Detects when the top changes from front to back. The
一方、静止物体は予め表示のための描画を行う前に画像情報として記憶したが、動く物体が複数存在する場合は、表示描画段階で静止物体同様の6面Cubeを別途作成し、ここに動体をそれぞれの面に投影して記憶する。このため本発明では動体の6面Cube画像情報は静止物体の情報とは異なりフレーム毎にリフレッシュし再描画する。回路としては図5のメモリ52にテンポラリなメモリが増設されることになり、衝突検出回路への出力信号も増加するが、衝突検出方式は静止物体との衝突と変わらず、何れか一方、あるいは双方で衝突が検出されれば、所定の情報を出力する。
以上のそれぞれの手段とから、本発明では物体間を6面から視覚的に捉え衝突の検出が可能な範囲で、衝突を検出するハードウエア化に適した方式となる。On the other hand, a stationary object is stored in advance as image information before drawing for display. However, when there are a plurality of moving objects, a six-surface Cube similar to the stationary object is separately created at the display drawing stage, Is projected onto each surface and stored. Therefore, in the present invention, the six-surface Cube image information of the moving object is refreshed and redrawn for each frame, unlike the information of the stationary object. As a circuit, a temporary memory is added to the
With each of the above means, the present invention is a method suitable for hardware detection of collision within a range in which collision between objects can be visually detected from six surfaces and collision can be detected.
本発明の回路はIP(Intelligent property)として提供したり、グラフィックスプロセッサLSIに実装されることで、CG映像製作やアムーズメントシステムに利用される。 The circuit of the present invention is provided as an IP (Intelligent property) or mounted on a graphics processor LSI so that it can be used for CG video production and an amusement system.
図1
10 立方体
11 立方体平面展開図
図2
20 立方体平面展開図
21 静止球状物体
22 動体
図3
30 立方体平面展開図
31 静止球状物体
32 動体
33 静止3角形状物体
図4
40 立方体平面展開図
41 遮蔽物体
42 静止球状物体
43 動体
図5
50 内挿補間回路
51 座標変換回路
52 立方体6面画像情報メモリ
53 衝突検出回路
図6
60 有効フラグ・識別子選択回路
61 Z値比較回路
62 衝突識別子検出回路
63 マルチプレクサ
64 履歴回路FIG.
10 Cube 11 Cube plane development figure 2
20 Cube plane development view 21 Static
30
40 Cube plane development view 41
50 Interpolation Circuit 51 Coordinate
60 Valid flag / identifier selection circuit 61 Z
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007341766A JP2009146368A (en) | 2007-12-13 | 2007-12-13 | Visible collision detection circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007341766A JP2009146368A (en) | 2007-12-13 | 2007-12-13 | Visible collision detection circuit |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009146368A true JP2009146368A (en) | 2009-07-02 |
Family
ID=40916867
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007341766A Pending JP2009146368A (en) | 2007-12-13 | 2007-12-13 | Visible collision detection circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009146368A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102744733A (en) * | 2011-04-21 | 2012-10-24 | 精工爱普生株式会社 | Collision detection system, robotic system, collision detection method and program |
CN108970113A (en) * | 2018-07-26 | 2018-12-11 | 广州多益网络股份有限公司 | A kind of collision checking method, device, equipment and medium |
WO2019047982A1 (en) * | 2017-09-11 | 2019-03-14 | Oppo广东移动通信有限公司 | Image processing method and apparatus, electronic device and computer-readable storage medium |
-
2007
- 2007-12-13 JP JP2007341766A patent/JP2009146368A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102744733A (en) * | 2011-04-21 | 2012-10-24 | 精工爱普生株式会社 | Collision detection system, robotic system, collision detection method and program |
JP2012226636A (en) * | 2011-04-21 | 2012-11-15 | Seiko Epson Corp | Collision detection system, robot system, collision detection method, and program |
WO2019047982A1 (en) * | 2017-09-11 | 2019-03-14 | Oppo广东移动通信有限公司 | Image processing method and apparatus, electronic device and computer-readable storage medium |
US11138740B2 (en) | 2017-09-11 | 2021-10-05 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Image processing methods, image processing apparatuses, and computer-readable storage medium |
CN108970113A (en) * | 2018-07-26 | 2018-12-11 | 广州多益网络股份有限公司 | A kind of collision checking method, device, equipment and medium |
CN108970113B (en) * | 2018-07-26 | 2021-07-23 | 广州多益网络股份有限公司 | Collision detection method, device, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100510131B1 (en) | Pixel cache, 3D graphic accelerator using it, and method therefor | |
KR101076807B1 (en) | Ray tracing apparatus and method | |
US8824776B2 (en) | Collision detection system, robotic system, collision detection method and program | |
US8059119B2 (en) | Method for detecting border tiles or border pixels of a primitive for tile-based rendering | |
US20100194751A1 (en) | Ray tracing a three dimensional scene using a grid | |
JP2009525526A (en) | Method for synthesizing virtual images by beam emission | |
KR102493461B1 (en) | System and Method of rendering | |
JP2007522567A (en) | A device that realistically displays complex dynamic 3D scenes by ray tracing | |
JP2008077627A (en) | Method and system for early z test in three-dimensional image rendering | |
KR20040093432A (en) | Image rendering device and image rendering method | |
JP2008287696A (en) | Image processing method and device | |
US20170061682A1 (en) | Rendering method and apparatus | |
CN114758051A (en) | Image rendering method and related equipment thereof | |
JP2011138445A (en) | Transparent object display circuit | |
JP2017062789A (en) | Graphics processing apparatus and method for determining lod for texturing | |
US11341708B2 (en) | Graphics processing | |
JP2009146368A (en) | Visible collision detection circuit | |
WO2011073361A1 (en) | A micro-architecture system and method for ray tracing and collision detection | |
JP2008282171A (en) | Graphics processor, and method for rendering processing | |
US7884830B1 (en) | Apparatus, system, and method for indexing an array of cube map textures | |
CN110874858B (en) | System and method for rendering reflections | |
Rauwendaal | Hybrid computational voxelization using the graphics pipeline | |
KR20120138185A (en) | Graphic image processing apparatus and method for realtime transforming low resolution image into high resolution image | |
KR20170075440A (en) | Method and apparatus for determining a layout of stored texture | |
JP2007141196A (en) | Polygon/silhouette line/anti-aliasing circuit |