Computer program, computer system, and computer control method

The computer program optimizes collision detection in virtual spaces by converting coordinates and identifying proximal and distal data to reduce computational load and enhance accuracy.

JP7824558B1Active Publication Date: 2026-03-05CAPCOM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

Existing methods for determining collisions between fluid particles and objects in virtual three-dimensional spaces require a high computational load, particularly when multiple surfaces are involved.

Method used

A computer program that converts three-dimensional coordinates into a projection coordinate system, identifies proximal and distal data based on camera orientation and depth information, and determines collisions using these data to reduce the number of surfaces requiring collision checks.

Benefits of technology

Reduces the calculation load for collision determination by focusing on specific portions of the object's surface relative to the camera, allowing for more accurate and efficient collision detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007824558000001_ABST
    Figure 0007824558000001_ABST
Patent Text Reader

Abstract

To reduce the calculation load required for determining collision between objects. [Solution] One embodiment of a computer program causes a computer to function as an object generation means for generating a first object and a second object in a virtual space, a camera placement means, a coordinate conversion means for converting the world coordinate system into a projection coordinate system for the three-dimensional coordinates of the surface of the first object to obtain first data including two-dimensional coordinates on the projection surface and depth information regarding the distance from the virtual camera to each three-dimensional coordinate, a proximal data storage means for saving the first data having the shortest distance from the virtual camera as proximal data, a distal data storage means for saving the first data having the longest distance from the virtual camera as distal data, and a collision determination means for determining whether the second object has collided with the first object.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a computer program, a computer system, and a computer control method. [Background technology]

[0002] In the field of computer graphics, methods have been devised for expressing fluids such as smoke and fog in a virtual three-dimensional space. For example, Non-Patent Document 1 discloses a method for expressing a three-dimensional fluid by generating computer graphics while performing a three-dimensional fluid simulation in a three-dimensional virtual space. [Prior art documents] [Patent documents]

[0003] [Non-Patent Document 1] QING YANG, "Real-Time Simulation of 3D Smoke on GPU", Proceedings of the 3rd WSEAS Int. Conf. on CIRCUITS, SYSTEMS, SIGNAL and TELECOMMUNICATIONS (CISST'09), pp.130-134, [online], [Retrieved February 17, 2025], http: / / www.wseas.us / e-library / conferences / 2009 / ningbo / CD-CISST / CISST25.pdf Summary of the Invention [Problem to be solved by the invention]

[0004] In the field of computer graphics, it is desirable to represent the interaction between multiple fluid particles (particles) and other objects in a virtual space in a way that is consistent with the real world. One method for determining whether a particle has collided with an object is to determine whether a particle has collided with each of the many faces (meshes) that make up the object, but this method has the problem of requiring a large computational load. This problem can also occur in determining collisions between objects other than particles.

[0005] SUMMARY OF THE INVENTION It is therefore an object of the present invention to provide a computer program, a computer system, and a computer control method that can reduce the calculation load required to determine whether objects collide with each other. [Means for solving the problem]

[0006] A computer program according to one embodiment of the present invention causes a computer to function as: an object generation means for generating a first object and a second object that moves relative to the first object in a virtual space; a camera placement means for placing a virtual camera in the virtual space to capture an image to be displayed on a screen; a coordinate conversion means for converting three-dimensional coordinates of the surface of the first object included in the imaging range of the virtual camera in the world coordinate system into a projection coordinate system to acquire first data including two-dimensional coordinates on a projection surface according to the orientation of the virtual camera and depth information regarding the distance from the virtual camera to each of the three-dimensional coordinates; a proximal data storage means for saving, as proximal data, the first data that is the closest to the virtual camera among a plurality of first data sets that have the same two-dimensional coordinates but different depth information; a distal data storage means for saving, as distal data, the first data that is the farthest from the virtual camera among a plurality of first data sets that have the same two-dimensional coordinates but different depth information; and a collision determination means for determining whether the second object has collided with the first object based on the proximal data, the distal data, and the position of the second object.

[0007] According to the computer program, a collision determination between the first object and the second object is performed based on the proximal portion data, the distal portion data, and the position of the second object. Therefore, the calculation load required for the collision determination can be reduced compared to when a collision determination with the second object is performed for all surfaces of the first object. In particular, even when the first object is composed of many surfaces, it is not necessary to perform a collision determination with the second object for each of the many surfaces.

[0008] The computer program may further cause the computer to function as a virtual surface placement means for placing a predetermined virtual near surface in a direction in which the virtual camera faces and for placing a predetermined virtual far surface distal to the virtual near surface with respect to the virtual camera, the imaging range being between the virtual near surface and the virtual far surface in the virtual space, the near portion data storage means may identify the first data having the shortest distance from the virtual near surface by comparing distances from the virtual near surface for a plurality of first data having the same two-dimensional coordinates but different depth information, and the far portion data storage means may identify the first data having the shortest distance from the virtual far surface by comparing distances from the virtual far surface for a plurality of first data having the same two-dimensional coordinates but different depth information. This facilitates calculation of the near portion and the far portion of the surface of the first object with respect to the virtual camera.

[0009] The second object may be a particle, which can reduce the calculation load for collision detection of the particle against the object.

[0010] The computer program is configured such that the camera placement means places a second camera, which is a virtual camera different from the first camera, in the virtual space in addition to the first camera, the coordinate conversion means converts the world coordinate system into the first projected coordinate system, which is the projected coordinate system, for three-dimensional coordinates of the surface of the first object, and also converts the world coordinate system into the second projected coordinate system for three-dimensional coordinates of the surface of the first object included in the imaging range of the virtual camera in the world coordinate system, to obtain second data including two-dimensional coordinates on a projection plane according to the orientation of the second camera and depth information regarding a distance from the second camera to each of the three-dimensional coordinates, and the proximal part data storage means stores the proximal part data. In addition to storing first proximal portion data, the distal portion data storage means may store, among a plurality of second data sets having the same two-dimensional coordinates but different depth information, the second data set having the shortest distance from the second camera as second proximal portion data, and in addition to storing first distal portion data which is the distal portion data, the distal portion data storage means may store, among a plurality of second data sets having the same two-dimensional coordinates but different depth information, the second data set having the longest distance from the second camera as second distal portion data, and the collision determination means may determine whether the second object has collided with the first object based on the first proximal portion data, the first distal portion data, the second proximal portion data, the second distal portion data, and the position of the second object.

[0011] According to the computer program, it is possible to more accurately determine whether the second object has collided with a portion of the surface of the first object that is not displayed on the screen.

[0012] A home system according to one aspect of the present invention includes a program storage unit that stores the computer program described above, and a computer that executes the program stored in the program storage unit.

[0013] A computer-controlled method according to one embodiment of the present invention includes an object generation step of generating a first object and a second object that moves relative to the first object in a virtual space; a camera placement step of placing a virtual camera in the virtual space to capture an image to be displayed on a screen; a coordinate conversion step of converting three-dimensional coordinates of the surface of the first object included in the imaging range of the virtual camera in the world coordinate system into a projection coordinate system to obtain first data including two-dimensional coordinates on a projection surface according to the orientation of the virtual camera and depth information regarding the distance from the virtual camera to each of the three-dimensional coordinates; a proximal data storage step of saving, as proximal data, first data that is the shortest distance from the virtual camera among a plurality of first data that have the same two-dimensional coordinates but different depth information; a distal data storage step of saving, as distal data, first data that is the longest distance from the virtual camera among a plurality of first data that have the same two-dimensional coordinates but different depth information; and a collision determination step of determining whether the second object has collided with the first object based on the proximal data, the distal data, and the position of the second object. [Effects of the Invention]

[0014] According to one aspect of the present invention, it is possible to reduce the calculation load required to determine whether objects collide with each other. [Brief explanation of the drawings]

[0015] [Figure 1] 1 is a block diagram showing the configuration of a computer system according to a first embodiment of the present invention. [Figure 2] 4 is a flowchart of a collision determination process according to the first embodiment. [Figure 3] FIG. 2 is a plan view of an example of a virtual space. [Figure 4] FIG. 10 is a plan view of a virtual space for explaining a change in the drawing range before and after perspective projection. [Figure 5]3 is a plan view of a virtual space for explaining an example of a virtual object subject to collision determination set in the first embodiment. FIG. [Figure 6] FIG. 10 is a plan view of a virtual space for explaining an example of a virtual object subject to collision determination set in the second embodiment. [Figure 7] 10 is a flowchart of a collision determination process according to the second embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0016] [First embodiment] A computer device 1 that realizes a computer system according to an embodiment of the present invention will now be described. For example, the computer device 1 may be a computer device used for game development and operated by a game developer. Alternatively, the computer device 1 may be a game device owned by a user who plays a game. Alternatively, the computer device 1 may be a game server that is connected to and communicates with a game device on the user's side that plays a game.

