CN114359505A - Three-dimensional walking surface modeling method based on voxel chessboard model - Google Patents

Three-dimensional walking surface modeling method based on voxel chessboard model Download PDF

Info

Publication number
CN114359505A
CN114359505A CN202111563511.0A CN202111563511A CN114359505A CN 114359505 A CN114359505 A CN 114359505A CN 202111563511 A CN202111563511 A CN 202111563511A CN 114359505 A CN114359505 A CN 114359505A
Authority
CN
China
Prior art keywords
model
chessboard
coordinate
dimensional
coordinates
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111563511.0A
Other languages
Chinese (zh)
Inventor
武爱斌
魏小庆
方福璟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Luculent Smart Technologies Co ltd
Original Assignee
Luculent Smart Technologies Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Luculent Smart Technologies Co ltd filed Critical Luculent Smart Technologies Co ltd
Priority to CN202111563511.0A priority Critical patent/CN114359505A/en
Publication of CN114359505A publication Critical patent/CN114359505A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for modeling a three-dimensional walking surface based on a voxel chessboard model, which comprises the following steps: obtaining world coordinates of a center point of the viewport and a corresponding point on the surface of the object; a model of the surface of the object on which the person is walking or an equivalent thereof is built based on the world coordinates. The method has low requirement on the three-dimensional engine, and only needs to obtain the coordinates of the surface points of the model and the corresponding component types and ensure that the three-dimensional model can be loaded successfully; the chessboard model data is automatically generated without manual intervention in the modeling process, so that time and labor are saved; the method is high in adaptability, the original aim of the invention is to solve the relevant problems in the building field, and the method is suitable for any three-dimensional model which can be used for people to walk; the algorithm is simple and easy to understand and implement.

Description

