A modeling method for three-dimensional walking surface based on voxel chessboard model

Through the voxel chessboard model-based method, the problem of complex and difficult implementation of automatic road-seeking functions of modeling tools in traditional technology is solved, and the three-dimensional walking surface data is automatically generated, which simplifies the modeling process and improves adaptability.

CN114359505BActive Publication Date: 2024-11-15LUCULENT SMART TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111563511.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2024-11-15
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

Traditional technical solutions require the design and implementation of complex modeling tools. The use is complex, the user needs to receive training, and developers need to implement algorithms for three-dimensional walking surfaces to achieve automatic road finding function.

Method used

Using the method based on voxel chessboard model, by obtaining the world coordinates of the viewport center point and the object surface, establishing a model or its equivalent for people to walk on the surface of the object, and using the interface provided by the three-dimensional engine to initialize data and scan and sample building model , create a four-dimensional array to represent a three-dimensional chessboard model, and automatically generate walking surface data.

Benefits of technology

The requirements for three-dimensional engines are reduced, and the chessboard model data is automatically generated without manual intervention, it is highly adaptable and simple in algorithms, and it is suitable for any three-dimensional model for people to walk.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359505B_ABST
    Figure CN114359505B_ABST
Patent Text Reader

Abstract

The present invention discloses a modeling method of a three-dimensional walking surface based on a voxel chessboard model, comprising: obtaining the world coordinates of the viewport center point and the corresponding point on the object surface; and establishing a model of the object surface on which people can walk or its equivalent based on the world coordinates. The present invention has low requirements on the three-dimensional engine, and only needs to be able to obtain the coordinates of the model surface points and the corresponding component types and ensure that the three-dimensional model can be successfully loaded; the modeling process does not require manual intervention, and the chessboard model data is automatically generated, saving time and effort; the invention has strong adaptability, and the original intention of the invention is to solve related problems in the field of architecture. This method is applicable to any three-dimensional model on which people can walk; the algorithm is simple, easy to understand and implement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of architecture, and in particular to a modeling method of a three-dimensional walking surface based on a voxel chessboard model. Background Art

[0002] In order to dynamically simulate emergency evacuation in a three-dimensional building scene, the automatic pathfinding function must be implemented. Some surfaces in the building model are for people to walk on, including the ground, floors, and stair treads. Another part of the surface in the building model is obstacles that may appear when people walk. A prerequisite for realizing the automatic pathfinding function is to establish a model of the surface of objects that can be walked on. This model is obtained by subtracting the upper surface of obstacles from the upper surface of the ground, floors, and stairs. The three-dimensional engine that implements the automatic pathfinding function must establish a model of the surface of objects that can be walked on based on the geometric data of the building model.

[0003] In the case that the 3D engine does not provide automatic pathfinding functions and building model geometry data, most 3D engine secondary developers build models of object surfaces that can be walked on or their equivalents by remodeling the outlines of the objects in the 3D engine according to the outlines of the objects in the building model, and then use the reconstructed model to calculate the 3D walking surface.

[0004] This approach has the following disadvantages: first, a complete set of modeling tools must be designed and implemented; second, the use of modeling tools may be complicated, and a complete set of operating procedures and specifications must be developed for users, and users must receive training; finally, developers also need to implement algorithms that use the reconstructed model to calculate the three-dimensional walking surface. Summary of the invention

[0005] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0006] In view of the above existing problems, the present invention is proposed.

[0007] Therefore, the technical problems solved by the present invention are: the traditional technical solution must design and implement a complete set of modeling tools; secondly, the use of modeling tools may be complicated, and a complete set of operating procedures and specifications must be formulated for users, and users must receive training; finally, developers also need to implement algorithms for calculating the three-dimensional walking surface using the reconstructed model.

[0008] To solve the above technical problems, the present invention provides the following technical solutions: obtaining the world coordinates of the center point of the viewport and the corresponding point on the surface of the object; and establishing a model of the surface of the object on which people can walk or its equivalent based on the world coordinates.

[0009] As a preferred solution of the modeling method of the three-dimensional walking surface based on the voxel chessboard model described in the present invention, the data structure of the three-dimensional walking surface is established based on the voxel chessboard concept, that is, the model of the surface of the object on which people can walk or its equivalent.

[0010] As a preferred solution of the modeling method of the three-dimensional walking surface based on the voxel chessboard model described in the present invention, the three-dimensional engine required in the process of establishing the voxel chessboard model based on the voxel chessboard concept provides an interface including obtaining the world coordinate point corresponding to the two-dimensional coordinate point on the screen; obtaining the object id corresponding to the world coordinate point, that is, dbId; obtaining the name or attribute of the object corresponding to the dbId; adjusting the camera to the perspective view mode; adjusting the position and direction of the mobile camera; and obtaining the bounding box of the model.

[0011] As a preferred solution of the modeling method of the three-dimensional walking surface based on the voxel chessboard model described in the present invention, the establishment of the chessboard model includes a data initialization stage and five building model scanning and sampling stages.

[0012] As a preferred solution of the modeling method of the three-dimensional walking surface based on the voxel chessboard model described in the present invention, the data initialization stage includes: using the three-dimensional engine to load the building model; obtaining the bounding box of the building model, the bounding box is represented by two points in space, MIN and MAX, the x, y, and z coordinates of MIN are all minimum values ​​in the model, defined as MINX, MINY, and MINZ respectively, and the x, y, and z coordinates of MAX are all maximum values ​​in the model, defined as MAXX, MAXY, and MAXZ respectively; dividing the bounding box according to the step length STEP, and calculating the number of steps in the X direction, the Y direction, and the Z direction; establishing a data structure for representing the three-dimensional chessboard; and adjusting the camera to the perspective view mode.

[0013] As a preferred solution of the modeling method of a three-dimensional walking surface based on a voxel chessboard model described in the present invention, it also includes: the data structure stores the bounding box of the building model and the four-dimensional array ChessBoard(x, y, z, v) representing the model data, the first three dimensions of the four-dimensional array represent the three-dimensional coordinates of the spatial sampling points, and the last dimension v represents whether the sampling point coordinate position is passable, wherein 0 represents impassable and 1 represents passable, and the values ​​of all sampling points in its initial state are 0; the data structure also provides a four-dimensional array ChessBoard(x, y, z, v) and an integer version ChessBoardInt(x, y,z,v) bidirectional conversion function. The first three dimensions in ChessBoardInt(x,y,z,v) represent the integer value of the three-dimensional coordinates of the spatial sampling point divided by the step size. The last dimension v represents whether the sampling point coordinate position is passable, where 0 represents impassable and 1 represents passable. The coordinate points of ChessBoard correspond to the coordinate points in ChessBoardInt one by one, and the v of the corresponding coordinate points is equal. The x coordinate value in ChessBoardInt is defined as 0 to L, the y coordinate value is 0 to M, and the z coordinate value is 0 to N. The values ​​of L, M, and N are as follows, where floor is a floor rounding function:

[0014] L = floor (MAXX-MINX) / STEP

[0015] M=floor(MAXY-MINY) / STEP

[0016] N = floor (MAXZ - MINZ) / STEP

[0017] Calculate the size of the three-dimensional array by using the rounding function;

[0018] The method of converting ChessBoard's world coordinates to ChessBoardInt integer coordinates is as follows:

[0019] XINDEX = floor((x-MINX) / STEP)

[0020] YINDEX = floor((y-MINY) / STEP)

[0021] ZINDEX = floor((z-MINZ) / STEP)

[0022] Convert the world coordinates into index values ​​based on the coordinate conversion method;

[0023] The method of converting ChessBoardInt integer coordinates to ChessBoard world coordinates is:

[0024] x=MINX+STEP*XINDEX

[0025] y=MINY+STEP*YINDEX

[0026] z=MINZ+STEP*ZINDEX

[0027] Convert the index value to world coordinates based on the above method;

[0028] Among them, XINDEX, YINDEX, and ZINDEX are the integer coordinate values ​​in ChessBoardInt respectively.

[0029] As a preferred solution of the modeling method of the three-dimensional walking surface based on the voxel chessboard model described in the present invention, the five architectural model scanning and sampling stages include scanning and sampling the model from five camera directions: top, east, south, west and north.

[0030] As a preferred solution of the modeling method of the three-dimensional walking surface based on the voxel chessboard model described in the present invention, the step of sampling the building model from above includes: the camera direction is downward; defining the initial z coordinate of the camera MAXZ+STEP, which is equivalent to MINZ+STEP*ZINDEX+STEP, where ZINDEX=N, the camera x coordinate is MINX, which is equivalent to XINDEX=0, and the camera y coordinate is MINY, which is equivalent to YINDEX=0; using the clientToWorld function of the three-dimensional engine to pass the coordinates of the center point of the viewport to obtain the corresponding model surface coordinates, if the coordinate point of the model surface cannot be obtained, jump to the scanning Scanning is completed; using the function provided by the 3D engine to determine whether the location of the coordinate point is a room, if the location of the coordinate point is not a room, the values ​​of the coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDEX, ZINDEX+1) in ChessBoardInt are set to 1; the camera is moved downward by a distance of STEP, and the step of obtaining the corresponding model surface coordinates is continued to be re-executed; if all sampling points on the XY plane have been traversed, the scanning is completed, otherwise, the initial Z coordinate of the camera is MAXZ+STEP, the camera x, y coordinates take a new sampling point, and the step of obtaining the corresponding model surface coordinates is re-executed.

[0031] As a preferred solution of the modeling method of the three-dimensional walking surface based on the voxel chessboard model described in the present invention, the purpose of scanning and sampling the model in the four camera directions of east, south, west and north is to reset the value of the position corresponding to the position of the building model obstacle in ChessBoardInt to 0, wherein, when scanning from the east, the camera direction is the same as the negative direction of the x-axis, when scanning from the west, the camera direction is the same as the positive direction of the x-axis, when scanning from the south, the camera direction is the same as the positive direction of the y-axis, and when scanning from the north, the camera direction is the same as the negative direction of the y-axis. When scanning in the four directions, the scanning process is the same except that the scanning directions are different.

[0032] As a preferred solution of the modeling method of the three-dimensional walking surface based on the voxel chessboard model described in the present invention, the process of scanning the building model from the east includes: adjusting the direction of the camera to the negative direction of the x-axis; defining the initial x coordinate of the camera as MAXX+STEP, the y coordinate of the camera as MINY, and the z coordinate of the camera as MINZ+1.5 meters; using the clientToWorld function of the three-dimensional engine to pass the coordinates of the center point of the viewport to obtain the corresponding model surface coordinates, if the coordinate point of the model surface cannot be obtained, jumping to the scanning completion step; using the function provided by the three-dimensional engine to determine whether the location of the coordinate point is a door, if the Whether the position of the coordinate point is a door, set the values ​​of the coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDEX, ZINDEX+1) in ChessBoardInt to 0; move the camera to the x-axis by a distance of STEP, and continue to re-execute the step of obtaining the corresponding model surface coordinates; if all the sampling points on the XY plane have been traversed, the scanning is completed, otherwise, the initial X coordinate of the camera is MAXX+STEP, the y and z coordinates of the camera take a new sampling point, z takes MINZ+STEP*ZINDEX+1.5, and re-execute the step of obtaining the corresponding model surface coordinates.

[0033] The beneficial effects of the present invention are as follows: the present invention has low requirements on the three-dimensional engine, and it only needs to be able to obtain the coordinates of the model surface points and the corresponding component types and ensure that the three-dimensional model can be successfully loaded; the modeling process does not require manual intervention, and the chessboard model data is automatically generated, saving time and effort; it has strong adaptability, and the original intention of the invention is to solve related problems in the field of construction. This method is applicable to any three-dimensional model that can be walked on by people; the algorithm is simple and easy to understand and implement. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0035] Figure 1 A schematic diagram of an architectural model of a method for modeling a three-dimensional walking surface based on a voxel chessboard model provided by an embodiment of the present invention;

[0036] Figure 2 A schematic diagram of a chessboard block of a method for modeling a three-dimensional walking surface based on a voxel chessboard model provided by an embodiment of the present invention;

[0037] Figure 3 A schematic diagram of the superposition effect of chessboard blocks and building models in a modeling method of a three-dimensional walking surface based on a voxel chessboard model provided by an embodiment of the present invention;

[0038] Figure 4 A schematic diagram of an orthogonal top view of a chessboard of a method for modeling a three-dimensional walking surface based on a voxel chessboard model provided by an embodiment of the present invention;

[0039] Figure 5 A schematic diagram of an orthogonal side view of a chessboard of a method for modeling a three-dimensional walking surface based on a voxel chessboard model provided by an embodiment of the present invention;

[0040] Figure 6 A schematic diagram of an orthogonal side view of a chessboard of a method for modeling a three-dimensional walking surface based on a voxel chessboard model provided by an embodiment of the present invention;

[0041] Figure 7 A schematic diagram of an orthogonal side view of a chessboard of a method for modeling a three-dimensional walking surface based on a voxel chessboard model provided by an embodiment of the present invention;

[0042] Figure 8 A schematic diagram of an orthogonal side view of a chessboard showing a method for modeling a three-dimensional walking surface based on a voxel chessboard model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0045] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0046] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0047] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0048] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0049] Example 1

[0050] Reference Figures 1 to 3 , as one embodiment of the present invention, provides a modeling method of a three-dimensional walking surface based on a voxel chessboard model, comprising:

[0051] S1: Get the world coordinates of the viewport center point and the corresponding point on the object surface.

[0052] S2: Establish a model of the surface of an object on which a person can walk or its equivalent based on the world coordinates.

[0053] It should be noted that steps S1 to S2 specifically include:

[0054] A data structure of a three-dimensional walking surface is established based on the voxel chessboard concept, that is, a model of the surface of an object on which a person can walk or its equivalent.

[0055] Voxel is the abbreviation of volume pixel. A volume containing voxels can be displayed by stereo rendering or by extracting polygonal isosurfaces with a given threshold contour. As the name suggests, it is the smallest unit of digital data in three-dimensional space segmentation. Voxel is used in three-dimensional imaging, scientific data, medical imaging and other fields. Conceptually, it is similar to the smallest unit of two-dimensional space - pixel. Pixel is used in the image data of two-dimensional computer images. Some real three-dimensional displays use voxels to describe their resolution, for example: a display that can display 512×512×512 voxels.

[0056] The key point of the above description is that voxel is "the smallest unit of digital data in three-dimensional space segmentation". This embodiment means that the shape of an object in three-dimensional space can be represented by a set of voxels, or the object can be modeled by voxels. The smaller the voxel, the smaller the difference between the model and the object, the higher the accuracy, and the higher the cost of modeling. Therefore, it is necessary to choose a balance point between accuracy and cost, that is, how large the voxel needs to be when generating the model to achieve higher efficiency while ensuring sufficient accuracy.

[0057] Just as for the convenience of describing the concept of voxels, we can compare three-dimensional voxels with two-dimensional pixels. The model of the three-dimensional world composed of voxels is similar to a chessboard. If each voxel is enlarged to the size of a chessboard square, the model is like a three-dimensional chessboard. If such a three-dimensional chessboard model can be established, the size of the model is comparable to the size of a building, and the size of the voxel is enlarged to the size of an adult's shoulder width (for example: 0.5 meters), then this chessboard model can better meet the balance between accuracy and cost.

[0058] Specifically, the interfaces provided by the 3D engine required in the process of building a voxel chessboard model based on the voxel chessboard concept include:

[0059] Get the world coordinate point corresponding to the screen 2D coordinate point (clientToWorld);

[0060] Get the object id corresponding to the world coordinate point, that is, dbId;

[0061] Get the name or attribute of the object corresponding to dbId, and use it to identify the doors and rooms in the building model. In some building models, a room is a rectangular parallelepiped surrounded by four walls, a ceiling and a floor.

