Method, device, equipment and medium for controlling 3D virtual model on Web side
Defining control commands through the JSON data structure solves the problem of difficulty in learning and development and maintenance of 3D model control technology on the Web, achieving flexible and efficient 3D model control, reducing development complexity, and improving scalability and user experience.
Patent Information
- Application Number
- CN202411017536.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Existing web-side 3D model control technology has problems such as difficulty in learning, difficulty in development and maintenance, and poor flexibility and scalability. Especially for non-professional developers, it requires strong programming and 3D graphics knowledge, and the code complexity High, which increases the difficulty of development and maintenance.
By using JSON data structure to define control commands, parse command information, associate execution time and module ID, determine control command type, and call direct or indirect control modules, control of 3D virtual models is achieved, avoiding writing complex codes, simplifying operations and development process.
It lowers the development threshold, improves development efficiency, reduces code complexity, enhances flexibility and scalability, enables more developers to participate in the development of 3D applications, and provides a rich and attractive user experience.
Smart Images

Figure CN118550540B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of 3D models, and in particular to a method, device, equipment and medium for controlling a 3D virtual model on a Web terminal. Background Art
[0002] At present, the technology of controlling 3D models on the Web has been developed to a certain extent. The following are several existing technologies and their application status:
[0003] 1. Three.js
[0004] Three.js is a popular JavaScript library for creating and displaying 3D graphics in web browsers. Three.js provides a rich API that enables developers to easily create, manipulate, and render 3D models.
[0005] Application status:
[0006] Create and render 3D models: Three.js is widely used in game development, data visualization, virtual reality, and augmented reality.
[0007] Animation and interaction: Three.js supports various animation effects and user interactions, and can achieve complex model control by writing JavaScript code.
[0008] defect:
[0009] High threshold: Although Three.js is powerful, it requires developers to have certain knowledge of JavaScript and 3D graphics. For non-professional developers, learning and using Three.js is somewhat difficult.
[0010] Code complexity: Implementing complex model control and interaction requires writing a lot of code, which is relatively difficult to maintain and expand.
[0011] 2. Babylon.js
[0012] Babylon.js is another powerful web-side 3D engine that provides a complete toolset to create, render, and control 3D models. It supports 3D models in multiple formats and can run on a variety of devices and platforms.
[0013] Application status:
[0014] High-performance rendering: Babylon.js provides high-performance 3D rendering based on WebGL, which is suitable for applications that require high graphics performance, such as games and architectural visualization.
[0015] Rich features: Supports advanced features such as physics engine, skeletal animation, particle system, etc.
[0016] defect:
[0017] Complexity: Similar to Three.js, the powerful functions and rich features of Babylon.js also mean a high learning curve and complex code implementation.
[0018] Flexibility: Although it provides many features, developers still need to perform a lot of customization and optimization in some specific scenarios.
[0019] 3. A-Frame
[0020] A-Frame is an HTML-based web framework for building virtual reality (VR) experiences. It allows developers to create 3D scenes and objects by writing HTML tags without having to have a deep understanding of JavaScript.
[0021] Application status:
[0022] Simplified development: A-Frame simplifies the creation of 3D content through HTML tags, lowering the entry threshold and making it suitable for rapid prototyping and simple 3D applications.
[0023] VR Support: Built-in support for VR devices makes it easy to create cross-platform VR experiences.
[0024] defect:
[0025] Performance limitations: Due to the use of a higher level of abstraction, A-Frame may not perform as well as Three.js or Babylon.js which use WebGL directly.
[0026] Functional limitations: For complex 3D applications, A-Frame is not as flexible and extensible as Three.js and Babylon.js.
[0027] Although the above technologies have made significant progress in web-based 3D model control, they still have the following common defects:
[0028] Steep learning curve: Both Three.js and Babylon.js require developers to have strong programming skills and 3D graphics knowledge, and there is a high learning and usage threshold for non-professional developers.
[0029] High code complexity: Implementing complex model control and interaction requires writing a large amount of code, which increases the difficulty of development and maintenance.
[0030] Flexibility and scalability: Although these technologies provide rich functionality, developers still need to perform a lot of customization and optimization in certain specific application scenarios. Summary of the invention
[0031] In view of this, an embodiment of the present invention provides a method for controlling a 3D virtual model on a Web terminal to solve the technical problems existing in the prior art, such as high learning difficulty, high development and maintenance difficulty, and poor flexible scalability. The method includes:
[0032] Obtain command information of a JSON data structure, and parse the command information to obtain a control command;
[0033] Associating each of the control commands with an execution time and an execution module ID, wherein the execution module ID corresponds to an operation type of the control command;
[0034] Determine the control command whose execution time is the current time as the current control command;
[0035] Determine the operation type of the current control command. If the operation type of the current control command is a direct control command, call the direct control module according to the corresponding execution module ID, and control the 3D virtual model according to the current control command through the direct control module; if the operation type of the current control command is an indirect control command, call the indirect control module according to the corresponding execution module ID, and detect whether the corresponding predecessor event exists according to the current control command through the indirect control module. If so, continue to execute the next direct control command; if not, continue to detect until the corresponding predecessor event is detected, wherein the predecessor event implemented by the indirect control command is a prerequisite for executing the next direct control command, and each of the indirect control commands is associated with one direct control command, and the direct control command is associated with one indirect control command or is not associated with the indirect control command.
[0036] The embodiment of the present invention also provides a device for controlling a 3D virtual model on a Web terminal to solve the technical problems of high learning difficulty, high development and maintenance difficulty, and poor flexible scalability in the prior art. The device includes:
[0037] A parsing unit, used to obtain command information of a JSON data structure, and parse the command information to obtain a control command;
[0038] an associating unit, configured to associate each of the control commands with an execution time and an execution module ID, wherein the execution module ID corresponds to an operation type of the control command;
[0039] A determination unit, used to determine a control command whose execution time is the current time as the current control command;
[0040] A control unit is used to determine the operation type of the current control command. If the operation type of the current control command is a direct control command, the direct control module is called according to the corresponding execution module ID, and the 3D virtual model is controlled according to the current control command through the direct control module; if the operation type of the current control command is an indirect control command, the indirect control module is called according to the corresponding execution module ID, and the indirect control module is used to detect whether a corresponding preceding event exists according to the current control command. If so, continue to execute the next direct control command; if not, continue to detect until the corresponding preceding event is detected, wherein the preceding event implemented by the indirect control command is a prerequisite for executing the next direct control command, and each of the indirect control commands is associated with one direct control command, and the direct control command is associated with one indirect control command or is not associated with the indirect control command.
[0041] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any of the above-mentioned methods for controlling a 3D virtual model on a Web side is implemented to solve the technical problems existing in the prior art of high learning difficulty, high development and maintenance difficulty, and poor flexible scalability.
[0042] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for executing any of the above-mentioned methods for controlling a 3D virtual model on a Web side, so as to solve the technical problems existing in the prior art such as high learning difficulty, high development and maintenance difficulty, and poor flexible scalability.
[0043] Compared with the prior art, the beneficial effects that can be achieved by at least one of the above-mentioned technical solutions adopted in the embodiments of this specification include at least the following: the traditional Web-side 3D model control technology usually requires developers to have strong programming and 3D graphics knowledge, while the present application uses a simple JSON data structure to define control commands to control 3D models, so that users can achieve complex 3D model control through simple JSON configuration files, avoiding the requirement of learning programming and 3D graphics knowledge, simplifying the difficulty of operation, reducing the difficulty and threshold of development, and enabling more developers to participate in the development of Web-side 3D applications; by adopting the JSON data structure, flexible control of the 3D model can be achieved without writing complex codes, thereby saving a lot of development time, improving development efficiency, reducing the complexity of program code, and improving the readability and maintainability of the code; the JSON data structure supports a variety of control commands and parameter configurations, which is convenient for developers to expand and customize according to specific needs, improves flexibility and scalability, is conducive to expanding the application of 3D technology in various fields, and can also provide a richer and more attractive user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 is a flow chart of a method for controlling a 3D virtual model on a Web terminal provided by an embodiment of the present invention;
[0046] Figure 2 It is a schematic diagram of the principle of a method for controlling a 3D virtual model on a Web terminal provided by an embodiment of the present invention;
[0047] Figure 3 is a structural block diagram of a computer device provided by an embodiment of the present invention;
[0048] Figure 4 This is a structural block diagram of a device for controlling a 3D virtual model on a Web side provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0050] The following describes the implementation methods of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.
[0051] In an embodiment of the present invention, a method for controlling a 3D virtual model on a Web terminal is provided, such as Figure 1 As shown, the method includes:
[0052] Step S101: Acquire command information in a JSON data structure, and parse the command information to obtain a control command;
[0053] Step S102: Associating each of the control commands with an execution time and an execution module ID, wherein the execution module ID corresponds to an operation type of the control command;
[0054] Step S103: determining the control command whose execution time is the current time as the current control command;
[0055] Step S104: Determine the operation type of the current control command. If the operation type of the current control command is a direct control command, call the direct control module according to the corresponding execution module ID, and control the 3D virtual model according to the current control command through the direct control module; if the operation type of the current control command is an indirect control command, call the indirect control module according to the corresponding execution module ID, and detect whether the corresponding predecessor event exists according to the current control command through the indirect control module. If so, continue to execute the next direct control command; if not, continue to detect until the corresponding predecessor event is detected, wherein the predecessor event implemented by the indirect control command is a prerequisite for executing the next direct control command, and each of the indirect control commands is associated with one direct control command, and the direct control command is associated with one indirect control command or is not associated with the indirect control command.
[0056] Depend on Figure 1 As can be seen from the process shown, in the embodiment of the present invention, the traditional Web-side 3D model control technology usually requires developers to have strong programming and 3D graphics knowledge, while the present application controls the 3D model by using a simple JSON data structure to define control commands, so that users can achieve complex 3D model control through a simple JSON configuration file, avoiding the requirement of learning programming and 3D graphics knowledge, simplifying the difficulty of operation, reducing the development difficulty and threshold, and enabling more developers to participate in the development of Web-side 3D applications; using the JSON data structure, flexible control of the 3D model can be achieved without writing complex code, thereby saving a lot of development time, improving development efficiency, reducing the complexity of program code, and improving the readability and maintainability of the code; the JSON data structure supports a variety of control commands and parameter configurations, which is convenient for developers to expand and customize according to specific needs, improves flexibility and scalability, is conducive to expanding the application of 3D technology in various fields, and can also provide a richer and more attractive user experience.
[0057] In specific implementation, since the control commands are defined through the JSON data structure, users can achieve various complex 3D model controls through simple JSON configuration files, simplifying operations and reducing development difficulty and thresholds. In addition, the JSON data structure supports a variety of control commands and parameter configurations, making it convenient for developers to expand and customize according to specific needs, thereby improving the flexibility and scalability of 3D virtual model control. Figure 2 As shown, for example, the command information of the JSON data structure can be obtained in the following ways: the command information of the JSON data structure can be directly imported through the website, and the command information of the JSON data structure can be obtained by dragging graphic blocks, selecting the interaction logic between the graphic blocks, and then forming the command information of the JSON data structure according to the interaction logic and the dragged graphic blocks.
[0058] In the specific implementation, since the JSON data structure supports multiple control commands, parameter configurations, and logical nested relationships, the command information of the JSON data structure can be used to input control commands for various control requirements and various complex control processes. In order to accurately obtain different control commands, it is proposed to perform recursive parsing according to the JSON logical nested relationship of the command information to obtain each of the control commands, and each of the control commands includes an operation type and corresponding operation parameters.
[0059] In specific implementation, the command information of the above JSON data structure may include a series of control commands, which can be divided into two categories: direct control commands and indirect control commands. Each command includes an operation type and corresponding operation parameters (for example, model information, operation action, operation location information, operation size multiples, etc.).
[0060] For example, the direct control command may include, but is not limited to, control operations such as move, rotate, scale, and change material.
[0061] Indirect control commands can be divided into conditional control, logic control, manual control and other categories. That is, the pre-events of conditional control include but are not limited to when the model meets the conditional events such as XX control, the pre-events of logic control include but are not limited to logical events such as repeated execution, and the pre-events of manual control include but are not limited to user behavior events such as user click control.
[0062] In specific implementation, an example of the command information of the above JSON data structure is as follows:
[0063] {
[0064] "commands": [
[0065] {"type": "move", "parameters": {"x": 10, "y": 0, "z": 5}},
[0066] {"type": "rotate", "parameters": {"axis": "y", "angle": 90}},
[0067] {"type": "scale", "parameters": {"x": 2, "y": 2, "z": 2}},
[0068] {"type": "change_material", "parameters": {"color": "red"}} ]
[0070] }
[0071] During specific implementation, due to the use of command information of the JSON data structure, the specific process of controlling the 3D model in this application is different from the existing process of controlling the 3D model: the existing process of controlling the 3D model is simply to operate the model or control other elements in the scene, and cannot realize subsequent operation of the model or control other elements in the scene based on certain pre-events; while the command information of the JSON data structure of this application can control the 3D model to simulate various events in the real world. Due to the use of indirect control commands, the control of the 3D model model has logical judgment and event triggering mechanisms. For example, when a user clicks a switch, the light will brighten or dim accordingly. The prior art requires technicians to write code to implement the process of the user clicking the switch and the process of the light brightening or dimming. This application only requires ordinary users to write command information of the json data structure to achieve it. There is no need to write complex code, and it can also enhance the user's participation experience. This application will parse the command information of the json data structure, parse the logical part to obtain the indirect control command, parse other control information to obtain the direct control command, and can also parse the association between the indirect control command and the direct control command based on the nested relationship. For example, "the user clicks the switch" is implemented through an indirect control command, and "the light will brighten or dim accordingly" is implemented through a direct control command. Only when the "user clicks the switch" event is detected (the user's click operation can be detected through a detection program), the "light will brighten or dim accordingly" command will be executed to control the brightness or darkness of the light model.
[0072] During specific implementation, in order to meet the control requirements of different 3D models, each of the indirect control commands needs to be associated with one of the direct control commands. However, the direct control command may be associated with one of the indirect control commands or may not be associated with the indirect control command.
[0073] In the specific implementation, in order to complete the execution process of direct control commands and indirect control commands conveniently, efficiently and accurately, such as Figure 2 As shown, a direct control module can be pre-set to complete the control operations of different direct control commands, and an indirect control module can be pre-set to execute different indirect control commands, such as detecting condition events, user behavior events, or judging logic events.
[0074] In specific implementation, in order to further improve the flexibility of control or the timing of a certain control process, it is proposed to associate each of the control commands with the corresponding execution time and execution module ID, for example,
[0075] The execution time corresponding to each of the control commands is determined according to the time information configured in the command information (for example, the execution time of a certain control command can be defined in the command information, such as executing one control command at the 5th second and executing another control command at the 8th second), or the execution time corresponding to each of the control commands is determined according to the recursive order of the JSON logical nesting relationship in the command information; the operation type of each of the control commands is determined according to the operation information configured in the command information, and the execution module ID associated with each of the control commands is determined according to the operation type.
[0076] For example, the control commands of each part of JSON will be bound to time. According to the execution time of different control commands, the program can start the control command corresponding to the execution time from any time point (that is, the execution time of the control command can be arbitrarily defined and configured at a certain time point, without the need to configure it according to the continuity of time, and the execution time between different control commands can be intermittent or discontinuous) or pause the program execution at a certain time point. After JSON parsing, the execution time and the ID of the execution module corresponding to the JSON control command will be recorded in real time. The control commands are executed in the order of recursive parsing. If a direct control command is parsed, it will be executed directly. If an indirect control command is parsed, it will be judged whether to pause, delay or execute after the conditions are met according to the classification of the indirect control command. If it is paused and the execution is executed after the conditions are met, the timeline will be paused, the JSON parsing will be paused, and after the execution is completed and the conditions are met, it will be restarted. It will continue to execute according to the previously recorded execution time or the ID of the execution module until the entire JSON is parsed. For example, if model A moves left, and then after monitoring the user's click, model A moves right, and the right move and subsequent operations can be performed directly.
[0077] In specific implementation, determining a control command whose execution time is the current time as the current control command includes: in the process of parsing the command information to obtain the control command, using the control command currently parsed as the current control command; judging whether the execution time associated with the current control command is the current time, if so, executing the current control command, if not, pausing the parsing of the command information until the current control command is executed, and continuing to parse the command information to obtain the next control command.
[0078] For example, when parsing the command information of the JSON data structure, the JSON data will be recursively parsed to find the logical control part inside and perform separate processing. For example, the control process is: after the collision between model A and model B, operation C will be executed. When this part of the JSON data is parsed, the code will be executed first to monitor the collision between model A and model B (that is, the indirect control command of the collision between model A and model B will be executed first, and the model box intersection check and the model plane intersection check will be performed in each frame. If one of the conditions is met, it will be judged as a collision). At this time, the parsing of the entire JSON data will be suspended. When the collision between model A and model B is detected, the direct control module will be found to perform operation C, that is, the direct control command of operation C will be executed, and the parsing of the JSON data will continue.
[0079] In specific implementation, if in the process of controlling the 3D virtual model according to the current control command through the direct control module, the change of the 3D virtual model (or called process data) generates an additional event; when it is determined that the operation type of the next control command is an indirect control command and the additional event is a prerequisite event for the implementation of the next control command, the next control command is executed.
[0080] For example, in the process of executing the direct control command of model enlargement, the enlargement of the model may trigger an indirect control command such as the intersection between models, thereby affecting the pause and start of the timeline. At this time, it is necessary to determine whether the intersection between models is a pre-event for the next indirect control command to be implemented. If so, it is executed, otherwise, it is not executed.
[0081] In specific implementation, in order to further improve the flexibility of control, a time controller is displayed on the Web side, and the time controller includes time control components with different time control functions, wherein the time controller is used to manage the execution time of the control command; receive a selection of the time control component input through an input device (for example, a keyboard, a mouse, etc.); and execute corresponding time control functions for all operations of the control command currently being executed according to the selected time control component.
[0082] For example, Figure 2As shown, the time controller can be displayed on the Web end. Users can directly click the time control buttons on the time controller (such as start, pause, stop, reset, instant time control components) or a part of the JSON visualization (which can be 2D or 3D) through mouse operations, and can start, pause, stop, and control a certain time of the time controller, or control a certain time point of a behavior control module, so that all operations of the currently executed control command perform the corresponding time control function. If you click the pause button on the time controller, all operations of the currently executed control command will be paused, and the time point will also be paused.
[0083] In specific implementation, the above method of controlling the 3D virtual model on the Web side can be implemented in the form of a control engine, and can also be implemented by any form of equipment or device.
[0084] In this embodiment, a computer device is provided, such as Figure 3 As shown, it includes a memory 301, a processor 302 and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any of the above methods for controlling a 3D virtual model on a Web side is implemented.
[0085] Specifically, the computer device may be a computer terminal, a server or a similar computing device.
[0086] In this embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program for executing any of the above-mentioned methods for controlling a 3D virtual model on a Web side.
[0087] Specifically, computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0088] Based on the same inventive concept, an apparatus for controlling a 3D virtual model on a Web side is also provided in an embodiment of the present invention, as described in the following embodiments. Since the principle of solving the problem by the apparatus for controlling a 3D virtual model on a Web side is similar to that of the method for controlling a 3D virtual model on a Web side, the implementation of the apparatus for controlling a 3D virtual model on a Web side can refer to the implementation of the method for controlling a 3D virtual model on a Web side, and the repeated parts will not be repeated. As used below, the terms "unit" or "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, the implementation in hardware, or a combination of software and hardware, is also possible and conceivable.
[0089] Figure 4 is a structural block diagram of a device for controlling a 3D virtual model on a Web side according to an embodiment of the present invention, such as Figure 4 As shown, the device comprises:
[0090] A parsing unit 401 is used to obtain command information of a JSON data structure, and parse the command information to obtain a control command;
[0091] An associating unit 402, configured to associate each of the control commands with an execution time and an execution module ID, wherein the execution module ID corresponds to an operation type of the control command;
[0092] A determining unit 403, configured to determine a control command whose execution time is the current time as a current control command;
[0093] The control unit 404 is used to determine the operation type of the current control command. If the operation type of the current control command is a direct control command, the direct control module is called according to the corresponding execution module ID, and the 3D virtual model is controlled according to the current control command through the direct control module; if the operation type of the current control command is an indirect control command, the indirect control module is called according to the corresponding execution module ID, and the indirect control module is used to detect whether a corresponding predecessor event exists according to the current control command. If so, continue to execute the next direct control command; if not, continue to detect until the corresponding predecessor event is detected, wherein the predecessor event implemented by the indirect control command is a prerequisite for executing the next direct control command, and each of the indirect control commands is associated with one direct control command, and the direct control command is associated with one indirect control command or is not associated with the indirect control command.
[0094] In one embodiment, the parsing unit is used to perform recursive parsing according to the JSON logical nesting relationship of the command information to obtain each of the control commands, and each of the control commands includes an operation type and corresponding operation parameters.
[0095] In one embodiment, the association unit is used to determine the execution time corresponding to each of the control commands according to the time information configured in the command information, or to determine the execution time corresponding to each of the control commands according to the recursive order of the JSON logical nesting relationship in the command information; determine the operation type of each of the control commands according to the operation information configured in the command information, and determine the execution module ID associated with each of the control commands according to the operation type.
[0096] In one embodiment, a determination unit is used to, in the process of parsing the command information to obtain a control command, use the control command currently parsed as the current control command; determine whether the execution time associated with the current control command is the current time, and if so, execute the current control command; if not, suspend parsing of the command information until the current control command is executed, and continue parsing the command information to obtain the next control command.
[0097] In one embodiment, the above-mentioned control unit is also used to execute the next control command if an additional event is generated by the change of the 3D virtual model during the process of controlling the 3D virtual model through the direct control module according to the current control command; and if it is determined that the operation type of the next control command is an indirect control command and the additional event is a prerequisite event for the implementation of the next control command.
[0098] In one embodiment, the above-mentioned control unit is also used to display a time controller on the Web side, and the time controller includes time control components with different time control functions, wherein the time controller is used to manage the execution time of the control command; receive a selection of the time control component input through an input device; and execute corresponding time control functions for all operations of the control command currently being executed according to the selected time control component.
[0099] In one embodiment, the preceding event includes any one or any combination of the following: a conditional event, a logical event, and a user behavior event.
[0100] The embodiments of the present invention achieve the following technical effects: traditional Web-based 3D model control technology usually requires developers to have strong programming and 3D graphics knowledge, while the present application uses a simple JSON data structure to define control commands to control 3D models, so that users can achieve complex 3D model control through simple JSON configuration files, avoiding the requirement of learning programming and 3D graphics knowledge, simplifying the difficulty of operation, reducing the development difficulty and threshold, and enabling more developers to participate in the development of Web-based 3D applications; using the JSON data structure, flexible control of the 3D model can be achieved without writing complex codes, thereby saving a lot of development time, improving development efficiency, reducing the complexity of program codes, and improving the readability and maintainability of the code; the JSON data structure supports a variety of control commands and parameter configurations, which is convenient for developers to expand and customize according to specific needs, improves flexibility and scalability, is conducive to expanding the application of 3D technology in various fields, and can also provide a richer and more attractive user experience.
[0101] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for controlling a 3D virtual model on a Web terminal, It is characterized in that include: Acquire command information in a JSON data structure, and parse the command information to obtain a control command, wherein the command information includes an operation type and corresponding operation parameters of the control command; Associating each of the control commands with an execution time and an execution module ID, wherein the execution module ID corresponds to an operation type of the control command; Determine the control command whose execution time is the current time as the current control command; Determine the operation type of the current control command. If the operation type of the current control command is a direct control command, call the direct control module according to the corresponding execution module ID, and control the 3D virtual model according to the current control command through the direct control module; if the operation type of the current control command is an indirect control command, call the indirect control module according to the corresponding execution module ID, and detect whether the corresponding prerequisite event exists according to the current control command through the indirect control module. If so, continue to execute the next direct control command; if not, continue to detect until the corresponding prerequisite event is detected, wherein the prerequisite event implemented by the indirect control command is a prerequisite for executing the next direct control command, each of the indirect control commands is associated with one direct control command, and the direct control command is associated with one indirect control command or is not associated with the indirect control command, and the prerequisite event includes any one or any combination of the following: conditional events, logical events, and user behavior events.
2. The method for controlling a 3D virtual model on a Web terminal as claimed in claim 1, It is characterized in that Parsing the command information to obtain the control command includes: Recursive parsing is performed according to the JSON logical nesting relationship of the command information to obtain each of the control commands, each of which includes an operation type and corresponding operation parameters.
3. The method for controlling a 3D virtual model on a Web terminal as claimed in claim 1, It is characterized in that Associating each of the control commands with the corresponding execution time and execution module ID, including: Determine the execution time corresponding to each of the control commands according to the time information configured in the command information, or determine the execution time corresponding to each of the control commands according to the recursive order of the JSON logical nesting relationship in the command information; The operation type of each of the control commands is determined according to the operation information configured in the command information, and the execution module ID associated with each of the control commands is determined according to the operation type.
4. The method for controlling a 3D virtual model on a Web terminal as claimed in claim 1, It is characterized in that Determine the control command whose execution time is the current time as the current control command, including: In the process of parsing the command information to obtain the control command, taking the control command currently obtained by parsing as the current control command; Determine whether the execution time associated with the current control command is the current time. If so, execute the current control command. If not, suspend parsing of the command information until the current control command is executed, and continue parsing the command information to obtain the next control command.
5. The method for controlling a 3D virtual model on a Web terminal according to any one of claims 1 to 4, It is characterized in that Also includes: If, during the process of controlling the 3D virtual model according to the current control command by the direct control module, a change in the 3D virtual model generates an additional event; When it is determined that the operation type of the next control command is an indirect control command and the additional event belongs to a preceding event implemented by the next control command, the next control command is executed.
6. The method for controlling a 3D virtual model on a Web terminal according to any one of claims 1 to 4, It is characterized in that Also includes: Displaying a time controller on the Web side, the time controller includes time control components with different time control functions, wherein the time controller is used to manage the execution time of the control command; receiving a selection of a time control component inputted via an input device; The selected time control component performs corresponding time control functions on all operations of the currently executed control command.
7. A device for controlling a 3D virtual model on a Web terminal, It is characterized in that include: A parsing unit, configured to obtain command information in a JSON data structure, and parse the command information to obtain a control command, wherein the command information includes an operation type and a corresponding operation parameter of the control command, wherein the command information includes an operation type and a corresponding operation parameter of the control command; an associating unit, configured to associate each of the control commands with an execution time and an execution module ID, wherein the execution module ID corresponds to an operation type of the control command; A determination unit, used to determine a control command whose execution time is the current time as the current control command; A control unit is used to determine the operation type of the current control command. If the operation type of the current control command is a direct control command, the direct control module is called according to the corresponding execution module ID, and the 3D virtual model is controlled according to the current control command through the direct control module; if the operation type of the current control command is an indirect control command, the indirect control module is called according to the corresponding execution module ID, and the indirect control module is used to detect whether a corresponding prerequisite event exists according to the current control command. If so, continue to execute the next direct control command; if not, continue to detect until the corresponding prerequisite event is detected, wherein the prerequisite event implemented by the indirect control command is a prerequisite for executing the next direct control command, each of the indirect control commands is associated with one direct control command, and the direct control command is associated with one indirect control command or is not associated with the indirect control command, and the prerequisite event includes any one or any combination of the following: conditional events, logical events, and user behavior events.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method for controlling a 3D virtual model on a Web side according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program for executing the method for controlling a 3D virtual model on a Web side according to any one of claims 1 to 6.
Citation Information
Patent Citations
BIM three-dimensional building model display method based on Web terminal
CN112182700A
Dynamic implementation method for three-dimensional model of equipment
CN113569098A
Composing web-based interactive 3D scenes using high order visual editor commands
US20170024112A1
Visualization and interaction of 3D models via remotely rendered video stream system and method
US20200084251A1
Method and device for constructing and configuring three-dimensional space scene model, and computer program product
WO2023159595A1
