Disclosure of Invention
Based on the above, the embodiment of the invention provides a method, a system, a storage medium and electronic equipment for constructing the Caves, which aim to realize seamless switching of different types of Caves in running and can view actual deployment effects in real time.
A first aspect of an embodiment of the present invention provides a Cave construction method, which is applied to UnityUGUI development platforms, and the method includes:
Creating a data model of a physical screen and a data model of a motion capture rigid body, and simultaneously, building a visual interface through a UnityUGUI development platform, wherein the visual interface is used for displaying and processing physical screen information and motion capture rigid body information input by a user;
The data model of the physical screen and the data model of the motion capture rigid body are bound with views in the visual interface in a two-way mode;
And monitoring the event, wherein when the view is changed, the corresponding data model is notified, and when the data model is changed, the corresponding view is updated.
Preferably, the data model of the physical screen is built by a virtual simulation editor, wherein a target data structure is built containing the actual physical screen length, width, spatial coordinates, screen name, 3D information and screen ID based information in meters.
Preferably, the method further comprises:
And establishing a screen data manager and responding to the physical screen information driven by the data instantly, wherein the screen data manager is used for managing the number of the physical screens, the data in the target data structure and the view ports of the screens, and the number of the screens is managed by a screen list.
Preferably, in the step of creating the screen data manager and immediately responding to the data-driven physical screen information, a matrix transformation of the camera is constructed in a simulation engine in a length and a width of a physical size to correctly update the image effect according to the physical position of eyes.
Preferably, the method further comprises:
And acquiring head and hand position tracking, wherein a state that a left hand coordinate system and a right hand coordinate system are mutually switched is added in conventional motion capture management.
Preferably, in the step of monitoring the event, physical screen information is updated in real time, the Cave surface number is reset according to the number of the screens, and meanwhile, the actual physical size and space coordinate information are updated according to the setting in the screens;
and resetting the motion capture information according to the motion capture device to complete view updating.
Preferably, the step of listening for an event includes:
Obtaining a Cave construction requirement, wherein the Cave construction requirement at least comprises a known field area and a target screen number;
According to the known field area and the target screen quantity, calling a matched first Cave space from a pre-constructed database, wherein the first Cave space is a Cave space with modifiable parameters;
Acquiring a three-dimensional model of a constructed site, determining an access opening planned in the three-dimensional model of the constructed site, and generating an unobstructed passage according to the access opening;
Controlling the first Cave space to expand outwards to obtain a second Cave space consisting of the first Cave space and an expansion area;
controlling the second Cave space to move along the edge of the barrier-free channel, and determining a position which does not interfere with the three-dimensional model of the constructed site;
and determining a target position in all positions which do not interfere with the three-dimensional model of the constructed site, wherein the target position is the optimal position of the first Cave space meeting the heat dissipation requirement.
A second aspect of an embodiment of the present invention provides a Cave construction system, configured to implement a Cave construction method provided in the first aspect, applied to a UnityUGUI development platform, where the system includes:
The system comprises a creation module, a development platform and a display module, wherein the creation module is used for creating a data model of a physical screen and a data model of a motion capture rigid body, and simultaneously, establishing a visual interface through the UnityUGUI development platform, wherein the visual interface is used for displaying and processing physical screen information and motion capture rigid body information input by a user;
the binding module is used for bidirectionally binding the data model of the physical screen and the data model of the motion capture rigid body with the view in the visual interface;
and the monitoring module is used for monitoring the event, notifying the corresponding data model when the view is changed, and updating the corresponding view when the data model is changed.
A third aspect of an embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the Cave construction method provided in the first aspect.
A fourth aspect of an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the Cave construction method provided in the first aspect when executing the program.
The Cave construction method, the system, the storage medium and the electronic equipment provided by the embodiment of the invention have the following beneficial effects:
The method comprises the steps of creating a data model of a physical screen and a data model of a motion capture rigid body, simultaneously, building a visual interface through a UnityUGUI development platform, wherein the visual interface is used for displaying and processing physical screen information and motion capture rigid body information input by a user, carrying out bidirectional binding on the data model of the physical screen and the data model of the motion capture rigid body and views in the visual interface, and monitoring events, wherein when the views are changed, the corresponding data model is notified, and when the data model is changed, the corresponding views are updated, so that seamless switching of different types of Caves in operation is realized, and the actual deployment effect can be checked in real time.
Detailed Description
In order to more clearly illustrate the technical solutions of the embodiments of the present specification, the drawings that are required to be used in the description of the embodiments will be briefly described below. It is apparent that the drawings in the following description are only some examples or embodiments of the present specification, and it is possible for those of ordinary skill in the art to apply the present specification to other similar situations according to the drawings without inventive effort. Unless otherwise apparent from the context of the language or otherwise specified, like reference numerals in the figures refer to like structures or operations.
The Cave construction method provided in the embodiment may be executed in an intelligent terminal, a computer terminal, a network device, a chip module, or a similar computing device. Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases 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. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the application may be combined with other embodiments.
It will be appreciated that "system," "apparatus," "unit" and/or "module" as used herein is one method for distinguishing between different components, elements, parts, portions or assemblies of different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
As used in this specification, the terms "a," "an," "the," and/or "the" are not intended to be limiting, but rather are to be construed as covering the singular and the plural, unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that the steps and elements are explicitly identified, and they do not constitute an exclusive list, as other steps or elements may be included in a method or apparatus.
Example 1
According to an embodiment of the present invention, there is provided a Cave construction method, it being noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
In the first embodiment, a Cave construction method is provided and applied to UnityUGUI development platforms, and specifically, a Unity UGUI (Unity User INTERFACE SYSTEM) is an official system for developing a User Interface (UI) in a Unity game engine. The UGUI provides a complete set of tools that enable developers to easily create and manage various UI elements in the game, such as buttons, text boxes, pictures, sliders, and the like. It supports multiple platforms, including PC, mobile device, VR/AR, etc., and is deeply integrated with Unity's physics engines, animation systems, etc., making UI interactions with the game world simple and intuitive. Referring to fig. 1, fig. 1 shows a flowchart of an implementation of a Cave construction method according to a first embodiment of the present invention, which specifically includes steps S01 to S03.
And step S01, creating a data model of a physical screen and a data model of a motion capture rigid body, and simultaneously, building a visual interface through a UnityUGUI development platform, wherein the visual interface is used for displaying and processing the physical screen information and the motion capture rigid body information input by a user.
Specifically, the visual interface comprises a screen setting window, a physical screen setting window, a screen display window, a motion capturing rigid body setting window, a three-dimensional setting window and the like, wherein the screen setting window can acquire the model and the number of a screen, corresponding parameters can be called after a screen with a certain number is selected, the physical screen setting window comprises parameters such as environment height, environment width, screen position, screen rotation, view port and the like, a user can set according to actual conditions, the number of a rigid body and the attribute of the rigid body can be seen in the motion capturing rigid body setting window, for example, whether the rigid body is a head motion capturing rigid body or a hand motion capturing rigid body can be displayed and set, and the three-dimensional setting window can correspondingly display the parameters according to the setting of the physical screen so as to be used for reference by the user.
It should be noted that, the data model of the physical screen is built by a virtual simulation editor, wherein a target data structure containing the actual physical screen length, width, space coordinates, screen name, 3D information and screen ID based information in meters is built.
In the embodiment of the present invention, a screen data manager is established and responds to physical screen information driven by data in real time, where the screen data manager is used to manage the number of physical screens, the data in the target data structure, and the view ports of the screens, where the number of screens is managed by a screen list, specifically, the step of establishing a screen data manager and responding to physical screen information driven by data in real time, where in the step of constructing a matrix transformation of a camera with a length and a width of a physical size in a simulation engine, and updating an image effect according to a physical position of eyes correctly may be expressed as:
m[0, 0] = 2.0f × n / (r - l)
m[0, 2] = (r + l) / (r - l)
m[1, 1] = 2.0f × n / (t - b)
m[1, 2] = (t + b) / (t - b)
m[2, 2] = -(f + n) / (f - n)
m[2, 3] = (-2.0f × f × n) / (f - n)
m[3, 2] = -1.0f
where m [ x, y ] is expressed as a view cone projection matrix, n is expressed as a distance from the "eye" to the near clipping plane (screen), f is expressed as a distance from the "eye" to the far clipping plane, l is expressed as a distance from the physical center point of the Cave space ground to the left screen edge, r is expressed as a distance from the physical center point of the Cave space ground to the right edge of the screen, b is expressed as a distance from the physical center point of the Cave space ground to the bottom edge of the screen, and t is expressed as a distance from the physical center point of the Cave space ground to the top edge of the screen.
Further, head and hand position tracking is acquired, wherein a state in which the left hand coordinate system and the right hand coordinate system are switched to each other is added in conventional motion capture management.
And step S02, the data model of the physical screen and the data model of the motion capture rigid body are bound with the view in the visual interface in a two-way mode.
And S03, monitoring the event, wherein when the view is changed, the corresponding data model is notified, and when the data model is changed, the corresponding view is updated.
It can be understood that the physical screen information is updated in real time, the Cave surface number is reset according to the screen number, meanwhile, the actual physical size and space coordinate information are updated according to the setting in the screen, and the view updating is completed according to the motion capture information reset by the motion capture device.
In addition, a visual editing broadcast service is built, the visual editing broadcast service and a data structure corresponding to the visual editing broadcast service in an editor can display the effect displayed by the input information in real time, the eye positions take the physical center point of the ground as the origin (0, 0), and the data are broadcast after the input of the physical screen information is completed.
In a preferred embodiment of the present invention, the step of listening for an event includes:
The Cave construction requirements are obtained, and at least comprise known field areas and target screen numbers, namely, the requirements of customers are obtained, wherein the field information of the actual Cave construction and the screen numbers required by the customers are included, and it is required to be noted that the size of the Cave space needs to be planned according to the actual requirements, but enough space is usually required to accommodate projection equipment, users and possibly other equipment (such as sensors, controllers and the like). Generally, a basic Cave system may require space of several meters to tens of meters, depending on the number and size of projection surfaces, and further, although Cave space does not necessarily require strict rectangular or cubic shapes, a relatively regular shape of space is typically chosen for ease of projection and to ensure optimal immersion for the user. For example, four projection surfaces may form a cube structure, wherein three wall surfaces adopt a rear projection mode, and the ground adopts a front projection mode (or a reflector is used to save space);
According to the known field area and the target screen quantity, a matched first Cave space is called from a pre-constructed database, the first Cave space is a Cave space with modifiable parameters so as to be convenient for personalized service for users, and it can be understood that according to the known field area and the target screen quantity which are required to be built, the matched standard first Cave space can be called from the database, and on the basis, revising is carried out, so that simulation can be completed rapidly;
Acquiring a three-dimensional model of a constructed site, determining an access opening planned in the three-dimensional model of the constructed site, and generating an unobstructed passage according to the access opening;
Controlling the first Cave space to expand outwards to obtain a second Cave space consisting of the first Cave space and an expansion area, wherein in general, the Cave space has certain safety requirements, namely, as complicated equipment and circuits may be contained near the Cave space, the safety of the space needs to be ensured, including the installation of heat dissipation equipment, the installation of fire protection equipment and the like, and a certain space needs to be reserved;
Controlling the second Cave space to move along the edge of the barrier-free channel, determining a position which does not interfere with the three-dimensional model of the construction site, taking the surrounding of the site of the Cave space to be constructed as an example, aligning the inlet of the second Cave space with the edge of the barrier-free channel, controlling the second Cave space to move along the edge of the barrier-free channel, and removing the position when the boundary of the second Cave space intersects with the surrounding or other barriers in the moving process, namely determining the position which does not interfere with the three-dimensional model of the construction site;
And determining a target position in all positions which do not interfere with the three-dimensional model of the construction site, wherein the target position is an optimal position of the first Cave space meeting the heat dissipation requirement, specifically, firstly determining the outer contour of the three-dimensional model of the construction site, and the boundary of the first Cave space, extending the boundary of the first Cave space outwards until the boundary of the first Cave space intersects with the outer contour of the three-dimensional model of the construction site, wherein each screen of the first Cave space and the outer contour of the three-dimensional model of the construction site form a closed area, and it is understood that the volume of each closed area is changed as the second Cave space moves along the edge of the barrier-free channel, and calculating the volume of each closed area in real time for determining the target position, wherein the position when the volume of each closed area is the maximum is determined to be the target position.
In summary, the method for constructing the Cave in the above embodiment of the present invention establishes a visual interface through creating a data model of a physical screen and a data model of a motion capturing rigid body, and simultaneously establishes a visual interface through UnityUGUI development platforms, wherein the visual interface is used for displaying and processing physical screen information and motion capturing rigid body information input by a user, the data model of the physical screen and the data model of the motion capturing rigid body are bound with views in the visual interface in two directions, and events are monitored, wherein when the views are changed, the corresponding data model is notified, and when the data model is changed, the corresponding views are updated, so that seamless switching of the Cave in different styles in operation is realized, and the actual deployment effect can be checked in real time.
Example two
Referring to fig. 2, fig. 2 is a block diagram of a Cave construction system 200 according to a second embodiment of the present invention, where the Cave construction system 200 is applied to UnityUGUI development platforms, and includes a creation module 21, a binding module 22, and a listening module 23, where:
The creation module 21 is configured to create a data model of a physical screen and a data model of a motion capture rigid body, and simultaneously, create a visual interface through UnityUGUI development platforms, where the visual interface is configured to display and process physical screen information and motion capture rigid body information input by a user, and the data model of the physical screen is created through a virtual simulation editor, where a target data structure including actual physical screen length, width, space coordinates, screen name, 3D information and screen ID as basic information in meters is created;
A binding module 22, configured to bi-directionally bind the data model of the physical screen and the data model of the motion capture rigid body with the view in the visual interface;
The monitoring module 23 is configured to monitor an event, notify a corresponding data model when the view is changed, and update the corresponding view when the data model changes, wherein physical screen information is updated in real time, the Cave surface number is reset according to the number of screens, and meanwhile, update the actual physical size and space coordinate information according to the setting in the screen, and complete the view update according to the motion capture information reset by the motion capture device.
Further, in some optional embodiments of the present invention, the Cave building system 200 further comprises:
The first building module is used for building a screen data manager and responding to the physical screen information driven by the data in real time, wherein the screen data manager is used for managing the number of physical screens, the data in the target data structure and the view ports of the screens, the number of the screens is managed by a screen list, and in addition, matrix transformation of a camera is built in a simulation engine according to the length and the width of the physical dimension so as to update the image effect correctly according to the physical position of eyes.
Further, in some optional embodiments of the present invention, the Cave building system 200 further comprises:
The acquisition module is used for acquiring head and hand position tracking, wherein a state that a left hand coordinate system and a right hand coordinate system are mutually switched is added in conventional motion capture management.
Further, in some alternative embodiments of the present invention, the listening module 23 includes:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a Cave construction requirement which at least comprises a known field area and a target screen number;
The calling module is used for calling a matched first Cave space from a pre-constructed database according to the known field area and the target screen quantity, wherein the first Cave space is a Cave space with modifiable parameters;
the first determining module is used for obtaining the three-dimensional model of the construction site, determining an access opening planned in the three-dimensional model of the construction site, and generating an accessible channel according to the access opening;
The first control module is used for controlling the first Cave space to expand outwards to obtain a second Cave space consisting of the first Cave space and an expansion area;
the second control module is used for controlling the second Cave space to move along the edge of the barrier-free channel and determining a position which does not interfere with the three-dimensional model of the constructed site;
The second determining module is used for determining a target position in all positions which do not interfere with the three-dimensional model of the constructed site, wherein the target position is the optimal position of the first Cave space meeting the heat dissipation requirement.
Example III
In another aspect, referring to fig. 3, an electronic device according to a third embodiment of the present invention includes a memory 20, a processor 10, and a computer program 30 stored on the memory and capable of running on the processor, where the processor 10 implements a Cave construction method as described above when executing the computer program 30.
The processor 10 may be, among other things, a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments for running program code or processing data stored in the memory 20, e.g. executing an access restriction program or the like.
The memory 20 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 20 may in some embodiments be an internal storage unit of the electronic device, such as a hard disk of the electronic device. The memory 20 may also be an external storage device of the electronic device in other embodiments, such as a plug-in hard disk provided on the electronic device, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), etc. Further, the memory 20 may also include both internal storage units and external storage devices of the electronic device. The memory 20 may be used not only for storing application software of an electronic device and various types of data, but also for temporarily storing data that has been output or is to be output.
It should be noted that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and in other embodiments the electronic device may comprise fewer or more components than shown, or may combine certain components, or may have a different arrangement of components.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the Cave construction method as described above.
Those of skill in the art will appreciate that the logic and/or steps represented in the flow diagrams or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include an electrical connection (an electronic device) having one or more wires, a portable computer diskette (a magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of techniques known in the art, discrete logic circuits with logic gates for implementing logic functions on data signals, application specific integrated circuits with appropriate combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.