CN107945260B - Three-dimensional model collision detection method based on interface marks - Google Patents

Three-dimensional model collision detection method based on interface marks Download PDF

Info

Publication number
CN107945260B
CN107945260B CN201710954617.0A CN201710954617A CN107945260B CN 107945260 B CN107945260 B CN 107945260B CN 201710954617 A CN201710954617 A CN 201710954617A CN 107945260 B CN107945260 B CN 107945260B
Authority
CN
China
Prior art keywords
interface
collision
building block
interfaces
state
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
Application number
CN201710954617.0A
Other languages
Chinese (zh)
Other versions
CN107945260A (en
Inventor
黄翰
杨建辉
黎一锴
郝志峰
许秋劲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN201710954617.0A priority Critical patent/CN107945260B/en
Publication of CN107945260A publication Critical patent/CN107945260A/en
Application granted granted Critical
Publication of CN107945260B publication Critical patent/CN107945260B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a three-dimensional model collision detection method based on interface marks, wherein in 3D building block virtual building software, a user selects one or more building blocks to move and place on a bottom plate at will or to splice other building blocks so as to build a unique 3D model or scene, and in the moving, placing and splicing processes of the building blocks, the 3D building block collision detection method based on the interface marks is adopted to judge whether the selected building block collides with other building blocks at the position so as to determine whether the selected building block can place or splice other building blocks, and if so, the building block cannot be placed at the position or spliced with other building blocks. The method can be suitable for 3D building block models with different shapes, and a method for manually marking the collision detection interface is used for replacing a grid collision device carried by the building block 3D model, so that the method has less consumed computing resources and more flexible and accurate collision detection.

Description

Three-dimensional model collision detection method based on interface marks
Technical Field
The invention relates to the technical field of three-dimensional model virtual building software, in particular to a three-dimensional model collision detection method based on interface marks.
Background
In recent years, with rapid social progress and improvement of the living standard of people, building block education is accepted by more and more parents and children as an emerging education mode. As an artistic creation activity, the building blocks are classic in the intelligence toy, and the greatest characteristic is that creativity is realized manually. Building blocks can be varied by different combinations, children need on the basis of hand muscle application, select different building blocks to connect with different modes according to the appearance in the brain sea or reality, finally integrate own building block works. The children's imagination and the structural characteristics of arbitrary combination and construction can be satisfied, and the cognitive ability, the hands-on ability and the creativity of children can be better exercised. Because entity building blocks are numerous, once only whole purchase cost is too high, and 3D building block virtual construction software comes up, and it allows the user to use different building block combinations to splice and build unique building block model, can give different colours and maps to the building block, generates the step of building block model, renders building block model effect picture and shares for friend, can also go to the purchase entity building block of list under the mall according to the building block list of model at last. Building blocks manufacturer can carry out propaganda and popularization through the virtual software of building blocks of 3D, attracts the user to install software and purchase entity building blocks, organizes building blocks education activities or relevant match simultaneously.
One technical difficulty of virtual building software for 3D building blocks is the collision detection of the building blocks during the mobile splicing process to determine whether the mobile building blocks can be placed or spliced at that location. The existing three-dimensional model collision detection method mainly uses a grid collider of a building block 3D model to detect the entering or leaving of collision. Due to the complexity of the building block model, the number of rendering surfaces of the 3D building block model is large, the resources of the computer are seriously occupied by directly using the grid collision device, and when the number of scene building blocks reaches a certain level, the software is slowly operated and has an obvious pause phenomenon. Meanwhile, when part of 3D engines detect the collision trigger, as the grid collider is too complex and the rendering convexity is too much, the grid collider can replace a bounding box of a building block to detect the collision trigger, and the collision detection is not accurate enough.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a three-dimensional model collision detection method based on interface marks, which is applicable to 3D building block models with different shapes, uses a method for manually marking a collision detection interface to replace a grid collision device carried by a building block 3D model, consumes less computing resources and is more flexible and accurate in collision detection.
The purpose of the invention is realized by the following technical scheme: a three-dimensional model collision detection method based on interface marks comprises the following steps:
(a) manually marking building block interfaces and classifying the interfaces; the method comprises the following steps: marking interfaces, which can be spliced by the building blocks, by using cubes, and dividing the building block splicing interfaces into real type interfaces and virtual type interfaces according to whether the interfaces form barriers or not; wherein: the real type interface refers to a set of all interface types which can form blockage, and the virtual type interface refers to a set of all interface types which can not form blockage;
(b) the building block interface trigger detects that building blocks are triggered to collide and enter, records the information of the collided interfaces and maintains a collision interface list; the method specifically comprises the following steps: the building block interface trigger detects that building blocks enter in a triggering collision mode, judges whether the triggering collision is an interface, then judges whether the interface belongs to the selected building block, and judges whether the two interfaces collide according to the fact that whether the ratio of the overlapping part volume of a boundary frame of the collided building block to the larger interface volume is larger than a set threshold value or not if the interface does not belong to the selected building block, so that a collision interface list is maintained;
(c) detecting triggering collision and departure of the building blocks by the building block interface trigger, and maintaining a collision interface list; the method specifically comprises the following steps: the building block interface trigger detects that a building block is triggered to collide and leave, judges whether the triggering collision is an interface, then judges whether the triggering collision belongs to the selected building block, if the triggering collision does not belong to the selected building block, obtains two interface types, and deletes corresponding interface information from a corresponding type interface collision list;
(d) if the interface triggered to collide belongs to the real type interface in the step (b) or (c), traversing all the interfaces of the building block to determine the new state of the building block; traversing all interfaces of the building block to determine the new state of the building block comprises the following steps: traversing all interfaces of the selected building block corresponding to the active collision interface, checking a collided interface in the real-type collision list of each interface, if the actively moving interface is not spliced by the interface of the father object of the interface, considering that the building block is in a collided state, otherwise, considering that the building block is in a non-collided state;
(e) if the new state of the building block obtained in the step (d) is different from the current state, traversing all the selected building blocks to determine the new state of the selected building block;
(f) and (e) if the new state of the selected building block obtained in the step (e) is different from the current state, updating the states of all the selected building blocks.
Preferably, in the step (a), the interfaces which can be spliced by the building blocks are marked by cubes, different interface types are set according to different interface shapes, and the sizes of the cubes are attached to the interfaces of the building block models; the interface is used as a child object of the building block, and corresponding labels are respectively defined for the building block and the interface; dividing the building block splicing interface into a real type interface and a virtual type interface according to whether the interface can form the blockage, wherein the real type interface refers to a set of all interface types which can form the blockage, and the virtual type refers to a set of all interface types which can not form the blockage; in addition, a special type interface is defined, covers the exterior of the building block and is used for replacing a grid collision device of the building block to detect collision information; the special type interface can not be overlapped with other interfaces, and also belongs to a real type interface;
the building block state is divided into a collision state and a non-collision state: the collision state indicates that the selected building block collides with other building blocks, cannot be placed at the current position, and cannot be spliced with other building blocks; the non-collision state represents that the selected building block does not collide with other building blocks, can be placed at the current position and can be spliced with other building blocks.
Preferably, step (b) specifically comprises:
(b-1) acquiring a label triggering a collision object, and judging whether the label is an interface;
(b-2) if the triggering collision object is the interface, obtaining the building blocks corresponding to the interface, and judging whether the building blocks belong to the selected building blocks;
(b-3) if the building blocks do not belong to the selected building blocks, respectively acquiring building block interface boundary frames corresponding to the two collided interfaces;
(b-4) calculating the volume of the overlapped part of the bounding boxes of the two building blocks, and then calculating the ratio of the volume of the overlapped part to the volume of the interface with the larger size;
(b-5) if the volume ratio is larger than a set threshold, considering that the two interfaces collide, otherwise, considering that the two interfaces do not collide;
(b-6) if the two interfaces are considered to be collided, acquiring the types of the two interfaces, if the two interfaces belong to the real type interface, adding collision interface information into a real type interface collision list, and continuing the step (d) to further judge whether the building block state is changed; otherwise, collision interface information is recorded in the virtual type interface collision list in an increasing mode, and the state of the building blocks is unchanged.
Specifically, in the step (b), since the two blocks may trigger collision entry when approaching, the overlapping degree of the bounding boxes of the two block interfaces needs to be continuously judged in the collision processing method to determine whether the two block interfaces really collide; the two building block interface bounding boxes are all cuboids with aligned axes, so that the overlapped part is also the cuboid with aligned axes, and the calculation method of the volume of the overlapped part is as follows: respectively projecting the two building block interface boundary frames to XOY, YOZ and ZOX three planes of an O-XYZ coordinate space, wherein the projection of the building block interface boundary frames on each plane is a rectangle, calculating the intersecting rectangles of the two rectangles, and the intersecting rectangles of the XOY, YOZ and ZOX three planes are the projections of the cuboid at the overlapped part of the two building block interface boundary frames on the three planes.
Preferably, step (c) specifically comprises:
(c-1) acquiring a label triggering a collision object, and judging whether the label is an interface;
(c-2) if the triggering collision object is the interface, obtaining the building blocks corresponding to the interface, and judging whether the triggering collision building blocks belong to the selected building blocks;
(c-3) if the building blocks do not belong to the selected building blocks, acquiring the types of the two interfaces;
(c-4) if the two interfaces belong to the real type interface, deleting the corresponding collision interface information from the real type interface collision list, and continuing the step (d) to further judge whether the building block state is changed; otherwise, deleting the corresponding collision interface information in the virtual type interface collision list, and keeping the building block state unchanged.
Preferably, step (d) specifically comprises:
(d-1) if the two interfaces triggering collision in the step (b) or the step (c) belong to the real type interfaces, continuously judging collision information of other interfaces of the building block to determine a new state of the building block;
(d-2) traversing all interfaces of the selected building block corresponding to the active collision interfaces;
(d-3) checking a collided interface in the real type collision list of each interface, if the actively moving interface is not spliced by the interface of the building block, considering that the building block is in a collided state, and if not, considering that the building block is in a non-collision state;
(d-4) checking the current state of the building block, and if the current state is inconsistent with the new state of the building block in the step (d-3), continuing to process in the step (e) to judge whether the state of the building block should be changed.
Preferably, in the step (e), because the states of all the selected blocks are always kept consistent, the new state of each selected block is checked in a circulating manner, and if the new states of all the selected blocks are non-collision states, the new state of the selected block is determined to be the non-collision state; otherwise, as long as one new state of the selected building block is in the collision state, the new states of all the selected building blocks are in the collision state.
Preferably, in the step (f), if the current state of the selected block is inconsistent with the new state, the states of all the selected blocks are updated to be the new state.
Compared with the prior art, the invention has the following advantages and beneficial effects:
the existing three-dimensional model collision detection method uses a grid collider of a building block 3D model, the consumption of computer resources is serious due to excessive rendering surfaces, the processing speed is low, and the problem of inaccurate collision detection exists. The invention uses the interface marking method, replaces the building block grid collision device with a plurality of collision devices with simple interfaces to detect the triggering of collision, is not influenced by the number of rendering surfaces of the model, and can process complex building block models. Meanwhile, the triggering area of the collision device is not the boundary frame range of the model any more, but the combination of the spaces covered by the plurality of cuboid interfaces, so that the collision detection is more accurate. Because every interface all is simple cuboid, only has 6 faces of rendering, consequently the calculated amount when the collision triggers is littleer than the many net renderer of product wood face number far away, and the processing speed is faster, can place more building blocks in the scene and the phenomenon that the apparent display blocks pause does not appear, and software operation is more smooth, and user experience can be better.
Drawings
FIG. 1 is a schematic diagram of an embodiment of an interface.
Fig. 2 is a schematic diagram of a virtual interface in an embodiment.
FIG. 3 is a flow chart of an embodiment method.
Fig. 4 is a general interface schematic.
Fig. 5 is a schematic diagram of a special type of interface.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but the present invention is not limited thereto.
Examples
In the virtual software of putting up of 3D building blocks, the user selects one or more building blocks to remove wantonly on the bottom plate and place, or goes to splice other building blocks, thereby put up unique 3D model or scene, move at building blocks and place and the in-process of concatenation, adopt the 3D building blocks collision detection method based on interface mark, judge and select whether this position of building blocks bumps with other building blocks, thereby the decision is selected whether can place or splice other building blocks by the building blocks.
Referring to fig. 1, a three-dimensional model collision detection method based on interface marks includes the following steps:
there are many building blocks in the scene, can select one or more building blocks through the box selection, drag afterwards and can move the selected building block.
(a) And manually marking the building block interfaces and classifying the interfaces.
Dividing the building block splicing interface into a real type interface and a virtual type interface according to whether the interface can form a barrier, wherein the real type interface refers to a set of all interface types which can form the barrier, and protrudes out of the surface of an object as shown in figure 1; the virtual type refers to the set of all interface types that do not form a barrier, such as fig. 2, that do not belong to an object but can be spliced with a corresponding real interface (the real type affects another object, and the virtual type can be spliced by the real type but does not have an entity).
In the step (a), a cube is used for marking an interface which can be spliced by the building block, and the size of the cube is attached to the interface of the building block model as much as possible; and different interface types are set according to different interface shapes, such as interface types A1, A2, B1, B2 and the like. The interface is used as a child object of the building block, and corresponding labels are respectively defined for the building block and the interface; each block has its own id, e.g. block number 0, 1, 2, with different types of interface, and there are one or more interfaces under each block, e.g. 10 a1, 10 a2 under block number 0. And defining a special type interface, for example, the interface is of the type X, covering the exterior of the building block, and replacing a grid collider of the building block to detect the collision information. The interface of a particular type cannot overlap with other interfaces (three-dimensional objects cannot overlap, i.e. the occupied space cannot overlap). The special type interface also belongs to the real type interface. The interface marked in fig. 4 is a normal interface, which can be spliced and collided. The interfaces labeled in fig. 5 are special interfaces used to describe where a three-dimensional object does not have a normal interface. The special interface has no specific standard, and the building blocks can be filled only by describing the appearance of the building blocks.
Two linked lists of string types may be defined to store interface types of real type and virtual type, respectively, for example, a1, B1, X types belong to real type interfaces, and a2, B2 types belong to virtual type interfaces. And if a new interface type appears, correspondingly updating the two linked lists.
Each object has an interface collision list, and collision interface information is recorded.
(b) The building block interface trigger detects that building blocks are triggered to collide and enter (namely two interfaces are overlapped in space in the moving process), records the information of the collided interfaces and maintains an interface collision list;
step (b) is that when the building block interface is triggered by collision, the judgment processing is carried out, and the step (b) comprises the following steps:
(b-1) acquiring a label triggering a collision object, and judging whether the label is an interface;
(b-2) if the triggering collision object is the interface, obtaining the building blocks corresponding to the interface, and judging whether the building blocks belong to the selected building blocks;
(b-3) if the building blocks do not belong to the selected building blocks (no matter whether the selected building blocks are selected or not, the selected building blocks collide with other objects in the scene as long as the selected building blocks are collided), respectively acquiring building block interface bounding boxes corresponding to the two collided interfaces;
(b-4) calculating the volume of the overlapped part of the bounding boxes of the two building blocks, and then calculating the ratio of the volume of the overlapped part to the volume of the interface with the larger size;
(b-5) if the volume ratio is larger than a set threshold, considering that the two interfaces collide, otherwise, considering that the two interfaces do not collide;
(b-6) if the two interfaces are considered to be collided, acquiring the types of the two interfaces, if the two interfaces belong to the real type interface, adding collision interface information into a real type interface collision list, and continuing the step (d) to further judge whether the building block state is changed; otherwise, adding and recording collision interface information in the virtual type interface collision list, and keeping the building block state unchanged (as long as one virtual interface exists, the building block state is unchanged).
The building block state is divided into a collision state and a non-collision state. The collision state shows that to select building blocks and other building blocks to collide, can not place in the current position, also can not splice with other building blocks, and non-collision state shows that to select building blocks and not collide with other building blocks, can place in the current position, can splice with other building blocks.
In step (b), since it is possible to trigger collision entry when two blocks approach, it is necessary to continuously determine the overlapping degree of the bounding boxes of the two block interfaces in the collision processing method to determine whether the two block interfaces actually collide. The two building block interface bounding boxes are all cuboids with aligned axes, so that the overlapped part is also the cuboid with aligned axes, and the calculation method of the volume of the overlapped part is as follows: respectively projecting the two building block interface boundary frames to XOY, YOZ and ZOX planes of an O-XYZ coordinate space, wherein the projection of the boundary frames on each plane is a rectangle, calculating the intersecting rectangles of the two rectangles, and the intersecting rectangles of the XOY, YOZ and ZOX planes are the projections of the cuboid at the overlapped part of the two building block interface boundary frames on the three planes, and knowing the length, the width and the height of the cuboid from the projection of the three planes, thereby calculating the volume of the overlapped part of the two building block interface boundary frames, then calculating the ratio of the volume of the overlapped part to the volume of the larger interface, and if the ratio exceeds a set threshold value of 0.003, considering that collision occurs. For example, if the volumes of two colliding block joints are 7 and 10, respectively, and the volume of the overlap portion is 0.05, the ratio of the volume of the overlap portion to the volume of the larger block joint is 0.05/10-0.005, and the ratio is greater than 0.003, the two joints are considered to collide.
(c) The building block interface trigger detects that the building block triggers collision and leaves (namely, the previously overlapped interfaces are not overlapped any more, and one interface moves), and an interface collision list is maintained;
when the building block interface triggers collision and leaves, judging and processing, wherein the step (c) comprises the following steps:
(c-1) acquiring a label triggering a collision object, and judging whether the label is an interface;
(c-2) if the triggering collision object is the interface, obtaining the building blocks corresponding to the interface, and judging whether the triggering collision building blocks belong to the selected building blocks;
(c-3) if the building blocks do not belong to the selected building blocks, acquiring the types of the two interfaces;
(c-4) if the two interfaces belong to the real type interface, deleting the corresponding collision interface information from the real type interface collision list, and continuing the step (d) to further judge whether the building block state is changed; otherwise, deleting the corresponding collision interface information in the virtual type interface collision list, and keeping the building block state unchanged.
(d) If the interface triggered to collide belongs to the real type interface in the step (b) or (c), traversing all the interfaces of the building block triggered to collide to determine the new state of the building block;
and (d) when the interface of the building block is triggered to enter or leave in a collision mode, the interface state is changed, and therefore whether the state of the corresponding building block needs to be changed or not is determined. The step (d) comprises the steps of:
(d-1) if the two interfaces triggering collision in the step (b) or the step (c) belong to the real type interfaces, continuously judging collision information of other interfaces of the building block to determine a new state of the building block;
(d-2) traversing all interfaces of the selected building block corresponding to the active collision interfaces;
(d-3) checking a collided interface in the real-type collision list of each interface, if the actively moving interface is not spliced by the interface of the building block (the father object of the interface), considering that the building block is in a collided state, and if not, considering that the building block is in a non-collided state;
and (d-4) checking the current state of the building block, and if the current state is inconsistent with the new state of the building block in the step (d-3), continuing the step (e) to process and judge whether the state of the building block should be changed.
(e) If the new state of the building block obtained in the step (d) is different from the current state, traversing all the selected building blocks to determine the new state of the selected building block;
in the step (e), the states of all the selected blocks are kept consistent all the time, so the new state of each selected block is checked in a circulating manner, and if the new states of all the selected blocks are non-collision states, the new state of the selected block is determined to be the non-collision state; otherwise, as long as one new state of the selected building block is a collision state, the new states of all the selected building blocks are collision states;
(f) and (e) if the new state of the selected building block obtained in the step (e) is different from the current state, updating the states of all the selected building blocks.
And (f) if the current state of the selected building block is inconsistent with the new state, updating the states of all the selected building blocks to be the new state.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (8)

1. A three-dimensional model collision detection method based on interface marks is characterized by comprising the following steps:
(a) artificially marking building block interfaces and classifying the interfaces, comprising: marking interfaces, which can be spliced by the building blocks, by using cubes, and dividing the building block splicing interfaces into real type interfaces and virtual type interfaces according to whether the interfaces form barriers or not; wherein: the real type interface refers to a set of all interface types which can form blocking, and the virtual type interface refers to a set of all interface types which can not form blocking;
(b) the building block interface trigger detects that building blocks are triggered to collide and enter, records the information of the collided interfaces and maintains a collision interface list; the method specifically comprises the following steps: the building block interface trigger detects that building blocks enter a triggering collision mode, judges whether the triggering collision is an interface, then judges whether the interface belongs to a selected building block, and judges whether the two interfaces collide according to whether the ratio of the overlapping part volume of a boundary frame of the colliding building block interface to the volume of a larger interface is larger than a set threshold value if the interface does not belong to the selected building block, so that a collision interface list is maintained;
(c) detecting triggering collision and departure of the building blocks by the building block interface trigger, and maintaining a collision interface list; the method specifically comprises the following steps: the building block interface trigger detects that a building block is triggered to collide and leave, judges whether the triggering collision is an interface, then judges whether the triggering collision belongs to a selected building block, and if the triggering collision does not belong to the selected building block, obtains two interface types and deletes corresponding interface information from a corresponding type interface collision list;
(d) if the interface triggered to collide belongs to the real type interface in the step (b) or (c), traversing all interfaces of the building block to determine the new state of the building block; the step of traversing all the interfaces of the building block to determine the new state of the building block comprises the following steps: traversing all interfaces of the selected building block corresponding to the active collision interface, checking a collided interface in the real-type collision list of each interface, if the actively moving interface is not spliced by the interface of the father object of the interface, considering that the building block is in a collided state, otherwise, considering that the building block is in a non-collided state;
(e) if the new state of the building block obtained in the step (d) is different from the current state, traversing all the selected building blocks to determine the new state of the selected building block;
(f) and (e) if the new state of the selected building block obtained in the step (e) is different from the current state, updating the states of all the selected building blocks.
2. The interface mark-based three-dimensional model collision detection method according to claim 1, wherein in the step (a), interfaces that the building blocks can be spliced are marked by cubes, different interface types are set according to different interface shapes, and the sizes of the cubes are attached to the interfaces of the building block models; the interface is used as a child object of the building block, and corresponding labels are respectively defined for the building block and the interface; dividing the building block splicing interface into the real type interface and the virtual type interface according to whether the interface can form a barrier; in addition, a special type interface is defined, covers the exterior of the building block and is used for replacing a grid collision device of the building block to detect collision information; the special type interface can not be overlapped with other interfaces, and the special type interface also belongs to the real type interface;
the building block state is divided into a collision state and a non-collision state: the collision state represents that the selected building block collides with other building blocks, cannot be placed at the current position, and cannot be spliced with other building blocks; the non-collision state represents that the selected building block does not collide with other building blocks, can be placed at the current position and can be spliced with other building blocks.
3. The interface labeling-based three-dimensional model collision detection method according to claim 2, wherein the step (b) specifically comprises:
(b-1) acquiring a label triggering a collision object, and judging whether the label is an interface;
(b-2) if the collision object is triggered to be the interface, obtaining the building blocks corresponding to the interface, and judging whether the building blocks belong to the selected building blocks;
(b-3) if the building blocks do not belong to the selected building blocks, respectively acquiring building block interface bounding boxes corresponding to the two collided interfaces;
(b-4) calculating the volume of the overlapped part of the bounding boxes of the two building blocks, and then calculating the ratio of the volume of the overlapped part to the volume of the larger building block interface;
(b-5) if the ratio of the volumes is larger than a set threshold, considering that the two interfaces collide, otherwise, considering that the two interfaces do not collide;
(b-6) if the two interfaces are considered to be collided, acquiring the types of the two interfaces, if the two interfaces belong to the real type interface, adding collision interface information into a real type interface collision list, and continuing the step (d) to further judge whether the building block state is changed; otherwise, collision interface information is recorded in the virtual type interface collision list in an increasing mode, and the state of the building blocks is unchanged.
4. The interface mark-based three-dimensional model collision detection method according to claim 3, wherein in step (b), since two blocks are close to each other, it is possible to trigger collision entry, and therefore it is necessary to continuously determine the overlapping degree of the bounding boxes of the two block interfaces in the collision processing method to determine whether the two block interfaces actually collide; the two building block interface bounding boxes are all cuboids with aligned axes, so that the overlapped part is also the cuboid with aligned axes, and the calculation method of the volume of the overlapped part is as follows: respectively projecting the two block interface bounding boxes to XOY, YOZ and ZOX three planes of an O-XYZ coordinate space, wherein the projection of the block interface bounding boxes on each plane is rectangular, calculating the intersecting rectangles of the two rectangles, and the intersecting rectangles of the XOY, YOZ and ZOX three planes are the projections of the cuboids of the overlapped parts of the two block interface bounding boxes on the three planes, and the length, the width and the height of the cuboids can be known from the projections of the three planes, so that the volume of the overlapped parts of the two block interface bounding boxes is calculated, then the ratio of the volume of the overlapped parts to the volume of the larger interface is calculated, and if the ratio exceeds a set threshold value, a collision is considered.
5. The interface labeling-based three-dimensional model collision detection method according to claim 2, wherein the step (c) specifically comprises:
(c-1) acquiring a label triggering a collision object, and judging whether the label is an interface;
(c-2) if the triggering collision object is the interface, obtaining the building blocks corresponding to the interface, and judging whether the triggering collision building blocks belong to the selected building blocks;
(c-3) if the building block does not belong to the selected building block, acquiring the types of the two interfaces;
(c-4) if the two interfaces belong to the real type interface, deleting the corresponding collision interface information from the real type interface collision list, and continuing the step (d) to further judge whether the building block state is changed; otherwise, deleting the corresponding collision interface information in the virtual type interface collision list, and keeping the building block state unchanged.
6. The interface labeling-based three-dimensional model collision detection method according to claim 2, wherein the step (d) specifically comprises:
(d-1) if the two interfaces triggering collision in the step (b) or the step (c) belong to the real type interface, continuously judging collision information of other interfaces of the building block to determine a new state of the building block;
(d-2) traversing all interfaces of the selected building block corresponding to the active collision interfaces;
(d-3) checking a collided interface in the real-type collision list of each interface, if the actively moving interface is not spliced by the interface of the father object of the interface, considering that the building block is in the collided state, and if not, considering that the building block is in the non-collision state;
(d-4) checking the current state of the father object of the interface, and if the current state is inconsistent with the new state of the building block in the step (d-3), continuing to process the step (e) to judge whether the state of the building block should be changed.
7. The interface marker-based three-dimensional model collision detection method according to claim 2, wherein in step (e), since the states of all the selected blocks are always kept consistent, the new state of each selected block is checked in a loop, and if the new states of all the selected blocks are the non-collision state, the new state of the selected block is determined to be the non-collision state; otherwise, as long as one new state of the selected building block is the collision state, the new states of all the selected building blocks are the collision state.
8. The interface marker-based three-dimensional model collision detection method according to claim 2, wherein in step (f), if the current state of the selected block is not consistent with the new state, the states of all the selected blocks are updated to the new state.
CN201710954617.0A 2017-10-13 2017-10-13 Three-dimensional model collision detection method based on interface marks Active CN107945260B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710954617.0A CN107945260B (en) 2017-10-13 2017-10-13 Three-dimensional model collision detection method based on interface marks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710954617.0A CN107945260B (en) 2017-10-13 2017-10-13 Three-dimensional model collision detection method based on interface marks

Publications (2)

Publication Number Publication Date
CN107945260A CN107945260A (en) 2018-04-20
CN107945260B true CN107945260B (en) 2020-08-18

Family

ID=61935301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710954617.0A Active CN107945260B (en) 2017-10-13 2017-10-13 Three-dimensional model collision detection method based on interface marks

Country Status (1)

Country Link
CN (1) CN107945260B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6747651B1 (en) * 1998-07-18 2004-06-08 National University Of Singapore System and method for creating bounding volume hierarchies utilizing model simplification
US6862026B2 (en) * 2001-02-09 2005-03-01 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung E.V. Process and device for collision detection of objects
CN101719288A (en) * 2009-12-29 2010-06-02 河北省电力勘测设计研究院 Method for inspecting element collision of power generation plant by three-dimensional model
CN105590339A (en) * 2015-12-15 2016-05-18 广州南沙3D打印创新研究院 Collision detection method and system for three-dimensional model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6747651B1 (en) * 1998-07-18 2004-06-08 National University Of Singapore System and method for creating bounding volume hierarchies utilizing model simplification
US6862026B2 (en) * 2001-02-09 2005-03-01 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung E.V. Process and device for collision detection of objects
CN101719288A (en) * 2009-12-29 2010-06-02 河北省电力勘测设计研究院 Method for inspecting element collision of power generation plant by three-dimensional model
CN105590339A (en) * 2015-12-15 2016-05-18 广州南沙3D打印创新研究院 Collision detection method and system for three-dimensional model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
碰撞检测算法在三维游戏设计中的应用与研究;连娜 等;《山西电子技术》;20150415(第2期);第87-89页 *

Also Published As

Publication number Publication date
CN107945260A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
US9509981B2 (en) Projectors and depth cameras for deviceless augmented reality and interaction
Shade et al. Hierarchical image caching for accelerated walkthroughs of complex environments
CN105793730B (en) The classification based on laser radar of object motion
CN103971399B (en) street view image transition method and device
JP6361146B2 (en) Display control program, display control method, display control apparatus, and display system
CN107683165B (en) Techniques for generating computer models, and devices, systems, and methods utilizing same
US20150130790A1 (en) Visually Convincing Depiction of Object Interactions in Augmented Reality Images
TWI595443B (en) Image processing method, electronic apparatus and non-transitory computer readable media
KR20080076610A (en) Method and apparatus for creating a 3d model from 2d photograph image
CN109410316A (en) Method, tracking, relevant apparatus and the storage medium of the three-dimensional reconstruction of object
CN112529022B (en) Training sample generation method and device
CN106097417A (en) Subject generating method, device, equipment
CN103714575A (en) Fluid simulation method for combining SPH and dynamic surface mesh
US11625882B2 (en) Method for simulating fluids interacting with submerged porous materials
CN113001551B (en) Fast collision detection method based on octree structure segmentation
WO2017185208A1 (en) Method and device for establishing three-dimensional model of robot, and electronic device
CN107886574B (en) Global rain simulation method based on particle system
CN104941180A (en) Collision detecting method and device for 2D games
KR102467903B1 (en) Method for presenting motion by mapping of skeleton employing Augmented Reality
CN107945260B (en) Three-dimensional model collision detection method based on interface marks
CN105999703A (en) A virtual reality scene extension method
CN106548505B (en) Model of place fast triangulation method for 3-D ray-tracing
US11417043B2 (en) Method for generating simulations of thin film interfaces for improved animation
Sherstyuk et al. Collision-free navigation with extended terrain maps
CN106097299A (en) The detection method of a kind of 3D model leak and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant