distance maps for collision detection of deformable

0 downloads 0 Views 687KB Size Report
environments (Teschner, 2004). Usually these approaches aim at improving the performance in specific applications, for example surgery (Raghupathi, 2004) or ...
DISTANCE MAPS FOR COLLISION DETECTION OF DEFORMABLE MODELS Athanasios Vogiannou, Michael G. Strintzis Electrical & Computer Engineering Department, Aristotle University of Thessaloniki, Greece

Konstantinos Moustakas, Dimitrios Tzovaras Informatics and Telematics Institute, CERTH P.O. Box 361, 57001, Thermi-Thessaloniki, Greece

ABSTRACT This paper presents a method for detecting collisions between a deformable and a rigid model. The proposed approach builds on the remarkable results achieved by distance fields and SQ-maps by introducing distance maps with multiple entries. The computational cost of the presented extension is of the same level as the previous methods but the memory requirements are much lower because distance maps with multiple entries can be used directly with general non-convex 3D models. The proposed method can be used in various applications at interactive performance rates. KEYWORDS Collision Detection, Deformable Models

1. INTRODUCTION Collision detection for physically based modeling is a topic receiving much interest during the last years. Various approaches have been introduced to efficiently calculate collision data and enhance perceptually realistic interaction with deformable objects, such as clothes and human organs, in various virtual environments (Teschner, 2004). Usually these approaches aim at improving the performance in specific applications, for example surgery (Raghupathi, 2004) or cloth (Mezger, 2003) simulations, therefore their requirements are closely related with the requirements of each application. Most of the early approaches extend the relevant work on rigid bodies by using Bounding Volume Hierarchies (Bergen, 1997; Gottschalk, 1996) with deformable models. The problem with this approach is that a change in the shape of the object affects the algorithm and the surrounding hierarchy should be rebuild in order to fit to the new shape. Rebuilding or refitting the new hierarchy comes at heavy computational cost. For this reason, more sophisticated methods have been introduced and better results were produced (Teschner, 2003; Baciu, 2004; Govindaraju, 2005). One of the most remarkable recent approaches is the use of distance fields (Fisher, 2001; Fuhrmann, 2003; Funfzig, 2006). Distance fields have been used in the past in various applications (Jung 1997, Frisken 2000). A distance field of a 3D model represents the closest distance between the model and each point in space. Although collision queries are dramatically simplified with this approach, calculating and storing a distance field requires large amounts of memory. A method which compensates the memory requirements while keeping the computational cost at low levels is the SQ-Map (Moustakas, 2007). Instead of the excessive 3D field, SQ-Maps store the distance between the 3D model and a Super-Quadric (SQ) surrounding the model. The only drawback of this method is that for non-convex objects it is necessary to use decomposition in order to bound the object tightly and consequently more than one SQ-Map. In this paper we propose an extension to SQ-Maps which can be used directly with any complex object. Instead of the linear mapping from the 2D space of the SQ to a single distance value, we use multiple distance values. Therefore any topological complexity of the object can be represented by a single map. The memory requirements are significantly reduced while at the same time the performance remains at interactive rates.

2. METHOD DESCRIPTION The proposed approach includes a preprocessing stage where the distance map of each rigid object on the scene is calculated. Rigid objects are represented as triangular meshes and deformable objects are modeled using particle systems. Collision detection is performed in a vertex based approach. Every particle of the deformable model is tested against the map of the rigid model. If collision is detected, the appropriate response is calculated. In the following sub-sections we describe a method to calculate and store a distance map with multiple entries and an algorithm for quickly determining if a particle is inside or outside a rigid body using the respective map. Experimental results indicating the importance of the proposed method are given in the last sub-section.

2.1 Distance Map Calculation We use spheres instead of SQs in our method because spheres better suit for our purpose, having one centre and direct relation with the spherical coordinate system. After the bounding sphere of the object is calculated, sampling is performed to the spherical surface using the angular coordinates (φ , θ ) . Let C and R denote the center and the radius of the bounding sphere S. For each sample (φi , θ j ) , all the points of intersection between the line segment from C to (φi , θ j , R ) are calculated. For each point of intersection p, the distance p - C is calculated and stored in the (i , j ) entry of the array containing the map. Figure 1(a) displays the case for an arbitrary object. Figure 1. Distance Map with Multiple Entries. In (a) the line L intersects with the object in 3 different points. The distance from each point is stored in the data structure of the map. In (b) we see possible discretization errors in the area around the vertex V caused by the sampling scheme.

The sampling may cause discretization errors, especially in the areas around the vertices of the model. Figure 1(b) illustrates a 2D representation of the case. The linear interpolation between the distance values S1 and S2 of the samples D1 and D2 yields lower distance than the actual distance of the vertex. This will lead to falsely disregarding colliding particles in the range (D1, D2). In order to correct this error, the distance values S1 and S2 are augmented by the error difference between the interpolated value and the distance of the vertex. The final result of the previous algorithm is a data structure describing the distance map. This map can be used as an implicit representation of the object. Figure 2 illustrates the 3D model and the map of a horse with 6000 faces and Figure 3 the respective 3D model and map of a torus with 2880 faces. The distance maps have been generated using 200 samples along each coordinate. Note how the uniform sampling affects the

mapping in the areas near and far of the centre of each object. Even so, prominent model parts such as the legs and the head of the horse are still sufficiently described by the map. Figure 2. Distance map of the horse 3D model.

Figure 3. Distance map of the torus 3D model.

2.2 Collision Detection Consider a particle p in space together with a rigid body A. Particle p is initially tested against the bounding sphere of A. If the particle does not penetrate the sphere then no collision is reported. On the other r case, let d denote the vector from the centre of the sphere to p. We then obtain the angular coordinates r (φd , θ d ) of d . The distance value (or values) for (φd , θ d ) are calculated using bilinear interpolation from the four samples closer to it. There are two error situations that can occur due to the interpolation scheme. The first happens when at least two of the four used samples refer to different faces of the object. This case has been already treated in the preprocessing stage by augmenting the entries of the map as this situation appears only in samples around the vertices of the object. The second situation takes place when there are samples that have different length, i.e. different number of distance values. In this case, we use the sample which is closer to (φd , θ d ) as the reference sample and ignore (in the interpolation) all the other samples with different length than the reference one. Even though this approach seems naive, it works well in practice as rarely happens to use less than 3 samples in the interpolation. In any case, in the end of the above procedure we will have one sample with the interpolated distance values. These values separate space ℜ in discrete intervals. It is then enough to enumerate the intervals r r (starting from 0), find the interval where | d | lies to and perform a simple parity test. If | d | is on an even interval then p penetrates A. Note that this applies when the centre of A lies on the interior of the object r (there are complex objects like the torus that the centre is out of the object). In the other case, | d | should be on an odd interval in order for p to penetrate A.

After determining collision, an estimation of the penetration depth can be retrieved directly from the r r map. In order for p to exit from A, it should translate S - | d | distance along the direction of d where S r denotes the interpolated distance value closer to | d | .

2.3 Experimental Results The proposed method has been tested in two simple simulations involving the horse, the torus and a cloth. The cloth is modeled using the method described by Jakobsen (2001). During the first simulation the cloth was falling down towards the horse, until it stopped completely. In the second simulation the torus was used in the place of the horse. Tests were performed on a Core2 6600 2,4GHz CPU PC with 2GB of RAM and a GeForce 7600 GS Graphics Card. Figures 3 and 4 illustrate different screenshots of each simulation The frame rate of each simulation ranged from 15 to 60 fps, which is sufficiently enough for interactive applications. The size of the distance map with multiple entries for the horse model is 0.63 Mbytes and for the torus is 0.7 Mbytes. The SQ-Maps require 2.9 Mbytes and 4.1 Mbytes respectively. That happens because the two models need more than one SQ segment to be represented sufficiently (17 for the horse and 12 for the torus). To complete the comparison we note that the requirements of the respective distance field with the same sampling frequency are 230 Mbytes and 180 Mbytes respectively. Figure 4. Different screenshots of the simulation with the horse model

Figure 5. Different screenshots of the simulation with the torus model

3. CONCLUSION We presented an extension of SQ-Maps for collision detection by introducing distance maps with multiple entries. Instead of mapping a single distance value of the point closer to the bounding surface, the distances from all the intersection points are stored and used to construct an implicit representation of the object. The proposed method requires much lower memory than SQ-Maps and distance fields while the performance remains at interactive rates. The major limitations of the presented approach are related to the accuracy and derive from the approximations introduced by sampling the 3D model and the vertex based collision detection method. Even so, the method is suitable for practical graphics applications as it is simple to implement and very efficient in computational time.

Further work may include the investigation of other bounding surfaces instead of the sphere and improving the sampling method along the 2D surface. Also we would like perform tests in more demanding interactive applications to highlight the advantages and the limitations of the proposed method.

REFERENCES Baciu G. and Wong Wingo S.-K., 2004. Image-Based Collision Detection for Deformable Cloth Models. In IEEE Transactions on Visualization and Computer Graphics, Vol. 10, No. 6, pp 649 - 663. Bergen v. d. G., 1997. Efficient Collision Detection of Complex Deformable Models using AABB Trees. In Journal of Graphics Tools, Vol. 2, No. 4, pp 1-14. Fisher S. and Lin M. C., 2001. Deformed distance fields for simulation of non-penetrating flexible bodies. Proceedings of the Eurographic workshop on Computer animation and simulation, pp. 99-111. Frisken, S.F. and Perry, R.N. and Rockwood, A.P. and Jones, T.R., 2000. Adaptively Sampled Distance Fields: A General Representation of Shape for Computer Graphics, ACM SIGGRAPH, pp 249-254. Funfzig C. and Ullrich T. and Fellner D. W., 2006. Hierarchical Spherical Distance Fields for Collision Detection. In IEEE Computer Graphics and Applications, Vol. 26, No. 1, pp 64-74. Fuhrmann A. and Sobottka G. and Gross C., 2003. Distance Fields for Rapid Collision Detection in Physically Based Modeling. Proceedings of Graphicon 2003. Moscow, Russia, pp. 58-65. Gottschalk S. and Lin M. C. and Manocha D., 1996. OBBTree: A Hierarchical Structure for Rapid Interference Detection. In Computer Graphics, Vol. 30, Annual Conference Series, pp 71-80. Govindaraju N. K. et al., 2005. Interactive collision detection between deformable models using chromatic decomposition. In ACM Trans. Graph., Vol. 24, No. 3, pp 991 - 999. Jakobsen T., 2001. Advanced character physics. In Proceedings of the Game Developers Conference. pp. 139-149. Jung D. and Gupta K., 1997. Octree-based hierarchical distance maps for collision detection. In Journal of Robotics Systems, Vol. 14, No. 11, pp 789-806. Mezger J. and Kimmerle S. and Etzmu O., 2003. Hierarchical Techniques in Collision Detection for Cloth Animation. Journal of WSCG. Vol. 11, No. 2, pp 322-329. Moustakas K. and Tzovaras D. and Strintzis M.G., 2007. SQ-Map: Efficient Layered Collision Detection and Haptic Rendering. In IEEE Transactions on Visualization and Computer Graphics, Vol. 13, No. 1, pp 80-93. Raghupathi, L. et al, 2004. An Intestinal Surgery Simulator: Real-Time Collision Processing and Visualization. In IEEE Transactions on Visualization and Computer Graphics, Vol. 10, No. 6, pp 708-718. Teschner M. et al, 2003. Optimized spatial hashing for collision detection of deformable objects. In Proceedings of Vision, Modeling, Visualization (VMV 2003). Munich, Germany, pp. 47-54. Teschner M. et al, 2004. Collision Detection for Deformable Objects. Eurographics State-of-the-Art Report (EG-STAR). Grenoble, France, pp. 119-139.