Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Collision detection method and system

A collision detection and coordinate system technology, which is applied in the field of data analysis and can solve the problems of narrowing the detection range, low accuracy of detection results, and complicated steps.

Inactive Publication Date: 2017-06-13
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] On the web side, since the pictures in the DOM structure are all rectangles, even if they are irregular pictures, they are also rectangles in the DOM structure; for collision detection of the objects contained in the rectangle, the method of narrowing the detection range is generally used, and Bind one or more collision detection areas of regular graphics locally on the object to make the final effect look more realistic. Usually, this detection area is called an internal test box, but this method is very inefficient and the steps are very cumbersome. , and the detection accuracy is low
[0003] The Chinese patent with the application number: 201210144554.X discloses a quadtree-based scene management method in online games. The method includes: establishing a coordinate system in any of the scenes, and any tree node that divides the scene It is identified by the coordinates in the coordinate system where it is located, and the object ID of each object in the scene is bound to the coordinates corresponding to the tree node where it is located; when performing collision detection on any object in the scene , according to the object ID of the object, find the tree node corresponding to the corresponding coordinates found in the current record, and determine whether there are other objects in the tree node and the surrounding eight tree nodes, and if so, Determine that there is an object that collides with the object; otherwise, determine that there is no object that collides with the object, but this method detects through the method of an octree, and the computer memory is too large during the detection process, and there is an error in the collision detection process. The problem of inefficiency

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Collision detection method and system
  • Collision detection method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0042] Please refer to figure 1 , Embodiment 1 of the present invention is:

[0043] A collision detection method provided by the present invention comprises the following steps:

[0044] Establish the two-dimensional coordinate system on the CANVAS canvas of HTML5;

[0045]The relative position and size of the first DOM rectangle structure picture and the second DOM rectangle structure picture are inserted into the CANVAS canvas unchanged;

[0046] Obtain the Alpha values ​​of pixels with the same coordinates in the first DOM rectangle structure picture and the second DOM rectangle structure picture through the API interface of the HTML5, and form the Alpha value pair set; S3: if the Alpha In the value pair set, if there is an Alpha value pair whose two Alpha values ​​are not 0, then the objects represented by the first DOM rectangle structure picture and the second DOM rectangle structure picture collide.

[0047] It can be seen from the above description that if it is de...

Embodiment 2

[0049] In a web game, when a game character is running, there is an irregular or regular obstacle in front of him. At this time, the character cannot penetrate the obstacle when he hits it. Then, whether the character collides with the obstacle, the detection method is as follows : Create a two-dimensional coordinate system on the CANVAS canvas of HTML5; obtain the Alpha values ​​of pixels with the same coordinates in the first DOM rectangle structure picture where the character is located and the second DOM rectangle structure picture where the obstacle is located, and form a set of Alpha value pairs ; If in the Alpha value pair set, there is an Alpha value pair whose two Alpha values ​​are not 0, then the character hits an obstacle, at this moment the person cannot pass through the obstacle, otherwise it will cause interference of different objects, affect the gaming experience.

Embodiment 3

[0051] In the field of web applications, in the field of education, the magnetic field simulator is a subject tool. When the small magnetic needle is dragged, it cannot collide with the magnet. Once it collides, it can continue to move the small magnetic needle. Continue to move the small magnetic needle and the magnet to affect the teaching effect; then whether the small magnetic needle and the magnet collide, you can establish a two-dimensional coordinate system on the HTML5 CANVAS canvas to obtain the first DOM rectangular structure picture where the small magnetic needle is located and the second DOM where the magnet is located The Alpha values ​​of pixels with the same coordinates in the rectangular structure picture form an Alpha value pair set; if there is an Alpha value pair in the Alpha value pair set, the two Alpha values ​​​​of an Alpha value pair are not 0, then the small magnetic needle and the magnet occur. collision.

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to the field of data analysis, in particular to a collision detection method and system. The method carries out collision detection in the following steps that: establishing a two-dimensional coordinate system; obtaining Alpha values of pixels with the same coordinate in a first DOM (Document Object Model) rectangular structure picture and a second DOM rectangular structure picture, and forming an Alpha value pair set; and if two Alpha values of one Alpha value pair are not zero in the Alpha value air set, proving that objects expressed by the first DOM rectangular structure picture and the second DOM rectangular structure picture collide. By use of the method, only a situation that one Alpha value pair in the Alpha value pair set is not zero needs to be detected, detection is stopped, object collision detection efficiency in the DOM structure is improved to a certain degree, meanwhile, the Alpha value of the pixel is subjected to pixel-level detection, and collision detection accuracy is improved.

Description

technical field [0001] The invention relates to the field of data analysis, in particular to a collision detection method and system. Background technique [0002] On the web side, since the pictures in the DOM structure are all rectangles, even if they are irregular pictures, they are also rectangles in the DOM structure; for collision detection of the objects contained in the rectangle, the method of narrowing the detection range is generally used, and Bind one or more collision detection areas of regular graphics locally on the object to make the final effect look more realistic. Usually, this detection area is called an internal test box, but this method is very inefficient and the steps are very cumbersome. , and the detection accuracy is low. [0003] The Chinese patent with the application number: 201210144554.X discloses a quadtree-based scene management method in online games. The method includes: establishing a coordinate system in any of the scenes, and any tree ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06T13/80G06T7/60
Inventor 刘德建黄世民高举全钟良德郭玉湖
Owner FUJIAN TIANQUAN EDUCATION TECH LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products