[0017] In the game described in this embodiment, a user moves a player object (player character) in a three-dimensional virtual space, thereby moving a virtual camera corresponding to the player object in the virtual space. A plurality of objects are arranged in the virtual space. Among the plurality of objects are particles that move in the virtual space. When a particle collides with another object, the moving direction of the particle is changed.

[0018] <Hardware configuration> The hardware configuration of the computer device 1 will be described with reference to FIG.

[0019] The computer device 1 includes a control unit 2, a memory unit 3, a network interface 4, an operation unit 5, and a display unit 6. The memory unit 3, the network interface 4, the operation unit 5, and the display unit 6 are connected to the control unit 2 via a dedicated bus, a wired or wireless interface, or the like.

[0020] The control unit 2 controls the operation of the computer device 1. The control unit 2 includes processors such as a CPU (Central Processing Unit) and a GPU (Graphics Processing Unit). The control unit 2 executes various processing operations such as calculations, controls, and determinations. For example, the control unit 2 draws an image to be displayed on the display unit 6.

[0021] The storage unit 3 stores programs for implementing various functions of the computer device 1, data used during the execution of these programs, and the like. The storage unit 3 is mainly composed of an HDD (Hard Disk Drive), RAM (Random Access Memory), and ROM (Read Only Memory). The programs stored in the storage unit 3 include a computer program 3a for executing a collision detection process, which will be described later. The computer program 3a includes a game engine, which is a common program used to perform main processing in the operation of various computer games.

[0022] The network interface 4 is connected to a network such as a LAN (Local Area Network) or the Internet.

[0023] The operation unit 5 is a pointing device such as a keyboard or a mouse, a dedicated or general-purpose game controller, a touch panel, an acceleration sensor, etc. A user uses the operation unit 5 to give operation instructions to the control unit 2.

[0024] The display unit 6 is a dot matrix display such as an LCD (Liquid Crystal Display) or an organic EL display.

[0025] The above-described components of the computer device 1 are hardware resources that execute the computer program 3a of this embodiment.

[0026] <Functional configuration of the control unit> Fig. 1 shows the functional configuration of the control unit 2 of the computer device 1. As shown in Fig. 1, the control unit 2 executes a computer program 3a stored in the storage unit 3, thereby functioning as a virtual space generation means 11, a camera placement means 12, a drawing range setting means 13, a coordinate conversion means 14, a proximal portion data storage means 15, a distal portion data storage means 16, a collision determination means 17, and a screen display means 18.

[0027] The virtual space generation means 11 generates a three-dimensional virtual space. The virtual space generation means 11 includes object generation means 21. The object generation means 21 generates objects to be placed in the virtual space. The object generation means 21 generates a first object and a second object that moves relative to the first object in the virtual space. In this embodiment, the second object is a large number of fluid particles that move in the virtual space, and the first object is an object other than the second object that is included in a drawing range described below. In the game described in this embodiment, the first object may be, for example, a character object, a building object with which the character object can interfere, or a furniture object. The second object may be an effect such as smoke or sparks made up of particles.

[0028] The camera placement means 12 places in the virtual space a virtual camera that captures an image to be displayed on the screen of the display unit 6. The camera placement means 12 also moves the virtual camera within the virtual space in response to, for example, a user's operation on the operation unit 5.

[0029] The drawing range setting means 13 sets the drawing range. The drawing range is the range of the virtual camera in the virtual space, and is the range displayed on the screen of the display unit 6. The drawing range may also be called a view volume. The drawing range setting means 13 sets the drawing range based on the position and orientation of the virtual camera in the virtual space.

[0030] The drawing range setting means 13 includes a virtual plane placement means 22. The virtual plane placement means 22 places a predetermined virtual near plane in the direction in which the virtual camera faces, and places a predetermined virtual far plane on the distal side of the virtual near plane with respect to the virtual camera.

[0031] The coordinate conversion means 14 converts the three-dimensional coordinates of the surface of the first object included in the imaging range of the virtual camera in the world coordinate system into the projection coordinate system.

[0032] Furthermore, the coordinate conversion means 14 acquires first data including two-dimensional coordinates on the projection surface according to the orientation of the virtual camera and depth information regarding the distance from the virtual camera to each three-dimensional coordinate. In other words, the coordinate conversion means 14 acquires first data including XY coordinates and Z coordinates of the surface of the first object in the projection coordinate system.

[0033] Among a plurality of first data having the same two-dimensional coordinates but different depth information, the proximal part data storage means 15 stores the first data having the shortest distance from the virtual camera as the proximal part data. In other words, among a plurality of first data having the same XY coordinates but different Z coordinates in the projection coordinate system, the proximal part data storage means 15 stores the first data having the smallest Z coordinate in the storage unit 3 as the proximal part data.

[0034] Among a plurality of first data having the same two-dimensional coordinates but different depth information, the distal part data storage means 16 stores the first data having the longest distance from the virtual camera as the distal part data. In other words, among a plurality of first data having the same XY coordinates but different Z coordinates in the projection coordinate system, the distal part data storage means 16 stores the first data having the largest Z coordinate in the memory unit 3 as the distal part data.

[0035] The collision determination means 17 determines whether or not the second object has collided with the first object based on the proximal part data, the distal part data and the position of the second object.

[0036] Screen display means 18 displays on display unit 6 an image taken by a virtual camera placed in the virtual space.

[0037] [Collision detection processing] In this embodiment, the control unit 2 executes a predetermined computer program 3a stored in the storage unit 3, thereby carrying out collision determination processing related to collisions between objects in the virtual space S. The collision determination processing will be described with reference to the flowchart of FIG.

[0038] <Step S1: Set the drawing range> In the collision determination process, the drawing range setting means 13 sets a drawing range R, as shown in FIG.

[0039] FIG. 3 shows a plan view of an example of a virtual space S. A virtual camera C is placed in the virtual space S. Two first objects B1 and multiple second objects B2 are placed in the virtual space S by the object generation means 21. The first object B1 is fixedly placed in the virtual space S. The first object B1 has a rectangular parallelepiped shape. The multiple second objects B2 are particles that move within the virtual space S. As indicated by the arrows in FIG. 3, the multiple second objects B2 move relative to the first object B1 within the virtual space S.

[0040] In the example of FIG. 3, two first objects B1 are lined up in the line of sight of virtual camera C. In the following description, the object closer to virtual camera C will be referred to as first object B1a, and the object farther from virtual camera C will be referred to as first object B1b, to distinguish between the two first objects B1. When the first objects B1a and B1b are not to be distinguished, they will be collectively referred to as first object B1. The first objects B1a and B1b are arranged at an interval in the line of sight of virtual camera C. The first object B1a closer to virtual camera C is larger than the first object B1b farther from virtual camera C.

[0041] 3 shows a rendering range R. In this embodiment, a perspective projection transformation is used as the projection transformation for projecting an object in a three-dimensional virtual space S onto a two-dimensional surface. For this reason, the rendering range R is approximately frustum-shaped.

[0042] More specifically, the virtual plane placement means 22 places a predetermined virtual near plane D1 in the direction in which the virtual camera C faces, and places a predetermined virtual far plane D2 distal to the virtual near plane D1 with respect to the virtual camera C. Both the virtual near plane D1 and the virtual far plane D2 are rectangular. In this embodiment, the drawing range setting means 13 sets the area sandwiched between the virtual near plane D1 and the virtual far plane D2 in the line of sight of the virtual camera C as the drawing range R. The virtual near plane D1 is the so-called front clip plane D1, and the virtual far plane D2 is the so-called rear clip plane D2. Both the virtual near plane D1 and the virtual far plane D2 are perpendicular to the line of sight of the virtual camera C. The drawing range R is substantially a truncated quadrangular pyramid with the virtual near plane D1 as the top surface and the virtual far plane D2 as the bottom surface. In this embodiment, the distance between the virtual camera C and the virtual near plane D1 and the distance between the virtual camera C and the virtual far plane D2 are predetermined.

[0043] <Step S2: Coordinate transformation> The coordinate transformation means 14 performs perspective projection transformation on the drawing area R and the elements within the drawing area R. FIG. 4 is a plan view of the virtual space S, schematically showing the change in the drawing area R before and after perspective projection. In FIG. 4, the approximately frustum-shaped drawing area R before perspective projection transformation is indicated by a two-dot dashed line, and the approximately rectangular parallelepiped-shaped drawing area R' after perspective projection transformation is indicated by a solid line. Note that in FIG. 4 and several figures following FIG. 5, elements other than the drawing area, such as the first object B1 and the second object B2, are denoted by the same reference numerals without distinction between before and after perspective projection transformation.

[0044] Specifically, the coordinate transformation means 14 transforms the approximately frustum-shaped rendering range R from a world coordinate system set for the virtual space S to a camera coordinate system with the position of the virtual camera C as the origin (viewpoint transformation). Then, the coordinate transformation means 14 transforms the approximately frustum-shaped rendering range R from the camera coordinate system to a projection coordinate system (perspective projection transformation). As a result, as shown in FIG. 4, the approximately frustum-shaped rendering range R is transformed into an approximately rectangular parallelepiped rendering range R'. Meanwhile, for example, each first object B1, which was approximately rectangular parallelepiped before the perspective projection transformation, becomes a frustum-shaped object after the perspective projection transformation, with the surface on the virtual near plane D1 side as the bottom surface and the surface on the virtual far plane D2 side as the top surface. In the perspective projection transformation, among the objects within the rendering range R, objects closer to the virtual camera C appear larger than objects of the same size that are farther from the virtual camera C. The XY plane in the projection coordinate system is perpendicular to the line of sight of virtual camera C and parallel to the projection surface, and the Z axis in the projection coordinate system extends in the line of sight of virtual camera C, in other words, in the depth direction of the screen.

[0045] <Step S3: First Data Acquisition> The coordinate conversion means 14 acquires first data including two-dimensional coordinates on the projection surface according to the orientation of the virtual camera C and depth information relating to the distance from the virtual camera to each three-dimensional coordinate. In other words, the coordinate conversion means 14 acquires, as the first data, three-dimensional coordinates (X, Y, Z) of the surface of the first object B1 in the projection coordinate system after the perspective projection transformation.

[0046] <Step S4: Save proximal data> The proximal part data storage means 15 stores, as proximal part data, the first data having the shortest distance from the virtual camera C among a plurality of first data having the same XY coordinates, which are two-dimensional coordinates in the projection coordinate system, but different Z coordinates, which are depth information. That is, the proximal part data storage means 15 compares the distances from the virtual near plane D1 between the plurality of first data having the same two-dimensional coordinates but different depth information, thereby identifying the first data having the shortest distance from the virtual near plane D1 and storing it in the memory unit 3 as proximal part data.

[0047] <Step S5: Save distal data> The distal portion data storage means 16 stores, as distal portion data, the first data having the longest distance from the virtual camera C among a plurality of first data having the same XY coordinates, which are two-dimensional coordinates in the projection coordinate system, but different Z coordinates, which are depth information. That is, the distal portion data storage means 16 compares the distances from the virtual far plane D2 of the plurality of first data having the same two-dimensional coordinates but different depth information, thereby identifying the first data having the shortest distance from the virtual far plane D2 and storing it in the memory unit 3 as distal portion data.

[0048] <Step S6: Setting Virtual Objects for Collision Detection> The collision determination means 17 sets a virtual object to be subjected to collision determination based on the proximal portion data and the distal portion data. FIG. 5 is a plan view of the virtual space S for explaining an example of a virtual object F to be subjected to collision determination. In FIG. 5, the first object B1 is indicated by a dashed line. A collection of the proximal portion data forms a boundary surface VF (hereinafter, may be referred to as the front surface VF) of the virtual object F to be subjected to collision determination that faces the virtual camera C. Furthermore, a collection of the distal portion data forms a boundary surface VB (hereinafter, may be referred to as the back surface VB) of the virtual object F to be subjected to collision determination that faces away from the virtual camera C.

[0049] The collision determination means 17 defines the area sandwiched between the front surface VF, which is a set of coordinate positions of the proximal part data, and the back surface VB, which is a set of coordinate positions of the distal part data, in the Z direction, which is the line of sight direction of the virtual camera C, as a virtual object F to be subjected to collision determination.

[0050] The collision determination means 17, as necessary, complements the gap between adjacent surfaces among the multiple surfaces included in the front surface VF, or complements the gap between adjacent surfaces among the multiple surfaces included in the rear surface VB. Specifically, using the example of FIG. 3, the first objects B1a and B1b are arranged at an interval in the line of sight of the virtual camera C, i.e., the Z direction. Therefore, on the rear surface VB, there is a difference in the Z direction between the surface vba of the first object B1a and the surface vbb of the first object B1b. When there is a difference in the Z direction between the adjacent surfaces vba and vbb included in the rear surface VB, the collision determination means 17 sets the side surface vs connecting the adjacent surfaces vba and vbb as a surface part of the rear surface VB. The side surface vs extends parallel to the Z direction.

[0051] <Step S7: Collision detection> The collision determination means 17 determines whether the second object B2 has collided with the first object B1 based on the proximal part data, the distal part data, and the position of the second object B2. In other words, when the collision determination means 17 determines that the second object B2 has collided with a virtual object F subject to collision determination created from the first object B1, it determines that the second object B2 has collided with the first object B1.

[0052] 5 schematically shows an example in which the second object B2 collides with a virtual object F subject to collision detection and the movement direction of the second object B2 is changed. For example, when the second object B2 collides with the virtual object F subject to collision detection, the collision determination means 17 changes the movement direction according to the orientation of the collided surface of the virtual object F subject to collision detection. In this way, a situation in which the second object B2 collides with the first object B1 and bounces off is expressed.

[0053] [summary] To summarize the above, the computer program 3a according to this embodiment includes a control unit 2 (computer) that controls: object generation means 21 that generates a first object B1 and a second object B2 that moves relatively to the first object B1 in a virtual space S; camera placement means 12 that places a virtual camera C that captures an image to be displayed on a screen in the virtual space S; and a coordinate conversion means 13 that converts the world coordinate system into a projection coordinate system to convert three-dimensional coordinates of the surface of the first object B1 included in the imaging range of the virtual camera C in a world coordinate system into two-dimensional coordinates on a projection surface according to the orientation of the virtual camera C and distances from the virtual camera C to each of the three-dimensional coordinates. a coordinate conversion means 14 for acquiring first data including depth information representing the distance from the virtual camera C to the first object B1; a proximal data storage means 15 for storing, as proximal data, the first data having the shortest distance from the virtual camera C among a plurality of first data having the same two-dimensional coordinates but different depth information; a distal data storage means 16 for storing, as distal data, the first data having the longest distance from the virtual camera C among a plurality of first data having the same two-dimensional coordinates but different depth information; and a collision determination means 17 for determining whether the second object B2 has collided with the first object B1 based on the proximal data, the distal data, and the position of the second object.

[0054] [Action and effect] According to the computer program 3a of this embodiment, a collision determination between the first object B1 and the second object B2 is performed based on the proximal part data, the distal part data, and the position of the second object B2. Therefore, the calculation load required for the collision determination can be reduced compared to when a collision determination with the second object B2 is performed for all faces of the first object B1.

[0055] In this embodiment, the first object B1 has been described as having a simple rectangular parallelepiped shape as an example, but the collision detection described in this embodiment has a significant effect in that it is not necessary to perform collision detection of the second object B2 against each of the many faces of the first object B1, particularly when the first object B1 is composed of many faces.

[0056] Incidentally, one possible method for detecting collisions between objects and particles is to use the object's depth buffer. That is, by determining the depth position of the object's depth buffer, i.e., the surface of the object that is visible on the screen (hereinafter referred to as the front surface), it is possible to determine that the object and particle will not collide if the particle is located in front of the object's front surface. However, a collision detection method using a depth buffer does not have a way to identify the shape of the object beyond the front surface of the object. Therefore, for example, the object is treated as a three-dimensional object extending from the front surface of the object to the rear clipping plane. Therefore, a collision detection method using a depth buffer cannot express the movement of a particle that is hidden by the front surface of the object and becomes invisible on the screen, even if the particle is actually located beyond the front surface of the object. This can cause a sense of incongruity to the viewer.