[0062] Adjust the camera to perspective view mode;

[0063] Adjust mobile camera position and direction;

[0064] Get the bounding box of the model.

[0065] Furthermore, the establishment of the chessboard model includes a data initialization stage and five building model scanning and sampling stages.

[0066] The data initialization phase includes:

[0067] (1) Load the building model using a 3D engine;

[0068] (2) Obtain the bounding box of the building model. The bounding box is represented by two points in space, MIN and MAX. The x, y, and z coordinates of MIN are the minimum values ​​in the model, defined as MINX, MINY, and MINZ, respectively. The x, y, and z coordinates of MAX are the maximum values ​​in the model, defined as MAXX, MAXY, and MAXZ, respectively.

[0069] (3) Segment the bounding box according to the step size STEP (0.5 meters) and calculate the number of steps in the X, Y, and Z directions;

[0070] (4) Establishing a data structure for representing a three-dimensional chessboard, wherein the data structure stores the bounding box of the building model and a four-dimensional array ChessBoard(x, y, z, v) representing the model data, wherein the first three dimensions of the four-dimensional array represent the three-dimensional coordinates of the spatial sampling points, and the last dimension v represents whether the sampling point coordinate position is passable, wherein 0 represents impassable and 1 represents passable, and the values ​​of all sampling points in its initial state are 0;

[0071] The data structure also provides the function of bidirectional conversion between ChessBoard(x,y,z,v) and integer version four-dimensional array ChessBoardInt(x,y,z,v). The first three dimensions in ChessBoardInt(x,y,z,v) represent the integer value of the three-dimensional coordinates of the spatial sampling point divided by the step size, and the last dimension v represents whether the sampling point coordinate position is passable, where 0 means impassable and 1 means passable.

[0072] The coordinate points of ChessBoard correspond one-to-one with the coordinate points in ChessBoardInt, and the v of the corresponding coordinate points are equal;

[0073] For the convenience of description, this embodiment defines that the x coordinate value in ChessBoardInt is 0 to L, the y coordinate value is 0 to M, and the z coordinate value is 0 to N. The values ​​of L, M, and N are as follows, where floor is a rounding function:

[0074] L = floor (MAXX-MINX) / STEP

[0075] M=floor(MAXY-MINY) / STEP

[0076] N = floor (MAXZ - MINZ) / STEP

[0077] Find the size of a three-dimensional array using the integer function;

[0078] The method of converting ChessBoard's world coordinates to ChessBoardInt integer coordinates is as follows:

[0079] XINDEX = floor((x-MINX) / STEP)

[0080] YINDEX = floor((y-MINY) / STEP)

[0081] ZINDEX = floor((z-MINZ) / STEP)

[0082] Convert the world coordinates into index values ​​based on the coordinate conversion method;

[0083] The method of converting ChessBoardInt integer coordinates to ChessBoard world coordinates is:

[0084] x=MINX+STEP*XINDEX

[0085] y=MINY+STEP*YINDEX

[0086] z=MINZ+STEP*ZINDEX

[0087] Convert the index value to world coordinates based on the above method;

[0088] Among them, XINDEX, YINDEX, and ZINDEX are the integer coordinate values ​​in ChessBoardInt respectively.

[0089] (5) Adjust the camera to perspective view mode.

[0090] Furthermore, the five building model scanning and sampling stages include scanning and sampling the model from five camera directions: top, east, south, west, and north. Sampling the building model from above can obtain all walkable areas.

[0091] Specifically, the steps of sampling the building model from above include:

[0092] (1) The camera is pointed downward;

[0093] (2) Define the initial z coordinate of the camera as MAXZ+STEP, which is equivalent to MINZ+STEP*ZINDEX+STEP, where ZINDEX=N, the x coordinate of the camera is MINX, which is equivalent to XINDEX=0, and the y coordinate of the camera is MINY, which is equivalent to YINDEX=0. The value of the camera z coordinate is larger than MAXZ to ensure that the camera can see every point on the model;

[0094] (3) Use the clientToWorld function of the 3D engine to pass in the coordinates of the center point of the viewport to obtain the corresponding model surface coordinates. If the coordinate point of the model surface cannot be obtained, jump to step (6);

[0095] (4) Use the function provided by the 3D engine to determine whether the location of the coordinate point is a room. If the location of the coordinate point is not a room, set the values ​​of the coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDEX, ZINDEX+1) in ChessBoardInt to 1. In the algorithm, not only the values ​​of (XINDEX, YINDEX, ZINDEX) but also the values ​​of (XINDEX, YINDEX, ZINDEX+1) must be set to 1 in order to avoid the threshold or ground objects affecting the scanning results.

[0096] (5) Move the camera downward by a distance of one STEP and continue to execute step (3);

[0097] (6) If all sampling points on the XY plane have been traversed, the scan is completed. Otherwise, the initial Z coordinate of the camera is MAXZ+STEP, and a new sampling point is taken in the camera x, y coordinates, and step (3) is executed again.

[0098] Furthermore, the purpose of scanning and sampling the model in four camera directions of east, south, west, and north is to reset the value of the position corresponding to the position of the building model obstacle in ChessBoardInt to 0, wherein, when scanning from the east, the camera direction is the same as the negative direction of the x-axis, when scanning from the west, the camera direction is the same as the positive direction of the x-axis, when scanning from the south, the camera direction is the same as the positive direction of the y-axis, and when scanning from the north, the camera direction is the same as the negative direction of the y-axis. Except for the scanning directions, the scanning process is the same when scanning in the four directions. This embodiment introduces the case of scanning a building from the east.

[0099] Specifically, the process of scanning the building model from the east includes:

[0100] (1) Adjust the camera direction to the negative direction of the x-axis;

[0101] (2) Define the initial x-coordinate of the camera as MAXX+STEP, the y-coordinate of the camera as MINY, and the z-coordinate of the camera as MINZ+1.5 meters. Adding 1.5 meters here prevents thresholds or ground objects from affecting the scanning results. The value of the camera's x-coordinate is larger than MAXX to ensure that the camera can see every point on the model.

[0102] (3) Use the clientToWorld function of the 3D engine to pass in the coordinates of the center point of the viewport to obtain the corresponding model surface coordinates. If the coordinate point of the model surface cannot be obtained, jump to step (6);

[0103] (4) Use the function provided by the 3D engine to determine whether the coordinate point is a gate. If the coordinate point is not a gate, set the values ​​of the coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDEX, ZINDEX+1) in ChessBoardInt to 0;

[0104] (5) Move the camera along the x-axis by a distance of one STEP and continue to execute step (3);

[0105] (6) If all sampling points on the XY plane have been traversed, the scan is complete. Otherwise, the initial X coordinate of the camera is MAXX+STEP, and the camera y and z coordinates take a new sampling point, with z taking MINZ+STEP*ZINDEX+1.5, and step (3) is executed again.

[0106] After the above five scanning stages are completed, the data structure of the three-dimensional walking surface is established.

[0107] The present invention has low requirements for the three-dimensional engine, and only needs to be able to obtain the coordinates of the model surface points and the corresponding component types and ensure that the three-dimensional model can be successfully loaded; the modeling process does not require human intervention and automatically generates chessboard model data; it has strong adaptability. The original intention of the invention is to solve related problems in the field of construction. This method is applicable to any three-dimensional model that can be walked on by people; the algorithm is simple and easy to understand and implement.

[0108] Example 2

[0109] Reference Figures 1 to 8This is another embodiment of the present invention. Different from the first embodiment, this embodiment provides a verification test of a modeling method of a three-dimensional walking surface based on a voxel chessboard model. In order to verify and illustrate the technical effects used in this method, this embodiment uses the method of the present invention for testing, and verifies the real effect of this method by means of scientific argumentation.

[0110] like Figures 1 to 3 As shown, the building model and the chessboard model are shown. From the attached figures 1, 2, and 3, it can be seen that the chessboard model and the building model are highly consistent. Figure 4 , 5 , 6, 7, and 8 show that the chessboard model abstracts the building model and retains the information of the connectivity of floors and stairs. The chessboard model is equivalent to the building model in expressing the function of the walkable area, which reflects the effectiveness of the method of the present invention.

[0111] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.

[0112] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0113] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or part thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques described in the present invention, the present invention also includes the computer itself. The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on a display.

[0114] As used in this application, the terms "component", "module", "system", etc. are intended to refer to a computer-related entity, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, a processor, an object, an executable file, a thread in execution, a program, and / or a computer. As an example, an application running on a computing device and the computing device can both be components. One or more components can exist in a process and / or thread in execution, and a component can be located in a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures thereon. These components can communicate in a local and / or remote process manner, such as according to a signal having one or more data packets (e.g., data from a component that interacts with another component in a local system, a distributed system, and / or interacts with other systems in a signal manner through a network such as the Internet).

[0115] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for modeling a three-dimensional walking surface based on a voxel chessboard model, characterized in that: include: Get the world coordinates of the viewport center point and the corresponding point on the object surface; Establishing a model of the surface of an object on which a person can walk or its equivalent based on the world coordinates; A data structure of a three-dimensional walking surface is established based on the voxel chessboard concept, that is, a model of the surface of the object on which a person can walk or its equivalent; The interfaces provided by the 3D engine required in the process of building a voxel chessboard model based on the voxel chessboard concept include: Get the world coordinate point corresponding to the two-dimensional coordinate point on the screen; Get the object id corresponding to the world coordinate point, that is, dbId; Obtain the name or attribute of the object corresponding to the dbId; Adjust the camera to perspective view mode; Adjust mobile camera position and direction; Get the bounding box of the model; The data initialization phase includes: Using the three-dimensional engine to load the building model; Obtain a bounding box of the building model, the bounding box is represented by two points in space, MIN and MAX, the x, y, z coordinates of MIN are all minimum values ​​in the model, defined as MINX, MINY, MINZ respectively, and the x, y, z coordinates of MAX are all maximum values ​​in the model, defined as MAXX, MAXY, MAXZ respectively; The bounding box is segmented according to the step length STEP, and the number of steps in the X direction, the Y direction, and the Z direction is calculated; Establish a data structure for representing a three-dimensional chessboard; Adjust the camera to perspective view mode; The data structure stores the bounding box of the building model and a four-dimensional array ChessBoard (x, y, z, v) representing the model data, wherein the first three dimensions of the four-dimensional array represent the three-dimensional coordinates of the spatial sampling points, and the last dimension v represents whether the sampling point coordinate position is passable, wherein 0 represents impassable and 1 represents passable, and the values ​​of all sampling points in its initial state are 0; The data structure also provides a function of bidirectional conversion between ChessBoard(x, y, z, v) and integer version four-dimensional array ChessBoardInt(x, y, z, v), where the first three dimensions in ChessBoardInt(x, y, z, v) represent the integer value of the three-dimensional coordinates of the spatial sampling point divided by the step size, and the last dimension v represents whether the sampling point coordinate position is passable, where 0 represents impassable and 1 represents passable; The coordinate points of ChessBoard correspond one-to-one with the coordinate points in ChessBoardInt, and the v of the corresponding coordinate points are equal; Define the x coordinate value in ChessBoardInt to be 0 to L, the y coordinate value to be 0 to M, and the z coordinate value to be 0 to N. The values ​​of L, M, and N are as follows, where floor is a rounding function: L = floor(MAXX - MINX) / STEP M = floor(MAXY - MINY) / STEP N = floor(MAXZ - MINZ) / STEP Calculate the size of the three-dimensional array by using the rounding function; The method of converting ChessBoard's world coordinates to ChessBoardInt integer coordinates is as follows: XINDEX = floor((x - MINX) / STEP) YINDEX = floor((y - MINY) / STEP) ZINDEX = floor((z - MINZ) / STEP) Convert the world coordinates into index values ​​based on the coordinate conversion method; The method of converting ChessBoardInt integer coordinates to ChessBoard world coordinates is: x = MINX + STEP * XINDEX y = MINY + STEP * YINDEX z = MINZ + STEP * ZINDEX Convert the index value to world coordinates based on the above method; Among them, XINDEX, YINDEX, and ZINDEX are the integer coordinate values ​​in ChessBoardInt respectively.

2. The method for modeling a three-dimensional walking surface based on a voxel chessboard model as claimed in claim 1, characterized in that: The establishment of the chessboard model includes a data initialization stage and five building model scanning and sampling stages.

3. The method for modeling a three-dimensional walking surface based on a voxel chessboard model as claimed in claim 2, characterized in that: The five building model scanning and sampling stages include scanning and sampling the model from five camera directions: top, east, south, west, and north.

4. The method for modeling a three-dimensional walking surface based on a voxel chessboard model as claimed in claim 2 or 3, characterized in that: The step of sampling the building model from above comprises, The camera is pointed downwards; The initial z coordinate of the camera is defined as MAXZ + STEP, which is equivalent to MINZ + STEP * ZINDEX + STEP, where ZINDEX = N, the x coordinate of the camera is MINX, which is equivalent to XINDEX = 0, and the y coordinate of the camera is MINY, which is equivalent to YINDEX = 0; The coordinates of the center point of the viewport are passed in by the clientToWorld function of the 3D engine to obtain the corresponding coordinates of the model surface. If the coordinate points of the model surface cannot be obtained, the scanning is skipped to the scanning completion step. Use the function provided by the three-dimensional engine to determine whether the location of the coordinate point is a room. If the location of the coordinate point is not a room, set the values ​​of the coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDEX, ZINDEX+1) in ChessBoardInt to 1; Move the camera downward by a distance of one STEP, and continue to re-execute the step of obtaining the corresponding model surface coordinates; If all sampling points on the XY plane have been traversed, the scan is completed. Otherwise, the initial Z coordinate of the camera is MAXZ + STEP, the camera x, y coordinates take a new sampling point, and the step of obtaining the corresponding model surface coordinates is re-executed.

5. The method for modeling a three-dimensional walking surface based on a voxel chessboard model as claimed in claim 2 or 3, characterized in that: The purpose of scanning and sampling the model in the four camera directions of east, south, west and north is to reset the value of the position corresponding to the position of the building model obstacle in ChessBoardInt to 0, wherein, when scanning from the east, the camera direction is the same as the negative direction of the x-axis, when scanning from the west, the camera direction is the same as the positive direction of the x-axis, when scanning from the south, the camera direction is the same as the positive direction of the y-axis, and when scanning from the north, the camera direction is the same as the negative direction of the y-axis. When scanning in the four directions, the scanning process is the same except that the scanning directions are different.

6. The method for modeling a three-dimensional walking surface based on a voxel chessboard model as claimed in claim 5, characterized in that: The process of scanning the building model from the east includes: Adjust the direction of the camera to the negative direction of the x-axis; Define the initial x coordinate of the camera as MAXX + STEP, the y coordinate of the camera as MINY, and the z coordinate of the camera as MINZ + 1.5 meters; The coordinates of the center point of the viewport are passed in by the clientToWorld function of the 3D engine to obtain the corresponding coordinates of the model surface. If the coordinate points of the model surface cannot be obtained, the scanning is skipped to the scanning completion step. Use the function provided by the three-dimensional engine to determine whether the location of the coordinate point is a door. If the location of the coordinate point is not a door, set the values ​​of the coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDEX, ZINDEX+1) in ChessBoardInt to 0; Move the camera along the x-axis by a distance of one STEP, and continue to re-execute the step of obtaining the corresponding model surface coordinates; If all sampling points on the XY plane have been traversed, the scan is completed. Otherwise, the initial X coordinate of the camera is MAXX + STEP, and the y and z coordinates of the camera take a new sampling point, where z takes MINZ + STEP * ZINDEX + 1.5, and the step of obtaining the corresponding model surface coordinates is re-executed.