Three-dimensional walking surface modeling method based on voxel chessboard model
Technical Field
The invention relates to the technical field of buildings, in particular to a three-dimensional walking surface modeling method based on a voxel chessboard model.
Background
In order to perform dynamic simulation of emergency evacuation in a three-dimensional building scene, an automatic path finding function must be realized. Part of the surface in the building model is a tread for a person to walk, including the ground, the floor and the stairs. Another part of the surface in the building model is obstacles that may appear during the walking of people. One prerequisite for achieving the automatic route-finding function is to establish a model of the surface of an object on which a person can walk, wherein the model is obtained by subtracting the upper surface of an obstacle from the upper surfaces of the ground, the floor and the stairs. The three-dimensional engine for realizing the automatic road finding function must establish a model of the surface of an object which can be walked by a human according to the geometric data of the building model.
Under the condition that the three-dimensional engine does not provide an automatic path finding function and geometric data of the building model, the idea of establishing a model of the surface of the object capable of being walked by a human or an equivalent of the model by most three-dimensional engine secondary developers is to re-model the outline of the object in the three-dimensional engine according to the outline of the object in the building model and then calculate the three-dimensional walking surface by using the reconstructed model.
This method has the following disadvantages: first, a complete set of modeling tools must be designed and implemented; secondly, the use of a modeling tool may be complex, a whole set of operation flow and specifications must be established for a user, and the user must be trained; finally, the developer also needs to implement an algorithm that computes the surface of the three-dimensional walk using the reconstructed model.
Disclosure of Invention
This section is for the purpose of summarizing some aspects of embodiments of the invention and to briefly introduce some preferred embodiments. In this section, as well as in the abstract and the title of the invention of this application, simplifications or omissions may be made to avoid obscuring the purpose of the section, the abstract and the title, and such simplifications or omissions are not intended to limit the scope of the invention.
The present invention has been made in view of the above-mentioned conventional problems.
Therefore, the technical problem solved by the invention is as follows: the traditional technical scheme needs to design and realize a whole set of modeling tools; secondly, the use of a modeling tool may be complex, a whole set of operation flow and specifications must be established for a user, and the user must be trained; finally, the developer also needs to implement an algorithm that computes the surface of the three-dimensional walk using the reconstructed model.
In order to solve the technical problems, the invention provides the following technical scheme: obtaining world coordinates of a center point of the viewport and a corresponding point on the surface of the object; a model of the surface of the object on which the person is walking or an equivalent thereof is built based on the world coordinates.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: and establishing a data structure of the three-dimensional walking surface based on the voxel chessboard idea, namely a model of the surface of the object capable of being walked by the human or an equivalent thereof.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: the three-dimensional engine providing interface required in the process of establishing the voxel chessboard model based on the voxel chessboard idea comprises the steps of obtaining world coordinate points corresponding to two-dimensional coordinate points of a screen; obtaining an object id corresponding to the world coordinate point, namely dbId; obtaining the name or attribute of the object corresponding to the dbId; adjusting the camera to a perspective view mode; adjusting the position and direction of the mobile camera; a bounding box of the model is obtained.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: the chessboard model is established by a data initialization stage and five building model scanning and sampling stages.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: the data initialization phase comprises the steps of loading a building model by using the three-dimensional engine; acquiring a bounding box of the building model, wherein the bounding box is represented by two points in space, and X, Y and Z coordinates of MIN and MAX are minimum values in the model, are respectively defined as MINX, MINY and MINZ, and X, Y and Z coordinates of MAX are maximum values in the model, and are respectively defined as MAXX, MAXY and MAXZ; dividing the bounding box according to the STEP size STEP, and solving the STEP size numbers in the X direction, the Y direction and the Z direction; establishing a data structure for representing a three-dimensional chessboard; the camera is adjusted to a see-through view mode.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: the data structure is used for storing bounding boxes of the building model and a four-dimensional array ChessBoard (x, y, z, v) representing model data, wherein the front three dimensions of the four-dimensional array represent three-dimensional coordinates of space sampling points, the last dimension v represents whether the space sampling points are accessible or not at the coordinate positions of the sampling points, 0 represents that the space sampling points are not accessible, 1 represents that the space sampling points are accessible, and the values of all the sampling points in the initial state are 0; the data structure also provides a function of bidirectionally converting ChessBoard (x, y, z, v) and an integer version four-dimensional array ChessBoard dInt (x, y, z, v), wherein the first three dimensions in the ChessBoard dInt (x, y, z, v) represent three-dimensional coordinates of a space sampling point divided by an integer value after a step length, and the last dimension v represents whether the position of the sampling point coordinate is passable or not, wherein 0 represents impassable, and 1 represents passable; the coordinate points of the ChessBoard correspond to the coordinate points in the ChessBoard, and v of the corresponding coordinate points is equal; defining the coordinate value of x in ChessBoardInt as 0-L, the coordinate value of y as 0-M, the coordinate value of z as 0-N, and L, M, N as follows, wherein floor is a downward integer function:
L=floor(MAXX-MINX)/STEP
M=floor(MAXY-MINY)/STEP
N=floor(MAXZ-MINZ)/STEP
solving the size of the three-dimensional array through the rounding function;
the method for converting the world coordinates of ChessBoard into ChessBoardInt integer coordinates is as follows:
XINDEX=floor((x-MINX)/STEP)
YINDEX=floor((y-MINY)/STEP)
ZINDEX=floor((z-MINZ)/STEP)
converting world coordinates into an index value based on a coordinate conversion method;
the method for converting the ChessBoardInt integer coordinate into the ChessBoard world coordinate comprises the following steps:
x=MINX+STEP*XINDEX
y=MINY+STEP*YINDEX
z=MINZ+STEP*ZINDEX
converting the index value into world coordinates based on the method;
wherein XINDEX, YINDEX and ZINDEX are integer coordinate values in ChessBoardInt respectively.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: the five building model scanning and sampling stages comprise scanning and sampling the models from the directions of 5 cameras from the upper, east, south, west and north.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: the step of sampling the building model from above comprises, the camera direction is downward; defining initial z coordinates MAXZ + STEP of the camera, which is equivalent to MINZ + STEP ZINDEX + STEP, wherein ZINDEX is equal to N, x coordinates of the camera are MINX and are equivalent to XINDEX is equal to 0, y coordinates of the camera are MINY and are equivalent to YINDEX is equal to 0; using a clientToWorld function of the three-dimensional engine to transmit coordinates of the center point of the viewport to obtain corresponding coordinates of the model surface, and if the coordinates of the model surface cannot be obtained, skipping to the step of finishing scanning; judging whether the position of the coordinate point is a room or not by using the function provided by the three-dimensional engine, and if not, setting the values of coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDDEX, ZINDEX +1) in ChessBoardInt to be 1; moving the camera downwards by a STEP distance, and continuously re-executing the STEP of acquiring the corresponding model surface coordinates; if all the sampling points on the XY plane are traversed, the scanning is finished, otherwise, the initial Z coordinate of the camera is MAXZ + STEP, the x and y coordinates of the camera take a new sampling point, and the STEP of acquiring the corresponding model surface coordinates is executed again.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: the purpose of east, south, west, north 4 camera directions to scan the model and sample is to reset the value of the position corresponding with the position of building model barrier in chessboardidnt to 0, wherein, when scanning from east, the camera direction is the same with the negative direction of x axle, when scanning from west, the camera direction is the same with the positive direction of x axle, when scanning from south, the camera direction is the same with the positive direction of y axle, when scanning from north, the camera direction is the same with the negative direction of y axle, and except that the scanning direction is inconsistent, the scanning process is the same during the scanning of its four directions.
As a preferable embodiment of the method for modeling a three-dimensional walking surface based on a voxel chessboard model of the present invention, wherein: the process of scanning the architectural model from east includes adjusting the camera orientation to an x-axis negative orientation; 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 m; using a clientToWorld function of the three-dimensional engine to transmit coordinates of the center point of the viewport to obtain corresponding coordinates of the model surface, and if the coordinates of the model surface cannot be obtained, skipping to the step of finishing scanning; judging whether the position of the coordinate point is a door or not by using the function provided by the three-dimensional engine, and if the position of the coordinate point is not the door, setting the values of coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDDEX, ZINDEX +1) in ChessBoardInt to be 0; moving the camera to the x axis by a STEP distance, and continuously re-executing the STEP of acquiring the corresponding model surface coordinates; if all the sampling points on the XY plane are traversed, the scanning is finished, 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 the STEP of obtaining the corresponding model surface coordinate is executed again.
The invention has the beneficial effects that: the method has low requirement on the three-dimensional engine, and only needs to obtain the coordinates of the surface points of the model and the corresponding component types and ensure that the three-dimensional model can be loaded successfully; the chessboard model data is automatically generated without manual intervention in the modeling process, so that time and labor are saved; the method is high in adaptability, the original aim of the invention is to solve the relevant problems in the building field, and the method is suitable for any three-dimensional model which can be used for people to walk; the algorithm is simple and easy to understand and implement.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise. Wherein:
FIG. 1 is a schematic diagram of an architectural model of a three-dimensional walking surface modeling method based on a voxel chessboard model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a chessboard block of a three-dimensional walking surface modeling method based on a voxel chessboard model according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating the superposition effect of the chessboard blocks and the building model of the three-dimensional walking surface modeling method based on the voxel chessboard model according to one embodiment of the present invention;
FIG. 4 is a schematic cross-sectional view of a three-dimensional walking surface modeling method based on a voxel chessboard model according to an embodiment of the present invention;
FIG. 5 is a schematic cross-sectional side view of a three-dimensional walking surface modeling method based on a voxel chessboard model according to one embodiment of the present invention;
FIG. 6 is a schematic cross-sectional side view of a three-dimensional walking surface modeling method based on a voxel chessboard model according to one embodiment of the present invention;
FIG. 7 is a schematic cross-sectional side view of a three-dimensional walking surface modeling method based on a voxel chessboard model according to one embodiment of the present invention;
FIG. 8 is a schematic cross-sectional side view of a three-dimensional walking surface modeling method based on a voxel chessboard model according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, specific embodiments accompanied with figures are described in detail below, and it is apparent that the described embodiments are a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present invention, shall fall within the protection scope of the present invention.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than those specifically described and will be readily apparent to those of ordinary skill in the art without departing from the spirit of the present invention, and therefore the present invention is not limited to the specific embodiments disclosed below.
Furthermore, reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one implementation of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.
The present invention will be described in detail with reference to the drawings, wherein the cross-sectional views illustrating the structure of the device are not enlarged partially in general scale for convenience of illustration, and the drawings are only exemplary and should not be construed as limiting the scope of the present invention. In addition, the three-dimensional dimensions of length, width and depth should be included in the actual fabrication.
Meanwhile, in the description of the present invention, it should be noted that the terms "upper, lower, inner and outer" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of describing the present invention and simplifying the description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation and operate, and thus, cannot be construed as limiting the present invention. Furthermore, the terms first, second, or third are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
The terms "mounted, connected and connected" in the present invention are to be understood broadly, unless otherwise explicitly specified or limited, for example: can be fixedly connected, detachably connected or integrally connected; they may be mechanically, electrically, or directly connected, or indirectly connected through intervening media, or may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Example 1
Referring to fig. 1 to 3, in an embodiment of the present invention, a method for modeling a three-dimensional walking surface based on a voxel chessboard model is provided, which includes:
s1: and acquiring world coordinates of a center point of the viewport and a corresponding point on the surface of the object.
S2: a model of the surface of the object on which the person is walking or an equivalent thereof is built based on the world coordinates.
The steps S1 to S2 specifically include:
and establishing a data structure of the three-dimensional walking surface based on the voxel chessboard idea, namely a model of the surface of the object for people to walk or an equivalent thereof.
The voxel is a short name of a Volume element (Volume Pixel), a solid containing the voxel can be represented by rendering the solid or extracting a polygonal isosurface with a given threshold contour, as the name, the voxel is the minimum unit of digital data on three-dimensional space segmentation, the voxel is used in the fields of three-dimensional imaging, scientific data, medical images and the like, and is conceptually similar to the minimum unit of a two-dimensional space, namely a Pixel, the Pixel is used on image data of a two-dimensional computer image, and some real three-dimensional displays use the voxel to describe the resolution thereof, for example: a display of 512 x 512 voxels may be displayed.
The key to the above description is to point out that the voxel "is the minimum unit of digital data on the three-dimensional space segmentation", which means that the shape of the object in the 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 modeling cost. Therefore, a trade-off between accuracy and cost is needed to be chosen, i.e. how large the voxels need to be when generating the model to achieve a high efficiency while ensuring sufficient accuracy.
As a matter of convenience in describing the voxel concept, three-dimensional voxels are analogized to two-dimensional pixels. The model of the three-dimensional world composed of voxels is similar to the chessboard of chess, and if each voxel is enlarged to the size of a square on the chessboard, the model appears to be a three-dimensional chessboard. If a solid checkerboard model can be built, with the size of the model being comparable to the size of the building, and the voxel size being scaled to a comparable size of the shoulder width of an adult (e.g., 0.5 meters), then the checkerboard model can better satisfy the trade-off between accuracy and cost.
Specifically, the three-dimensional engine providing interface required in the process of establishing the voxel chessboard model based on the voxel chessboard idea comprises the following steps:
obtaining a world coordinate point (clientToWorld) corresponding to the two-dimensional coordinate point of the screen;
obtaining an object id corresponding to the world coordinate point, namely dbId;
obtaining the name or attribute of the object corresponding to the dbId, and identifying doors and rooms in the building model according to the name or attribute, wherein the rooms in some building models are cuboids formed by surrounding four walls, ceilings and floors;
adjusting the camera to a perspective view mode;
adjusting the position and direction of the mobile camera;
a bounding box of the model is obtained.
Further, the chessboard model is established by a data initialization stage and five building model scanning and sampling stages.
Wherein, the data initialization phase comprises:
(1) loading a building model by using a three-dimensional engine;
(2) acquiring a bounding box (bounding Box) of a building model, wherein the bounding box is represented by two points in space, MIN and MAX are the minimum values of the MIN, x, y and z coordinates of the MIN are respectively defined as MINX, MINY and MINZ, and x, y and z coordinates of the MAX are the maximum values of the MINX, MINY and MINZ, and are respectively defined as MAXx, MAXY and MAXZ;
(3) dividing the bounding box according to the STEP size STEP (0.5 m) to obtain the STEP sizes in the X direction, the Y direction and the Z direction;
(4) establishing a data structure for representing a three-dimensional ChessBoard, wherein the data structure stores bounding boxes of a building model and a four-dimensional array ChessBoard (x, y, z, v) representing model data, the front three-dimension of the four-dimensional array represents three-dimensional coordinates of a space sampling point, the last dimension v represents whether the space sampling point can pass or not at the coordinate position of the sampling point, wherein 0 represents that the space sampling point can not pass, 1 represents that the space sampling point can pass, and the values of all the sampling points are 0 in the initial state;
the data structure also provides a function of bidirectionally converting ChessBoard (x, y, z, v) and an integer version four-dimensional array ChessBoardInt (x, y, z, v), wherein the first three dimensions in the ChessBoardInt (x, y, z, v) represent three-dimensional coordinates of a space sampling point divided by an integer value after a step length, and the last dimension v represents whether the position of the sampling point coordinate is passable or not, wherein 0 represents impassable, and 1 represents passable;
the coordinate points of the ChessBoard correspond to the coordinate points in the ChessBoard, and v of the corresponding coordinate points is equal;
for convenience of description, in the present embodiment, the coordinate value of x in the chessboardidnt is defined as 0 to L, the coordinate value of y is defined as 0 to M, the coordinate value of z is defined as 0 to N, and L, M, N has the following values, where floor is a rounding-down function:
L=floor(MAXX-MINX)/STEP
M=floor(MAXY-MINY)/STEP
N=floor(MAXZ-MINZ)/STEP
solving the size of the three-dimensional array through an integer function;
the method for converting the world coordinates of ChessBoard into ChessBoardInt integer coordinates is as follows:
XINDEX=floor((x-MINX)/STEP)
YINDEX=floor((y-MINY)/STEP)
ZINDEX=floor((z-MINZ)/STEP)
converting world coordinates into an index value based on a coordinate conversion method;
the method for converting the ChessBoardInt integer coordinate into the ChessBoard world coordinate comprises the following steps:
x=MINX+STEP*XINDEX
y=MINY+STEP*YINDEX
z=MINZ+STEP*ZINDEX
converting the index value into world coordinates based on the method;
wherein XINDEX, YINDEX and ZINDEX are integer coordinate values in ChessBoardInt respectively.
(5) The camera is adjusted to a see-through view mode.
Furthermore, the five building model scanning and sampling stages comprise 5 camera directions of upper, east, south, west and north to scan and sample the model, and the whole walking area can be obtained by sampling the building model from the upper side.
Specifically, the step of sampling the building model from above comprises:
(1) the direction of the camera is downward;
(2) defining the initial z coordinate of the camera as MAXZ + STEP, which is equivalent to MINZ + STEP ZINDEX + STEP, wherein ZINDEX is N, the x coordinate of the camera is MINX, which is equivalent to XINDEX is 0, the y coordinate of the camera is MINY, which is equivalent to YINDEX is 0, and the value of the z coordinate of the camera is larger than MAXZ so as to ensure that the camera can see each point on the model;
(3) acquiring corresponding model surface coordinates by using coordinates of a central point of a viewport transmitted by a clientToWorld function of the three-dimensional engine, and jumping to the step (6) if the coordinate points of the model surface cannot be acquired;
(4) judging whether the position of the coordinate point is a room or not by using a function provided by a three-dimensional engine, if the position of the coordinate point is not the room, setting the values of coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDEX, ZINDEX +1) in ChessBoardInt to be 1, and setting the values of (XINDEX, YINDEX, ZINDEX) to be 1 and (XINDEX, YINDDEX, ZINDEX +1) to be 1 in the algorithm so as to avoid the influence of a threshold or a ground object on the scanning result;
(5) moving the camera downwards by a STEP distance, and continuing to perform the STEP (3) again;
(6) if all the sampling points on the XY plane are traversed, the scanning is finished, otherwise, the initial Z coordinate of the camera is MAXZ + STEP, the x and y coordinates of the camera take a new sampling point, and the STEP (3) is executed again.
Further, the purpose of scanning and sampling the model in east, south, west, and north 4 camera directions is to reset the value of the position corresponding to the position of the building model obstacle in chessboardlnt to 0, where the camera direction is the same as the x-axis negative direction when scanning from east, the camera direction is the same as the x-axis positive direction when scanning from west, the camera direction is the same as the y-axis positive direction when scanning from south, the camera direction is the same as the y-axis negative direction when scanning from north, and the scanning process is the same when scanning from four directions except that the scanning directions are not the same, which describes the case of building scanning from east.
Specifically, the process of scanning the building model from east includes:
(1) adjusting the direction of the camera to be the negative direction of the x axis;
(2) defining the initial x coordinate of a camera as MAXX + STEP, the y coordinate of the camera as MINY, the z coordinate of the camera as MINZ +1.5 m, wherein the addition of 1.5 m avoids the influence of a threshold or a ground object on the scanning result, and the larger value of the x coordinate of the camera is compared with the MAXX so as to ensure that the camera can see each point on the model;
(3) acquiring corresponding model surface coordinates by using coordinates of a central point of a viewport transmitted by a clientToWorld function of the three-dimensional engine, and jumping to the step (6) if the coordinate points of the model surface cannot be acquired;
(4) judging whether the position of the coordinate point is a door or not by using a function provided by a three-dimensional engine, and if the position of the coordinate point is not the door, setting the values of coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDEX, ZINDEX +1) in ChessBoardInt to be 0;
(5) moving the camera to the x-axis by a STEP distance, and continuing to perform the STEP (3) again;
(6) if all the sampling points on the XY plane are traversed, the scanning is finished, otherwise, the initial X coordinate of the camera is MAXX + STEP, the y and z coordinates of the camera take a new sampling point, the z takes MINZ + STEP ZINDEX +1.5, and the STEP (3) is executed again.
After the above 5 scanning stages are completed, the data structure of the three-dimensional walking surface is built.
The method has low requirement on the three-dimensional engine, and only needs to obtain the coordinates of the surface points of the model and the corresponding component types and ensure that the three-dimensional model can be loaded successfully; the chessboard model data is automatically generated without manual intervention in the modeling process; the method is high in adaptability, the original aim of the invention is to solve the relevant problems in the building field, and the method is suitable for any three-dimensional model which can be used for people to walk; the algorithm is simple and easy to understand and implement.
Example 2
Referring to fig. 1 to 8, another embodiment of the present invention is different from the first embodiment in that a verification test of a three-dimensional walking surface modeling method based on a voxel chessboard model is provided, and in order to verify and explain the technical effects adopted in the method, the embodiment adopts the method of the present invention to perform a test, and a scientific demonstration means is used to verify the real effects of the method.
As shown in fig. 1-3, the building model and the chessboard model are shown, the chessboard model and the building model are highly matched as shown in fig. 1, 2 and 3, the building model is abstracted as shown in fig. 4, 5, 6, 7 and 8, the information of the connectivity of the floor and the stairs is retained, the chessboard model is equivalent to the building model in expressing the function of the walkable area, and the effectiveness of the method is reflected.
It should be recognized that embodiments of the present invention can be realized and implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The methods may be implemented in a computer program using standard programming techniques, including a non-transitory computer-readable storage medium configured with the computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner, according to the methods and figures described in the detailed description. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.
Further, the operations of processes described herein can 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) collectively executed on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the invention may be embodied 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, optically read and/or write storage medium, RAM, ROM, or the like, such that it may be read by a programmable computer, which when read by the storage medium or device, is operative to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein. A computer program can be applied to input data to perform the functions described herein to transform the input data to generate output data that is stored to non-volatile memory. The output information may also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including particular visual depictions of physical and tangible objects produced on a display.
As used in this application, the terms "component," "module," "system," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a component may be, but is not limited to being: a process running on a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of example, both an application running on a computing device and the computing device can be a component. One or more components can reside within a process and/or thread of execution and a component can be localized on one computer and/or distributed between two or more computers. In addition, these components can execute from various computer readable media having various data structures thereon. The components may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., data from one component interacting with another component in a local system, distributed system, and/or across a network such as the internet with other systems by way of the signal).
It should be noted that the above-mentioned embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, which should be covered by the claims of the present invention.

