Search

CN-122006237-A - Virtual chess piece selection method, device, equipment, medium and product

CN122006237ACN 122006237 ACN122006237 ACN 122006237ACN-122006237-A

Abstract

The application discloses a method, a device, equipment, a medium and a product for selecting virtual chessmen, belonging to the field of man-machine interaction. The method comprises the steps of displaying a virtual chessboard in a three-dimensional virtual environment, wherein the virtual chessboard comprises at least two virtual chessmen, at least one three-dimensional virtual chessmen are placed in at least one occupied virtual chessmen of the virtual chessboard, responding to triggering operation for the virtual chessboard, acquiring collision detection information of the at least one three-dimensional virtual chessmen, acquiring first screen coordinates of a screen plane corresponding to the triggering operation, wherein the collision detection information is used for indicating a collision detection area of the three-dimensional virtual chessmen in the screen plane, and determining the three-dimensional virtual chessmen selected by touching the triggering operation based on the at least one collision detection information and the first screen coordinates. The three-dimensional virtual chessman selected by the player is judged on the screen plane, so that judgment delay is reduced while judgment precision is ensured.

Inventors

  • CAI CHENG
  • KUANG YE

Assignees

  • 腾讯科技(深圳)有限公司

Dates

Publication Date
20260512
Application Date
20241112

Claims (15)

  1. 1. A method of selecting a virtual pawn, the method comprising: Displaying a virtual chessboard in a three-dimensional virtual environment, wherein the virtual chessboard comprises at least two virtual chesses, and at least one three-dimensional virtual chesses are placed in at least one occupied virtual cheque of the virtual chessboard; The method comprises the steps of receiving trigger operation of a virtual chessboard, acquiring collision detection information of at least one three-dimensional virtual chess piece in response to the trigger operation of the virtual chessboard, and acquiring first screen coordinates of a screen plane corresponding to the trigger operation, wherein the collision detection information is used for indicating a collision detection area of the three-dimensional virtual chess piece in the screen plane; And determining the three-dimensional virtual chessman touched and selected by the triggering operation based on the at least one collision detection information and the first screen coordinates.
  2. 2. The method of claim 1, wherein the acquiring collision detection information for the at least one three-dimensional virtual chess piece in response to a triggering operation for the virtual chess board comprises: Responding to triggering operation aiming at the virtual chessboard, and acquiring second screen coordinates of the at least one occupied virtual chessboard; And determining collision detection information of the at least one three-dimensional virtual chess piece based on the second screen coordinates of the at least one occupied virtual chess grid.
  3. 3. The method according to claim 2, wherein the collision detection information includes position information, width, and height of the collision detection area; The determining collision detection information of the at least one three-dimensional virtual chess piece based on the second screen coordinates of the at least one occupied virtual chess grid comprises the following steps: obtaining the model size of the at least one three-dimensional virtual chess piece and/or obtaining the size of the at least one occupied virtual chess grid; determining the position information of the collision detection area of each three-dimensional virtual chess piece based on the second screen coordinates of the occupied virtual chess grid where each three-dimensional virtual chess piece is positioned; And determining the width and the height of the collision detection area of each three-dimensional virtual chess piece based on at least one of the second screen coordinates of the at least one occupied virtual chess piece, the model size of each three-dimensional virtual chess piece and the size of the occupied virtual chess piece where each three-dimensional virtual chess piece is located.
  4. 4. The method of claim 3, wherein said determining the width and height of the collision detection area of each three-dimensional virtual chess piece based on at least one of the second screen coordinates of the at least one occupied virtual chess piece, the model size of each three-dimensional virtual chess piece, and the size of the occupied virtual chess piece in which each three-dimensional virtual chess piece is located, comprises: Calculating a first difference value of a second screen coordinate of an occupied virtual chess grid where each three-dimensional virtual chess piece is located and a second screen coordinate of an adjacent virtual chess grid in the horizontal direction, and determining the width of a collision detection area of each three-dimensional virtual chess piece as the first difference value, wherein the adjacent virtual chess grid is a virtual chess grid adjacent to the occupied virtual chess grid where each three-dimensional virtual chess piece is located in the horizontal direction; And determining the model height of each three-dimensional virtual chess piece as the height of the collision detection area of each three-dimensional virtual chess piece.
  5. 5. The method according to any one of claims 2 to 4, further comprising: Responding to the triggering operation aiming at the virtual chessboard, determining a first chessboard coordinate of the triggering operation, wherein the first chessboard coordinate is used for indicating the position of a predicted virtual chess lattice corresponding to the triggering operation in the virtual chessboard, and the predicted virtual chess lattice is a virtual chess lattice with the closest triggering position of the triggering operation; And determining the virtual chess grid adjacent to the predicted virtual chess grid and placed with the three-dimensional virtual chess pieces as an occupied virtual chess grid based on the first chessboard coordinates of the triggering operation.
  6. 6. The method according to any one of claims 1 to 5, wherein said determining a three-dimensional virtual pawn selected by touching by said triggering operation based on said at least one collision detection information and said first screen coordinates comprises: Performing collision detection on a collision detection area of each three-dimensional virtual chess piece based on the at least one collision detection information and the first screen coordinates; and determining the three-dimensional virtual chess pieces corresponding to the collision detection areas through the collision detection as the three-dimensional virtual chess pieces selected by touching by the triggering operation.
  7. 7. The method of claim 6, wherein the performing collision detection on the collision detection region for each three-dimensional virtual pawn based on the at least one collision detection information and the first screen coordinates comprises: determining third screen coordinates of at least two contour points of each collision detection region based on each collision detection information in the at least one collision detection information, wherein the contour points are points on the contour of the collision detection region; For a first collision detection region in the at least one collision detection information, performing collision detection on the at least one collision detection region based on at least two contour points corresponding to the first collision detection region and the first screen coordinates.
  8. 8. The method of claim 7, wherein the collision detection area is a regular hexagon, the collision detection area comprising six contour points, the contour points being vertices of the regular hexagon; The performing, for a first collision detection region based on the at least one collision detection information, collision detection of the at least one collision detection region based on third screen coordinates and the first screen coordinates of the at least two contour points corresponding to the first collision detection region, includes: determining a rectangular detection area and four triangular detection areas based on third screen coordinates of the six contour points, wherein the rectangular detection area and the four triangular detection areas are not overlapped with each other; determining whether the first screen coordinates are located in the rectangular detection area or not based on third screen coordinates of four contour points corresponding to the rectangular detection area; determining whether the first screen coordinates are located in the triangular detection areas or not based on third screen coordinates of two contour points corresponding to each of the four triangular detection areas; determining that the first collision detection region passes the collision detection in a case where the first screen coordinates are located in any one of the rectangular detection region and the four triangular detection regions; And determining that the first collision detection area does not pass the collision detection in the case that the first screen coordinates are not located in the rectangular detection area and the four triangular detection areas.
  9. 9. A method according to any one of claims 6 to 8, wherein there is a priority for each virtual grid in the virtual board; the determining that the three-dimensional virtual chess piece corresponding to the collision detection area through the collision detection is the three-dimensional virtual chess piece selected by touching by the triggering operation comprises the following steps: And under the condition that collision detection areas corresponding to at least two three-dimensional virtual chessmen pass through the collision detection, determining the three-dimensional virtual chessmen with the highest priority of the virtual chessmen to be the three-dimensional virtual chessmen selected by the triggering operation based on the priority of the virtual chessmen of each three-dimensional virtual chessmen.
  10. 10. A selection device for a virtual pawn, the device comprising: the display module is used for displaying a virtual chessboard in the three-dimensional virtual environment, the virtual chessboard comprises at least two virtual chesses, and at least one three-dimensional virtual chesses are placed in at least one occupied virtual cheque of the virtual chessboard; The system comprises a virtual chessboard, a response module, a first screen coordinate acquisition module, a second screen coordinate acquisition module and a third screen coordinate acquisition module, wherein the virtual chessboard is used for acquiring the collision detection information of at least one three-dimensional virtual chessman in response to the triggering operation of the virtual chessboard; And the determining module is used for determining the three-dimensional virtual chessman touched and selected by the triggering operation based on the at least one collision detection information and the first screen coordinates.
  11. 11. The apparatus of claim 10, wherein the response module comprises: The acquisition sub-module is used for responding to the triggering operation aiming at the virtual chessboard and acquiring the second screen coordinates of the at least one occupied virtual chess grid; and the determining submodule is used for determining collision detection information of the at least one three-dimensional virtual chess piece based on the second screen coordinates of the at least one occupied virtual chess grid.
  12. 12. The apparatus of claim 11, wherein the collision detection information includes location information, width, and height of the collision detection zone; The determining submodule is further used for obtaining the model size of the at least one three-dimensional virtual chess piece and/or obtaining the size of the occupied virtual chess grid, determining the position information of the collision detection area of each three-dimensional virtual chess piece based on the second screen coordinates of the occupied virtual chess grid where each three-dimensional virtual chess piece is located, and determining the width and the height of the collision detection area of each three-dimensional virtual chess piece based on at least one of the second screen coordinates of the at least one occupied virtual chess grid, the model size of each three-dimensional virtual chess piece and the size of the occupied virtual chess grid where each three-dimensional virtual chess piece is located.
  13. 13. A computer device, characterized in that it comprises a processor and a memory, in which a computer program is stored, which computer program is loaded and executed by the processor to implement the method of selecting a virtual pawn according to any one of claims 1 to 9.
  14. 14. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements a method of selecting a virtual pawn according to any one of claims 1 to 9.
  15. 15. A computer program product, characterized in that the computer program product comprises a computer program stored in a computer readable storage medium, which computer program is read from the computer readable storage medium and executed by a processor of a computer device, such that the computer device performs the method of selecting a virtual pawn according to any one of claims 1 to 9.

Description

Virtual chess piece selection method, device, equipment, medium and product Technical Field The application relates to the field of man-machine interaction, in particular to a method, a device, equipment, a medium and a product for selecting virtual chessmen. Background The self-playing chess game is a round-making chess game, and a player needs to select one or more virtual chesses (which may be simply called chesses) from newly purchased virtual chesses or from the already owned virtual chesses, and place the virtual chesses on a virtual chessboard to fight against virtual chesses of an enemy. The virtual chessboard is the battlefield of the virtual chessmen. The player can place the virtual chessmen at different positions of the virtual chessboard in a mode of dragging the virtual chessmen to arrange the chessmen so as to realize different strategies, such as placing the virtual chessmen good for nearby combat at the front row, placing the virtual chessmen good for far attack at the back row, and the like. In the related art, when a player drags a virtual chess piece, it is generally determined whether a ray sent from a clicking position intersects a bounding box surrounding the virtual chess piece, but the method has a complex calculation mode and a high calculation time delay. Disclosure of Invention The application provides a method, a device, equipment, a medium and a product for selecting virtual chessmen, which have the following technical scheme: According to an aspect of the present application, there is provided a method of selecting a virtual pawn, the method comprising: Displaying a virtual chessboard in a three-dimensional virtual environment, wherein the virtual chessboard comprises at least two virtual chesses, and at least one three-dimensional virtual chesses are placed in at least one occupied virtual cheque of the virtual chessboard; The method comprises the steps of receiving trigger operation of a virtual chessboard, acquiring collision detection information of at least one three-dimensional virtual chess piece in response to the trigger operation of the virtual chessboard, and acquiring first screen coordinates of a screen plane corresponding to the trigger operation, wherein the collision detection information is used for indicating a collision detection area of the three-dimensional virtual chess piece in the screen plane; And determining the three-dimensional virtual chessman touched and selected by the triggering operation based on the at least one collision detection information and the first screen coordinates. According to an aspect of the application, there is provided a selection device of virtual pawns, the device comprising: the display module is used for displaying a virtual chessboard in the three-dimensional virtual environment, the virtual chessboard comprises at least two virtual chesses, and at least one three-dimensional virtual chesses are placed in at least one occupied virtual cheque of the virtual chessboard; The system comprises a virtual chessboard, a response module, a first screen coordinate acquisition module, a second screen coordinate acquisition module and a third screen coordinate acquisition module, wherein the virtual chessboard is used for acquiring the collision detection information of at least one three-dimensional virtual chessman in response to the triggering operation of the virtual chessboard; And the determining module is used for determining the three-dimensional virtual chessman touched and selected by the triggering operation based on the at least one collision detection information and the first screen coordinates. According to an aspect of the present application, there is provided a computer device comprising a processor and a memory, the memory having stored therein a computer program, the computer program being loaded and executed by the processor to implement a method of selecting a virtual pawn. According to an aspect of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, implements a method of selecting a virtual pawn. According to an aspect of the application a computer program product is provided, the computer program product comprising a computer program stored in a computer readable storage medium, the computer program being read from the computer readable storage medium and executed by a processor of a computer device, causing the computer device to perform a method of selecting a virtual pawn. The technical scheme provided by the application has the beneficial effects that at least: The three-dimensional virtual chessmen are mapped to the screen plane to obtain collision detection information of each three-dimensional virtual chessmen, and judgment is carried out based on the first plane coordinates of the triggering operation of the user on the screen plane and the collision detection information of each three-dime