[0057] However, in this embodiment, when determining whether a collision between a first object B1 and a second object B2 will occur, not only the proximal portion of the surface of the first object B1 that is displayed on the screen but also the distal portion that may not be displayed on the screen is used to determine whether the second object B2 will collide with the first object B1. This allows for more accurate collision determination than collision determination using a depth buffer, which cannot determine whether a collision between the non-displayed portion of the first object B1 and the second object B2 will occur. This reduces the calculation load required to determine whether a collision occurs between objects, and contributes to the rendering of a collision scene between objects that is less likely to cause discomfort to the viewer.

[0058] In this embodiment, the virtual surface placement means 22 places a predetermined virtual near surface in the direction in which the virtual camera C faces, and places a predetermined virtual far surface D2 distal to the virtual near surface D1 with respect to the virtual camera C, the proximal portion data storage means 15 stores, as the proximal portion data, the first data that is the shortest distance from the virtual camera C among a plurality of first data that have the same two-dimensional coordinates but different depth information, and the distal portion data storage means 16 stores, as the distal portion data, the first data that is the longest distance from the virtual camera C among a plurality of first data that have the same two-dimensional coordinates but different depth information. This makes it possible to easily calculate the proximal and distal portions of the surface of the first object B1.

[0059] Furthermore, in this embodiment, since the second object B2 is a particle, the calculation load for collision detection of the particle with the first object B1 can be reduced.

[0060] [Second embodiment] Next, a computer device according to a second embodiment will be described with reference to Figures 6 and 7. The hardware configuration of the computer device of this embodiment is the same as that of the first embodiment, so a description thereof will be omitted. Also, a description of the functional configuration of the control unit that overlaps with that of the first embodiment will be omitted.

[0061] 6 is a plan view of a virtual space S for explaining an example of a virtual collision detection target object F2 set in the second embodiment. In this embodiment, as in the virtual space S exemplified in the first embodiment, two first objects B1 are lined up in the line of sight of a virtual camera C. As shown in FIG. 6, in this embodiment, the camera placement means 12 places a second camera C2, which is a virtual camera separate from the first camera C1, in the virtual space S in addition to a virtual camera C (hereinafter referred to as a first camera C1).

[0062] The first camera C1 captures an image displayed on the screen of the display unit 6, but the second camera C2 does not capture an image displayed on the screen of the display unit 6. That is, the scene as seen from the first camera C1 is displayed on the screen of the display unit 6. The first camera C1 is movable in the virtual space S in response to a user operation. Note that, since FIG. 6 is a perspective projection view based on the first camera C1, the shapes of the two first objects B1 in FIG. 6 are shown as the same shapes as the two first objects B1 in FIG. 5.

[0063] The second camera C2 is fixedly disposed in the virtual space S. That is, the second camera C2 is located at predetermined coordinates in the world coordinate system. In Fig. 6, the second camera C2 is disposed so that the line of sight of the second camera C2 intersects with the line of sight of the first camera C1. For example, the line of sight of the second camera C2 is perpendicular to the line of sight of the first camera C1.

[0064] Fig. 7 is a flowchart of the collision determination process according to the second embodiment. Steps S11 to S15 in the flowchart of Fig. 7 are the same as steps S1 to S5 of the collision determination process described in the first embodiment, and therefore detailed description thereof will be omitted.

[0065] <Step S11: Set the drawing range> In the collision determination process, the drawing range setting means 13 sets the drawing range based on the position and orientation of the first camera C1 in the virtual space S.

[0066] <Step S12: Coordinate transformation based on the first camera> The coordinate conversion means 14 converts the world coordinate system into a projected coordinate system for the three-dimensional coordinates of the surface of the first object B1, with the first camera C1 as the reference. The projected coordinate system with the first camera C1 as the reference is referred to as the first projected coordinate system.

[0067] <Step S13: First Data Acquisition> The coordinate conversion means 14 acquires first data including two-dimensional coordinates on the projection surface according to the orientation of the first camera C1 and depth information relating to the distance from the first camera C1 to each three-dimensional coordinate. In other words, the coordinate conversion means 14 acquires, as the first data, three-dimensional coordinates (X, Y, Z) of the surface of the first object B1 in the first projection coordinate system after perspective projection transformation.

[0068] <Step S14: Saving first proximal portion data> The proximal part data storage means 15 stores, as the first proximal part data, the first data that is the shortest distance from the first camera C1 among multiple first data that have the same XY coordinates, which are two-dimensional coordinates in the first projection coordinate system, but different Z coordinates, which are depth information.

[0069] <Step S15: Save first distal portion data> The distal part data storage means 16 stores, as the first distal part data, the first data that is the longest distance from the first camera C1 among multiple first data that have the same XY coordinates, which are two-dimensional coordinates in the first projection coordinate system, but different Z coordinates, which are depth information.

[0070] Steps S16 to S19 are the same processes as steps S12 to S15, respectively, except that in steps S16 to S19, calculations are performed based on the second camera C2, and in steps S12 to S15, calculations are performed based on the first camera C1.

[0071] <Step S16: Coordinate transformation based on the second camera> The virtual plane placement means 22 places a predetermined virtual near plane in the direction in which the second camera C2 faces, and also places a predetermined virtual far plane distal to the virtual near plane relative to the second camera C2. The coordinate conversion means 14 converts the coordinates of the range between a virtual near plane and a virtual far plane set for the second camera C2 in the line of sight direction of the second camera C2. A first object B1 is placed between the virtual near plane and the virtual far plane set for the second camera C2. The coordinate conversion means 14 converts the world coordinate system into a projected coordinate system for the three-dimensional coordinates of the surface of the first object B1, with the second camera C2 as the reference. The projected coordinate system with the second camera C2 as the reference is called the second projected coordinate system.

[0072] <Step S17: Acquire second data> The coordinate conversion means 14 acquires second data including two-dimensional coordinates on the projection surface according to the orientation of the second camera C2 and depth information relating to the distance from the second camera C2 to each three-dimensional coordinate. In other words, the coordinate conversion means 14 acquires, as the second data, three-dimensional coordinates (X, Y, Z) of the surface of the first object B1 in the second projection coordinate system after perspective projection transformation.

[0073] <Step S18: Save second proximal portion data> The proximal portion data storage means 15 stores the second data having the shortest distance from the second camera C2 among a plurality of second data having the same XY coordinates, which are two-dimensional coordinates in the second projection coordinate system, but different Z coordinates, which are depth information, as the second proximal portion data. That is, the proximal portion data storage means 15 identifies the second data having the shortest distance from the virtual near plane set for the second camera C2 among a plurality of second data having the same XY coordinates, which are two-dimensional coordinates in the second projection coordinate system, but different Z coordinates, which are depth information, and stores it in the memory unit 3 as the second proximal portion data.

[0074] <Step S19: Save second distal portion data> The distal portion data storage means 16 stores, as second distal portion data, the second data having the longest distance from the second camera C2 among a plurality of second data having the same XY coordinates, which are two-dimensional coordinates in the second projection coordinate system, but different Z coordinates, which are depth information. That is, the distal portion data storage means 16 identifies, among a plurality of second data having the same XY coordinates, which are two-dimensional coordinates in the second projection coordinate system, but different Z coordinates, which are depth information, the second data having the shortest distance from the virtual far plane set for the second camera C2, and stores it in the memory unit 3 as second distal portion data.

[0075] <Step S20: Setting Virtual Objects for Collision Detection> 7 are similar to steps S6 and S7, respectively, of the collision determination process described in the first embodiment. However, in step S20, unlike step S6 in the first embodiment, the collision determination means 17 sets a virtual collision determination target object F2 based on the first proximal portion data, the first distal portion data, the second proximal portion data, and the second distal portion data.

[0076] More specifically, the set of first proximal portion data constitutes a boundary surface VF1 (hereinafter may be referred to as a first front surface VF1) of the virtual object F2 subject to collision detection that faces the first camera C1. The set of first distal portion data constitutes a boundary surface VB1 (hereinafter may be referred to as a first rear surface VB1) of the virtual object F2 subject to collision detection that faces away from the first camera C1. The set of second proximal portion data constitutes a boundary surface VF2 (hereinafter may be referred to as a second front surface VF2) of the virtual object F2 subject to collision detection that faces away from the second camera C2. The set of second distal portion data constitutes a boundary surface VB2 (hereinafter may be referred to as a second rear surface VB2) of the virtual object F2 subject to collision detection that faces away from the second camera C2.

[0077] The first proximal section data, the first distal section data, the second proximal section data, and the second distal section data may partially overlap. For example, when the second proximal section data is converted from the second projection coordinate system to the world coordinate system and then converted to the first projection coordinate system, some coordinates in the data may match coordinates in the first projection coordinate system in the first proximal section data or the first distal section data. That is, the second front surface VF2 may partially overlap with the first front surface VF1 and the first rear surface VB1. Furthermore, the second rear surface VB2 may partially overlap with the first front surface VF1 and the first rear surface VB1.

[0078] In this way, by using the proximal and distal data obtained from multiple virtual cameras C1 and C2, the shape of the virtual collision detection target object F2 can be set to match or be closer to the shape of the first object B1.

[0079] For example, in the illustrated example, the two first objects B1a and B1b both have simple shapes and are simply arranged, so the virtual object F2 subject to collision detection completely matches the first objects B1a and B1b. For this reason, for example, in the first embodiment, it was not possible to determine whether there was a gap between the first objects B1a and B1b, and it was necessary to complement this with the side portions vs in order to set the virtual object F subject to collision detection. However, in this embodiment, the second camera C2 is able to determine whether there is a gap between the first objects B1a and B1b, and it is possible to set a virtual object F2 subject to collision detection that matches or is close to the first object B1.

[0080] In this embodiment, too, the collision determination means 17 complements the gap between adjacent surfaces among the multiple surfaces included in the front surface VF of the virtual object F2 to be subjected to collision determination, as necessary. That is, when the first front surface VF1, the first rear surface VB1, the second front surface VF2, and the second rear surface VB2 are adjacent surfaces in the first projection coordinate system but have a difference in the Z direction, the collision determination means 17 sets a side surface connecting the surfaces.

[0081] <Step S21: Collision determination> The collision determination means 17 determines whether the second object B2 has collided with the first object B1 based on the first proximal portion data, the first distal portion data, the second proximal portion data, the second distal portion data, and the position of the second object B2. In other words, when the collision determination means 17 determines that the second object B2 has collided with a virtual collision determination target object F2 created from the first object B1, it determines that the second object B2 has collided with the first object B1. For example, when the second object B2 collides with the virtual collision determination target object F2, the collision determination means 17 changes the movement direction according to the orientation of the collided surface of the virtual collision determination target object F2. In this way, a situation in which the second object B2 collides with the first object B1 and bounces back is represented.

[0082] This embodiment also provides the same effects as the first embodiment. Furthermore, this embodiment can more accurately determine a collision of a second object with a portion of the surface of a first object B1 that is not displayed on the screen. For example, when multiple first objects are lined up at intervals in the line of sight of the virtual camera, some or all of the surfaces of the multiple first objects that face each other are not included in either the first proximal portion or the first distal portion. However, this embodiment can also perform collision determination with a second object for portions that are not included in either the first proximal portion or the first distal portion.

[0083] [Other embodiments] The present invention is not limited to the above-described embodiment, and various modifications are possible without departing from the gist of the present invention.

[0084] In the first and second embodiments, the first object B1 was fixedly placed in the virtual space S, but the first object may be an object that moves in the virtual space. In the above embodiments, the second object B2 was a particle that moved within the virtual space S, but it may be an object other than a particle. For example, the second object B2 may be an object that represents a bullet or an arrow. However, in conventional computer graphics, fluids such as smoke and mist are often represented by a large number of particles. Therefore, performing collision detection for a large number of particles requires a large calculation load. Even in such cases, the present embodiment is preferably used because it can reduce the calculation load for collision detection.

[0085] Furthermore, the number, shape, and arrangement of the first objects B1 described in the first and second embodiments are merely examples.

[0086] In the first and second embodiments, the coordinate transformation means 14 performs perspective projection transformation, but the coordinate transformation means may perform parallel projection transformation. That is, the rendering range may be a rectangular parallelepiped.

[0087] In the above first and second embodiments, the process of a second object B2 colliding with a first object B1 and bouncing off is described, but by treating the object F subject to collision determination as an object subject to interaction determination, it is also possible to apply the present invention to interactions other than collisions between the first object B1 and the second object B2.

[0088] Examples of interactions other than collisions include the second object B2 sticking to the first object B1, the second object B2 avoiding the first object B1, the second object B2 appearing inside the first object B1, and the second object B2 appearing outside the first object B1. In this case, the collision determination means can function as interaction determination means. The collision determination target object F can be called an interaction determination target object.

[0089] For example, the method of setting the object subject to interaction determination by the interaction determination means is the same as steps S1 to S6 in the first embodiment and steps S11 to S20 in the second embodiment. After setting the object subject to interaction determination, the interaction determination means causes the second object B2 to interact with the virtual object subject to interaction determination created from the first object B1.

[0090] For example, when the interaction determination means determines that the second object B2 has collided with a virtual object for interaction determination created from the first object B1, the interaction determination means stops the movement of the determined second object B2, thereby expressing a situation in which the second object B2 is stuck to the first object B1.

[0091] For example, the interaction determination means moves the second object B2 in the virtual space S so as to avoid the virtual object to be determined for interaction created from the first object B1. This expresses a situation in which the second object B2 moves in the virtual space S so as to avoid the first object B1.

[0092] For example, the interaction determination means generates the second object B2 within a virtual object to be determined for interaction created from the first object B1, thereby expressing a situation in which the second object B2 occurs within the first object B1.

[0093] For example, the interaction determination means generates the second object B2 outside the virtual object to be determined for interaction created from the first object B1, thereby expressing a situation in which the second object B2 occurs outside the first object B1.

[0094] In the second embodiment, in addition to the scene viewed from the first camera C1, the scene viewed from the second camera C2 may be displayed on the screen of the display unit 6. The screen of the display unit 6 may switch between the image captured by the first camera C1 and the image captured by the second camera C2.

[0095] In the second embodiment, the second camera C2 is fixedly disposed in the virtual space S, but the second camera may be movable within the virtual space.

[0096] The camera positioning means may change the orientation of the second camera in accordance with the orientation of the first camera. For example, the camera positioning means may change the orientation of the second camera in accordance with the orientation of the first camera so that the line of sight of the second camera intersects with the line of sight of the first camera.

[0097] In the second embodiment, the number of second cameras C2 is one, but the number of second cameras may be two or more. The more second cameras there are, the greater the calculation load for collision detection, but the more accurately it is possible to determine the collision of the second object with the part of the first object that is not displayed on the screen. In this case, it is preferable that the orientations of the multiple second cameras are different from each other.

[0098] The effects of the present invention can be achieved even when these other embodiments are adopted. Furthermore, this embodiment can be combined with other embodiments, and other embodiments can be combined with each other as appropriate.

[0099] [Disclosure Summary] Each of the following aspects is a disclosure of a preferred embodiment.

[0100] [Aspect 1] Computer, an object generating means for generating a first object and a second object that moves relatively to the first object in a virtual space; a camera placement means for placing a virtual camera in the virtual space to capture an image to be displayed on the screen; a coordinate conversion means for converting three-dimensional coordinates of the surface of the first object included in an imaging range of the virtual camera in a world coordinate system into a projection coordinate system, and acquiring first data including two-dimensional coordinates on a projection surface according to an orientation of the virtual camera and depth information relating to a distance from the virtual camera to each of the three-dimensional coordinates; a proximal part data storage means for storing, as proximal part data, the first data having the shortest distance from the virtual camera among the plurality of first data having the same two-dimensional coordinates but different depth information; a distal part data storage means for storing, as distal part data, the first data having the longest distance from the virtual camera among the plurality of first data having the same two-dimensional coordinates but different depth information; a collision determination means for determining whether or not the second object has collided with the first object based on the proximal portion data, the distal portion data, and the position of the second object; A computer program that functions as a

[0101] According to the first aspect, a collision determination between the first object and the second object is performed based on the proximal part data, the distal part data, and the position of the second object. Therefore, the calculation load required for the collision determination can be reduced compared to when a collision determination with the second object is performed for all surfaces of the first object. In particular, even when the first object is composed of many surfaces, it is not necessary to perform a collision determination with the second object for each of the many surfaces.

[0102] [Aspect 2] causing the computer to further function as a virtual plane arrangement means for arranging a predetermined virtual near plane in a direction in which the virtual camera faces and for arranging a predetermined virtual far plane on a more distal side than the virtual near plane with respect to the virtual camera; the imaging range is between the virtual near plane and the virtual far plane in the virtual space, the near portion data storage means compares the distances from the virtual near plane with respect to a plurality of first data pieces having the same two-dimensional coordinates but different depth information, thereby identifying the first data piece having the shortest distance from the virtual near plane; The computer program of aspect 1, wherein the distal data storage means identifies the first data with the shortest distance from the virtual far plane by comparing the distances from the virtual far plane for multiple first data with the same two-dimensional coordinates but different depth information.

[0103] According to the second aspect, it is possible to easily calculate the proximal and distal portions of the surface of the first object relative to the virtual camera.

[0104] [Aspect 3] 3. The computer program of claim 1, wherein the second object is a particle.

[0105] According to the third aspect, it is possible to reduce the calculation load for collision detection of particles against objects.

[0106] [Aspect 4] the camera placement means places a second camera, which is a virtual camera different from the first camera, in the virtual space in addition to the first camera, the coordinate conversion means converts the world coordinate system into a first projection coordinate system, which is the projection coordinate system, for three-dimensional coordinates of the surface of the first object, and also converts the world coordinate system into a second projection coordinate system for three-dimensional coordinates of the surface of the first object included in an imaging range of the virtual camera in the world coordinate system, thereby acquiring second data including two-dimensional coordinates on a projection surface according to an orientation of the second camera and depth information relating to a distance from the second camera to each of the three-dimensional coordinates; the proximal portion data storage means stores the first proximal portion data, which is the proximal portion data, and also stores, as second proximal portion data, the second data that is the shortest distance from the second camera among a plurality of second data that have the same two-dimensional coordinates but different depth information; the distal portion data storage means stores the first distal portion data, which is the distal portion data, and stores, as second distal portion data, the second data having the longest distance from the second camera among a plurality of second data having the same two-dimensional coordinates but different depth information; A computer program according to any one of aspects 1 to 3, wherein the collision determination means determines whether the second object has collided with the first object based on the first proximal portion data, the first distal portion data, the second proximal portion data, the second distal portion data, and the position of the second object.