Claims (10)

1. A method for modeling a three-dimensional walking surface based on a voxel chessboard model is characterized by comprising the following steps:
obtaining world coordinates of a center point of the viewport and a corresponding point on the surface of the object;
a model of the surface of the object on which the person is walking or an equivalent thereof is built based on the world coordinates.
2. The method of modeling a three-dimensional walking surface based on a voxel chessboard model of claim 1 wherein: and establishing a data structure of the three-dimensional walking surface based on the voxel chessboard idea, namely a model of the surface of the object capable of being walked by the human or an equivalent thereof.
3. The method of modeling a three-dimensional walking surface based on a voxel chessboard model according to claim 1 or 2 characterized by: the three-dimensional engine providing interface required in the process of establishing the voxel chessboard model based on the voxel chessboard concept comprises,
acquiring world coordinate points corresponding to the two-dimensional coordinate points of the screen;
obtaining an object id corresponding to the world coordinate point, namely dbId;
obtaining the name or attribute of the object corresponding to the dbId;
adjusting the camera to a perspective view mode;
adjusting the position and direction of the mobile camera;
a bounding box of the model is obtained.
4. A method of modelling a three-dimensional walking surface based on a voxel chessboard model according to claim 3 characterized by: the chessboard model is established by a data initialization stage and five building model scanning and sampling stages.
5. The method of modeling a three-dimensional walking surface based on a voxel chessboard model of claim 4 wherein: the data initialization phase comprises the steps of,
loading a building model using the three-dimensional engine;
acquiring a bounding box of the building model, wherein the bounding box is represented by two points in space, and X, Y and Z coordinates of MIN and MAX are minimum values in the model, are respectively defined as MINX, MINY and MINZ, and X, Y and Z coordinates of MAX are maximum values in the model, and are respectively defined as MAXX, MAXY and MAXZ;
dividing the bounding box according to the STEP size STEP, and solving the STEP size numbers in the X direction, the Y direction and the Z direction;
establishing a data structure for representing a three-dimensional chessboard;
the camera is adjusted to a see-through view mode.
6. The method of modeling a three-dimensional walking surface based on a voxel chessboard model according to claim 4 or 5 characterized by: also comprises the following steps of (1) preparing,
the data structure stores a bounding box of a building model and a four-dimensional array ChessBoard (x, y, z, v) representing model data, wherein the front three-dimension of the four-dimensional array represents the three-dimensional coordinates of a space sampling point, the last dimension v represents whether the space sampling point is passable or not at the coordinate position of the sampling point, 0 represents impassable, 1 represents passable, and the values of all the sampling points in the initial state are 0;
the data structure also provides a function of bidirectionally converting ChessBoard (x, y, z, v) and an integer version four-dimensional array ChessBoard dInt (x, y, z, v), wherein the first three dimensions in the ChessBoard dInt (x, y, z, v) represent three-dimensional coordinates of a space sampling point divided by an integer value after a step length, and the last dimension v represents whether the position of the sampling point coordinate is passable or not, wherein 0 represents impassable, and 1 represents passable;
the coordinate points of the ChessBoard correspond to the coordinate points in the ChessBoard, and v of the corresponding coordinate points is equal;
defining the coordinate value of x in ChessBoardInt as 0-L, the coordinate value of y as 0-M, the coordinate value of z as 0-N, and L, M, N as follows, wherein floor is a downward integer function:
L=floor(MAXX-MINX)/STEP
M=floor(MAXY-MINY)/STEP
N=floor(MAXZ-MINZ)/STEP
solving the size of the three-dimensional array through the rounding function;
the method for converting the world coordinates of ChessBoard into ChessBoardInt integer coordinates is as follows:
XINDEX=floor((x-MINX)/STEP)
YINDEX=floor((y-MINY)/STEP)
ZINDEX=floor((z-MINZ)/STEP)
converting world coordinates into an index value based on a coordinate conversion method;
the method for converting the ChessBoardInt integer coordinate into the ChessBoard world coordinate comprises the following steps:
x=MINX+STEP*XINDEX
y=MINY+STEP*YINDEX
z=MINZ+STEP*ZINDEX
converting the index value into world coordinates based on the method;
wherein XINDEX, YINDEX and ZINDEX are integer coordinate values in ChessBoardInt respectively.
7. The method of modeling a three-dimensional walking surface based on a voxel chessboard model of claim 4 wherein: the five building model scanning and sampling stages comprise scanning and sampling the models from the directions of 5 cameras from the upper, east, south, west and north.
8. The method of modeling a three-dimensional walking surface based on a voxel chessboard model according to claim 4 or 7 characterized by: the step of sampling the building model from above comprises,
the direction of the camera is downward;
defining the initial z coordinate of the camera as MAXZ + STEP, which is equivalent to MINZ + STEP ZINDEX + STEP, wherein ZINDEX is N, the x coordinate of the camera is MINX, which is equivalent to XINDEX is 0, and the y coordinate of the camera is MINY, which is equivalent to YINDEX is 0;
using a clientToWorld function of the three-dimensional engine to transmit coordinates of the center point of the viewport to obtain corresponding coordinates of the model surface, and if the coordinates of the model surface cannot be obtained, skipping to the step of finishing scanning;
judging whether the position of the coordinate point is a room or not by using the function provided by the three-dimensional engine, and if not, setting the values of coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDDEX, ZINDEX +1) in ChessBoardInt to be 1;
moving the camera downwards by a STEP distance, and continuously re-executing the STEP of acquiring the corresponding model surface coordinates;
if all the sampling points on the XY plane are traversed, the scanning is finished, otherwise, the initial Z coordinate of the camera is MAXZ + STEP, the x and y coordinates of the camera take a new sampling point, and the STEP of acquiring the corresponding model surface coordinates is executed again.
9. The method of modeling a three-dimensional walking surface based on a voxel chessboard model according to claim 4 or 7 characterized by: the purpose of east, south, west, north 4 camera directions to scan the model and sample is to reset the value of the position corresponding with the position of building model barrier in chessboardidnt to 0, wherein, when scanning from east, the camera direction is the same with the negative direction of x axle, when scanning from west, the camera direction is the same with the positive direction of x axle, when scanning from south, the camera direction is the same with the positive direction of y axle, when scanning from north, the camera direction is the same with the negative direction of y axle, and except that the scanning direction is inconsistent, the scanning process is the same during the scanning of its four directions.
10. The method of modeling a three-dimensional walking surface based on a voxel chessboard model of claim 9 wherein: the process of scanning the architectural model from the east includes,
adjusting the camera direction to be an x-axis negative direction;
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 m;
using a clientToWorld function of the three-dimensional engine to transmit coordinates of the center point of the viewport to obtain corresponding coordinates of the model surface, and if the coordinates of the model surface cannot be obtained, skipping to the step of finishing scanning;
judging whether the position of the coordinate point is a door or not by using the function provided by the three-dimensional engine, and if the position of the coordinate point is not the door, setting the values of coordinates (XINDEX, YINDEX, ZINDEX) and (XINDEX, YINDDEX, ZINDEX +1) in ChessBoardInt to be 0;
moving the camera to the x axis by a STEP distance, and continuously re-executing the STEP of acquiring the corresponding model surface coordinates;
if all the sampling points on the XY plane are traversed, the scanning is finished, 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 the STEP of obtaining the corresponding model surface coordinate is executed again.
CN202111563511.0A 2021-12-20 2021-12-20 Three-dimensional walking surface modeling method based on voxel chessboard model Pending CN114359505A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111563511.0A CN114359505A (en) 2021-12-20 2021-12-20 Three-dimensional walking surface modeling method based on voxel chessboard model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111563511.0A CN114359505A (en) 2021-12-20 2021-12-20 Three-dimensional walking surface modeling method based on voxel chessboard model

Publications (1)

Publication Number Publication Date
CN114359505A true CN114359505A (en) 2022-04-15

Family

ID=81101780

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111563511.0A Pending CN114359505A (en) 2021-12-20 2021-12-20 Three-dimensional walking surface modeling method based on voxel chessboard model

Country Status (1)

Country Link
CN (1) CN114359505A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389746A (en) * 2023-12-11 2024-01-12 深圳市城市交通规划设计研究中心股份有限公司 Pedestrian simulation building space analysis method based on BIM

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389746A (en) * 2023-12-11 2024-01-12 深圳市城市交通规划设计研究中心股份有限公司 Pedestrian simulation building space analysis method based on BIM
CN117389746B (en) * 2023-12-11 2024-04-30 深圳市城市交通规划设计研究中心股份有限公司 Pedestrian simulation building space analysis method based on BIM

Similar Documents

Publication Publication Date Title
US11043026B1 (en) Systems and methods for processing 2D/3D data for structures of interest in a scene and wireframes generated therefrom
US8994726B1 (en) Systems and methods for preparing a model of an environment for display
JP2018536915A (en) Method and system for detecting and combining structural features in 3D reconstruction
CN109064549B (en) Method for generating mark point detection model and method for detecting mark point
EP3040944B1 (en) Method and device for rebuilding three-dimensional object and terminal
Truong-Hong et al. Octree-based, automatic building facade generation from LiDAR data
CN105122311A (en) Smooth draping layer for rendering vector data on complex three dimensional objects
CN111161394B (en) Method and device for placing three-dimensional building model
KR101552828B1 (en) Method for Obtaining Polygon Information of Three-dimensional Object Model
CN115439607A (en) Three-dimensional reconstruction method and device, electronic equipment and storage medium
CN114359505A (en) Three-dimensional walking surface modeling method based on voxel chessboard model
CN112053440A (en) Method for determining individualized model and communication device
Rougeron et al. Optimal positioning of terrestrial LiDAR scanner stations in complex 3D environments with a multiobjective optimization method based on GPU simulations
US9454554B1 (en) View dependent query of multi-resolution clustered 3D dataset
Cantzler Improving architectural 3D reconstruction by constrained modelling
CN112052489B (en) Method and system for generating house type graph
JP7006810B2 (en) 3D measuring device, mobile robot, push wheel type moving device and 3D measurement processing method
CN113822994B (en) Three-dimensional model construction method and device and storage medium
CN113989680B (en) Automatic building three-dimensional scene construction method and system
CN116168056A (en) Method, device, equipment and storage medium for extracting target object contour point cloud
EP4227907A1 (en) Object annotation information presentation method and apparatus, and electronic device and storage medium
CN115619986A (en) Scene roaming method, device, equipment and medium
CN111383334B (en) System and method for rendering objects
EP3104337A1 (en) Visualising computer models of urban environments
Zmugg et al. Deformation-aware split grammars for architectural models

Legal Events

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