[0107] According to the fourth aspect, it is possible to more accurately determine whether the second object has collided with a portion of the surface of the first object that is not displayed on the screen.

[0108] [Aspect 5] a program storage unit that stores the game program according to any one of aspects 1 to 4; a computer that executes the program stored in the program storage unit.

[0109] [Aspect 6] an object generation step of generating a first object and a second object that moves relatively to the first object in a virtual space; a camera placement step of placing a virtual camera in the virtual space to capture an image to be displayed on a screen; a coordinate conversion step of converting three-dimensional coordinates of a surface of a first object included in an imaging range of the virtual camera in a world coordinate system into a projection coordinate system to acquire first data including two-dimensional coordinates on a projection surface according to an orientation of the virtual camera and depth information relating to a distance from the virtual camera to each of the three-dimensional coordinates; a proximal part data storage step of storing, as proximal part data, the first data having the shortest distance from the virtual camera among the plurality of first data having the same two-dimensional coordinates but different depth information; a distal part data storage step of storing, as distal part data, the first data having the longest distance from the virtual camera among the plurality of first data having the same two-dimensional coordinates but different depth information; a collision determination step of determining whether or not the second object has collided with the first object based on the proximal portion data, the distal portion data, and a position of the second object; A computer-controlled method comprising: [Explanation of symbols]

[0110] 1: Computer equipment 2: Control section 3a: Computer Program 6:Display section 12: Camera placement means 14: Coordinate transformation means 15: Proximal data storage means 16: Distal data storage means 17: Collision determination means 21: Object generation means 22: Virtual surface placement means

Claims

1. Computer, an object generating means for generating a first object and a second object that moves relatively to the first object in a virtual space; a camera placement means for placing a virtual camera in the virtual space to capture an image to be displayed on the screen; a coordinate conversion means for converting three-dimensional coordinates of a surface of the first object included in an imaging range of the virtual camera in a world coordinate system into a projection coordinate system, and acquiring first data including two-dimensional coordinates on a projection surface according to an orientation of the virtual camera and depth information relating to a distance from the virtual camera to each of the three-dimensional coordinates; a proximal portion data storage means for storing, as proximal portion data, the first data having the shortest distance from the virtual camera among the plurality of first data having the same two-dimensional coordinates but different depth information; a distal part data storage means for storing, as distal part data, the first data having the longest distance from the virtual camera among the plurality of first data having the same two-dimensional coordinates but different depth information; and a collision determination means for determining whether or not the second object has collided with the first object based on the proximal portion data, the distal portion data, and a position of the second object; A computer program that functions as a

2. causing the computer to further function as a virtual plane arrangement means for arranging a predetermined virtual near plane in a direction in which the virtual camera faces and for arranging a predetermined virtual far plane on a more distal side than the virtual near plane with respect to the virtual camera; the imaging range is between the virtual near plane and the virtual far plane in the virtual space, the near portion data storage means compares the distances from the virtual near plane with respect to a plurality of first data pieces having the same two-dimensional coordinates but different depth information, thereby identifying the first data piece having the shortest distance from the virtual near plane; The computer program according to claim 1, wherein the distal data storage means identifies the first data with the shortest distance from the virtual far plane by comparing the distances from the virtual far plane for multiple first data with the same two-dimensional coordinates but different depth information.

3. The computer program product according to claim 1 , wherein the second object is a particle.

4. the camera placement means places a second camera, which is a virtual camera different from the first camera, in the virtual space in addition to the first camera, the coordinate conversion means converts the world coordinate system into a first projection coordinate system, which is the projection coordinate system, for three-dimensional coordinates of the surface of the first object, and also converts the world coordinate system into a second projection coordinate system for three-dimensional coordinates of the surface of the first object included in the imaging range of the second camera in the world coordinate system, to obtain second data including two-dimensional coordinates on a projection plane according to an orientation of the second camera and depth information relating to a distance from the second camera to each of the three-dimensional coordinates; the proximal region data storage means stores the first proximal region data, which is the proximal region data, and also stores, as second proximal region data, the second data that is the shortest distance from the second camera among a plurality of second data that have the same two-dimensional coordinates but different depth information; the distal portion data storage means stores the first distal portion data, which is the distal portion data, and stores, as second distal portion data, the second data having the longest distance from the second camera among a plurality of second data having the same two-dimensional coordinates but different depth information; 3. The computer program according to claim 1, wherein the collision determination means determines whether the second object has collided with the first object based on the first proximal portion data, the first distal portion data, the second proximal portion data, the second distal portion data, and the position of the second object.

5. a program storage unit that stores the game program according to claim 1 or 2; a computer that executes the program stored in the program storage unit, Computer system.

6. an object generating step of generating a first object and a second object that moves relatively to the first object in a virtual space; a camera placement step of placing a virtual camera in the virtual space to capture an image to be displayed on a screen; a coordinate transformation step of transforming three-dimensional coordinates of a surface of a first object included in an imaging range of the virtual camera in a world coordinate system into a projection coordinate system to acquire first data including two-dimensional coordinates on a projection surface according to an orientation of the virtual camera and depth information relating to a distance from the virtual camera to each of the three-dimensional coordinates; a proximal portion data storage step of storing, as proximal portion data, first data having the shortest distance from the virtual camera among a plurality of first data having the same two-dimensional coordinates but different depth information; a distal part data storage step of storing, as distal part data, the first data having the longest distance from the virtual camera among the plurality of first data having the same two-dimensional coordinates but different depth information; and a collision determination step of determining whether or not the second object has collided with the first object based on the proximal portion data, the distal portion data, and a position of the second object; A computer-controlled method comprising:

Citation Information

Patent Citations

  • Program, information storage medium, and image creation system

    JP2011209865A

  • Game program and game system

    JP2017148206A

  • Image processing program, image processing system, image processing apparatus and image processing method

    JP2018147002A