Method, device, mobile terminal and storage medium for simulating plant growth
By obtaining and adjusting the maps and morphological parameters of the pre-established plant model on the mobile terminal, the problem that the mobile platform cannot run the complex SpeedTree plug-in is solved, and a realistic plant growth simulation in mobile games is realized.
Patent Information
- Application Number
- CN202011539131.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2040-12-23
AI Technical Summary
The existing SpeedTree plug-in is difficult to use in mobile games because the mobile platform cannot bear its complex computing needs, resulting in poor growth of simulated plants.
It provides a method to simulate plant growth. By obtaining pre-established plant models, adjusting maps and morphological parameters in real time according to real-time growth time and preset parameters, simulating the growth process of plants, which is suitable for mobile terminals.
It realizes simple and low-computing plant growth simulation on mobile terminals, and can gradually grow from seedling state to mature state, which is suitable for mobile games.
Smart Images

Figure CN112669430B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of 3D modeling, and in particular to a method, device, mobile terminal and storage medium for simulating plant growth. Background Art
[0002] In the existing technology, SpeedTree is widely used as a commercial plug-in. This plug-in uses a complex runtime vertex generation algorithm to continuously modify model data and textures. It can indeed simulate plant growth very realistically and is widely used in CG, movies, and console games.
[0003] However, SpeedTree is difficult to apply in mobile games because outdoor scenes usually have a lot of vegetation and mobile platforms cannot afford to perform its complex calculations. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, device, mobile terminal and storage medium for simulating plant growth to solve the above problems.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for simulating plant growth, the method for simulating plant growth comprising:
[0007] Acquire a pre-established plant model, wherein the plant model includes mapping parameters and morphological parameters;
[0008] When it is detected that the growth conditions are met, the real-time growth duration is counted;
[0009] Adjusting the mapping parameters of the plant model in real time according to the real-time growth duration, the preset total growth duration, the preset first mapping color and the preset second mapping color;
[0010] The morphological parameters of the plant model are adjusted in real time according to the real-time growth time, the preset total growth time and the preset magnification.
[0011] In an optional embodiment, the step of adjusting the mapping parameters of the plant model in real time according to the real-time growth time, the preset total growth time, the preset first mapping color and the preset second mapping color comprises:
[0012] Determine the fusion degree weight according to the real-time growth time and the preset total growth time;
[0013] The mapping parameters of the plant model are adjusted in real time according to the fusion degree weight, the set first mapping color and the preset second mapping color.
[0014] In an optional implementation, the real-time growth duration and the preset total growth duration determine the fusion degree weight to satisfy the formula:
[0015]
[0016] Wherein, w is the fusion degree weight, T s is the real-time growth duration, T z It is the preset total growth time.
[0017] In an optional implementation, the texture parameters, the fusion weight, the preset first texture color, and the preset second texture color satisfy the formula:
[0018] f final =F+(TF)*w
[0019] Among them, f final is the adjusted mapping parameter, F is the preset first mapping color, and T is the preset second mapping color.
[0020] In an optional embodiment, the step of adjusting the morphological parameters of the plant model in real time according to the real-time growth time, the preset total growth time and the preset magnification factor includes:
[0021] Determining the growth rate according to a preset total growth time and a preset magnification factor;
[0022] The morphological parameters of the plant model are adjusted in real time according to the growth rate and the real-time growth duration.
[0023] In a second aspect, an embodiment of the present application further provides a device for simulating plant growth, the device for simulating plant growth comprising:
[0024] A model acquisition module, used to acquire a pre-established plant model, wherein the plant model includes mapping parameters and morphological parameters;
[0025] The duration statistics module is used to count the real-time growth duration when it is detected that the growth conditions are met;
[0026] A parameter adjustment module, used for adjusting the mapping parameters of the plant model in real time according to the real-time growth time, the preset total growth time, the preset first mapping color and the preset second mapping color;
[0027] The parameter adjustment module is also used to adjust the morphological parameters of the plant model in real time according to the real-time growth time, the preset total growth time and the preset magnification factor.
[0028] In an optional implementation, the parameter adjustment module is used to determine the fusion degree weight according to the real-time growth duration and a preset total growth duration;
[0029] The parameter adjustment module is also used to adjust the mapping parameters of the plant model in real time according to the fusion degree weight, the set first mapping color and the preset second mapping color.
[0030] In an optional embodiment, the parameter adjustment module is used to determine the growth rate according to a preset total growth time and a preset magnification factor;
[0031] The parameter adjustment module is also used to adjust the morphological parameters of the plant model in real time according to the growth rate and the real-time growth duration.
[0032] In a third aspect, an embodiment of the present application further provides a mobile terminal, comprising a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the method of simulating plant growth in any one of the above-mentioned embodiments.
[0033] In a fourth aspect, an embodiment of the present application further provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for simulating plant growth in any one of the above-mentioned embodiments.
[0034] The method, device, mobile terminal and storage medium for simulating plant growth provided by the embodiments of the present invention obtain a pre-established plant model, and when it is detected that the growth conditions are met, the real-time growth duration is counted, and the mapping parameters of the plant model are adjusted in real time according to the real-time growth duration, the preset total growth duration, the preset first mapping color and the preset second mapping color, and the morphological parameters of the plant model are adjusted in real time according to the preset total growth duration and the preset magnification. By adjusting the mapping parameters and morphological parameters of the model respectively within the preset total growth duration, the process of growth from a small tree to a large tree is simulated, which is simple, convenient, and requires little calculation, and can be applied to mobile terminals.
[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 A schematic structural diagram of a mobile terminal provided by an embodiment of the present invention is shown.
[0038] Figure 2 A flow chart of a method for simulating plant growth provided by an embodiment of the present invention is shown.
[0039] Figure 3 Shows Figure 2 Specific flow chart of S203.
[0040] Figure 4 Shows Figure 2 Specific flow chart of S204.
[0041] Figure 5 A functional module block diagram of a device for simulating plant growth provided by an embodiment of the present invention is shown.
[0042] Icons: 100-mobile terminal; 101-radio unit; 102-network module; 103-audio output unit; 104-input unit; 1041-graphics processor; 1042-microphone; 105-sensor; 106-display unit; 1061-display panel; 107-user input unit; 1071-touch panel; 1072-other input devices; 108-interface unit; 109-memory; 110-processor; 111-power supply; 200-device for simulating plant growth; 210-model acquisition module; 220-duration statistics module; 230-parameter adjustment module. DETAILED DESCRIPTION
[0043] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0044] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0045] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0046] Please refer to Figure 1 , is a block diagram of a mobile terminal 100. The mobile terminal 100 includes but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that Figure 1 The mobile terminal structure shown in the figure does not constitute a limitation on the mobile terminal, and the mobile terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiment of the present invention, the mobile terminal includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted mobile terminal, a wearable device, and a pedometer.
[0047] It should be understood that in the embodiment of the present invention, the RF unit 101 can be used for receiving and sending signals during information transmission or calls. Specifically, after receiving downlink data from the base station, it is sent to the processor 110 for processing; in addition, uplink data is sent to the base station. Generally, the RF unit 101 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the RF unit 101 can also communicate with the network and other devices through a wireless communication system.
[0048] The mobile terminal provides users with wireless broadband Internet access through the network module 102, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0049] The audio output unit 103 can convert the audio data received by the RF unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output it as sound. Moreover, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile terminal 100 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 103 includes a speaker, a buzzer, a receiver, etc.
[0050] The input unit 104 is used to receive audio or video signals. The input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042. The graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 106. The image frame processed by the graphics processor 1041 can be stored in the memory 109 (or other storage medium) or sent via the radio frequency unit 101 or the network module 102. The microphone 1042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode.
[0051] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 105 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0052] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0053] The user input unit 107 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile terminal. Specifically, the user input unit 107 includes a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1071 or near the touch panel 1071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 1071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 110, receives the command sent by the processor 110 and executes it. In addition, the touch panel 1071 can be implemented in various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.
[0054] Furthermore, the touch panel 1071 may be overlaid on the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of the touch event. Then, the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Figure 1 In the figure, the touch panel 1071 and the display panel 1061 are used as two independent components to implement the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to implement the input and output functions of the mobile terminal, which is not limited here.
[0055] The interface unit 108 is an interface for connecting an external device to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements in the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
[0056] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 109 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0057] The processor 110 is the control center of the mobile terminal. It uses various interfaces and lines to connect various parts of the entire mobile terminal. It executes various functions of the mobile terminal and processes data by running or executing software programs and / or modules stored in the memory 109, and calling data stored in the memory 109, so as to monitor the mobile terminal as a whole. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 110.
[0058] The mobile terminal 100 may also include a power supply 111 (such as a battery) for supplying power to various components. Preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0059] In addition, the mobile terminal 100 includes some functional modules not shown, which will not be described in detail here.
[0060] The present application embodiment provides a method for simulating plant growth, which is applied to the mobile terminal 100. Figure 2 , is a flow chart of a method for simulating plant growth provided in an embodiment of the present application. The method for simulating plant growth comprises:
[0061] S201, obtaining a pre-established plant model.
[0062] The plant model includes mapping parameters and morphological parameters. The pre-established plant model should be a model of the plant in the seedling stage. The mapping parameters can reflect the material, color, etc. of the plant model; the morphological parameters reflect the various dimensions of the plant model, such as height, trunk circumference, branch length, and other parameters.
[0063] It can be understood that by adjusting the mapping parameters and the morphological parameters, the pre-established plant model can be updated, thereby achieving the simulation of the plant growth process.
[0064] It should be noted that the plant can be a tree, a shrub, a grass or the like.
[0065] S202, when it is detected that the growth condition is met, the real-time growth duration is counted.
[0066] It should be noted that the growth condition can be set according to actual needs. For example, when a user input command for controlling plant growth is detected, it indicates that the growth condition is detected to be met. For another example, when it is detected that the game has been running for a certain period of time, it indicates that the growth condition is met.
[0067] The real-time growth duration represents the duration of plant growth, which can be updated in real time. S203: adjusting the mapping parameters of the plant model in real time according to the real-time growth duration, the preset total growth duration, the preset first mapping color and the preset second mapping color.
[0068] The preset total growth time is the time it takes for a plant to grow from a seedling state to a mature state. It should be noted that in some cases, in order to provide users with a more realistic experience, the preset total growth time can be set to a smaller value, giving the plant a buffer period to grow from a seedling state to a mature state; of course, in actual application, the preset total growth time can be set according to demand and is not limited.
[0069] In addition, the preset first map color is a predetermined map color when the plant is in a seedling state. The preset second map color is a predetermined map color when the plant is in a mature state.
[0070] See also Figure 3 , is a specific flow chart of S203. The S203 includes:
[0071] S2031, determining the fusion degree weight according to the real-time growth time and the preset total growth time.
[0072] Among them, the real-time growth duration and the preset total growth duration determine the fusion degree weight to satisfy the formula:
[0073]
[0074] Among them, w is the fusion weight, T s is the real-time growth duration, T z The total growth time is preset.
[0075] S2032, adjusting the mapping parameters of the plant model in real time according to the fusion degree weight, the preset first mapping color, and the preset second mapping color.
[0076] Among them, the texture parameters, the fusion weight, the preset first texture color, and the preset second texture color satisfy the formula:
[0077] f final =F+(TF)*w
[0078] Among them, f final is the adjusted mapping parameter, F is the preset first mapping color, and T is the preset second mapping color.
[0079] It can be seen that as the real-time growth time increases, the fusion weight becomes larger and larger, and the mapping parameters of the plant model slowly transition from the preset first mapping color to the preset second mapping color, realizing the simulation process of the color change of the plant model from the seedling state to the mature state.
[0080] It should be noted that the plant model can be divided into a trunk model and a leaf model. Accordingly, the preset first map color includes the first trunk map color and the first leaf map color, and the preset second map color includes the second trunk map color and the second leaf map color. Thus, the first trunk map color, the second trunk map color and the formula provided in steps S2031 to S2032 are used to realize the simulation process of trunk color change; and the first leaf map color, the second leaf map color and the formula provided in steps S2031 to S2032 are used to realize the simulation process of leaf color change.
[0081] S204, adjusting the morphological parameters of the plant model in real time according to a preset total growth time and a preset magnification factor.
[0082] In an alternative embodiment, see Figure 4 , which is a specific flow chart of S204. The S204 includes:
[0083] S2041, determining the growth rate according to a preset total growth time and a preset magnification factor.
[0084] The growth rate can be obtained by dividing the preset magnification factor by the preset total growth time.
[0085] S2042, adjusting the morphological parameters of the plant model in real time according to the growth rate and the real-time growth duration.
[0086] The morphological parameters before adjustment, the morphological parameters after adjustment and the growth rate satisfy the formula:
[0087] m final =m before +k·t
[0088] Among them, m finalis the adjusted morphological parameter, m before is the morphological parameter before adjustment, k is the growth rate, and t is the real-time growth time.
[0089] It can be seen that as the real-time growth time changes, the adjusted morphological parameters become larger and larger, realizing the simulation process of the morphological changes of the plant model from the seedling state to the mature state.
[0090] In order to execute the corresponding steps in the above embodiments and various possible methods, an implementation method of a plant growth simulation device 200 is provided below. Optionally, the plant growth simulation device 200 can adopt the above Figure 1 For further information, please refer to Figure 5 , Figure 5 A functional module diagram of a plant growth simulation device 200 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the plant growth simulation device 200 provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. The plant growth simulation device 200 includes: a model acquisition module 210, a duration statistics module 220, and a parameter adjustment module 230.
[0091] The model acquisition module 210 is used to acquire a pre-established plant model, wherein the plant model includes mapping parameters and morphological parameters.
[0092] It can be understood that, in an optional implementation, the model acquisition module 210 can be used to execute S201.
[0093] The duration statistics module 220 is used to count the real-time growth duration when it is detected that the growth condition is met.
[0094] It can be understood that, in an optional implementation, the duration statistics module 220 can be used to execute S202.
[0095] The parameter adjustment module 230 is used to adjust the mapping parameters of the plant model in real time according to the real-time growth time, the preset total growth time, the preset first mapping color and the preset second mapping color.
[0096] Specifically, the parameter adjustment module 230 is used to determine the fusion weight according to the real-time growth time and the preset total growth time, and to adjust the mapping parameters of the plant model in real time according to the fusion weight, the preset first mapping color and the preset second mapping color.
[0097] It can be understood that, in an optional implementation, the parameter adjustment module 230 can be used to execute S203, S2031 and S2032.
[0098] The parameter adjustment module 230 is also used to adjust the morphological parameters of the plant model in real time according to a preset total growth time and a preset magnification factor.
[0099] Specifically, the parameter adjustment module 230 is used to determine the growth rate according to a preset total growth time and a preset magnification factor, and adjust the morphological parameters of the plant model in real time according to the growth rate and the real-time growth time.
[0100] It can be understood that, in an optional implementation, the parameter adjustment module 230 can be used to execute S204, S2041 and S2042.
[0101] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 109 shown in the figure may be fixed in the operating system (OS) of the mobile terminal 100 and may be Figure 1 Meanwhile, the data and program codes required for executing the above modules may be stored in the memory 109.
[0102] The embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by the processor 110, the method for simulating plant growth in any of the above-mentioned embodiments is implemented.
[0103] In summary, the method, device, mobile terminal and storage medium for simulating plant growth provided by the embodiments of the present invention obtain a pre-established plant model, and when it is detected that the growth conditions are met, the real-time growth time is counted, and the mapping parameters of the plant model are adjusted in real time according to the real-time growth time, the preset total growth time, the preset first mapping color and the preset second mapping color, and the morphological parameters of the plant model are adjusted in real time according to the preset total growth time and the preset magnification. By adjusting the mapping parameters and morphological parameters of the model respectively within the preset total growth time, the process of growing from a small tree to a large tree is simulated, which is simple, convenient, and requires little calculation, and can be applied to mobile terminals.
[0104] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0105] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0106] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0107] 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 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 simulating plant growth, characterized in that: The method for simulating plant growth comprises: Acquire a pre-established plant model, wherein the plant model includes mapping parameters and morphological parameters; When it is detected that the growth conditions are met, the real-time growth duration is counted; The mapping parameters of the plant model are adjusted in real time according to the real-time growth time, the preset total growth time, the preset first mapping color and the preset second mapping color, including: determining the fusion weight according to the real-time growth time and the preset total growth time; as the real-time growth time increases, the fusion weight becomes larger and larger; adjusting the mapping parameters of the plant model in real time according to the fusion weight, the set first mapping color and the preset second mapping color; the mapping parameters, the fusion weight, the preset first mapping color and the preset second mapping color satisfy the formula: f final =F+(TF)*w; where w is the fusion weight, f final is the adjusted mapping parameter, F is the preset first mapping color, and T is the preset second mapping color; The morphological parameters of the plant model are adjusted in real time according to the real-time growth time, the preset total growth time and the preset magnification, including: determining the growth rate according to the preset total growth time and the preset magnification; adjusting the morphological parameters of the plant model in real time according to the growth rate and the real-time growth time; wherein the morphological parameters before adjustment, the morphological parameters after adjustment and the growth rate satisfy the formula: m final =m before +k*t; where m final is the adjusted morphological parameter, m before is the morphological parameter before adjustment, k is the growth rate, and t is the real-time growth time.
2. The method for simulating plant growth according to claim 1, characterized in that: The real-time growth duration and the preset total growth duration determine the fusion degree weight to satisfy the formula: Among them, t s is the real-time growth duration, T z It is the preset total growth time.
3. A device for simulating plant growth, characterized in that: The device for simulating plant growth comprises: A model acquisition module, used to acquire a pre-established plant model, wherein the plant model includes mapping parameters and morphological parameters; The duration statistics module is used to count the real-time growth duration when it is detected that the growth conditions are met; A parameter adjustment module, used for adjusting the mapping parameters of the plant model in real time according to the real-time growth time, the preset total growth time, the preset first mapping color and the preset second mapping color; The parameter adjustment module is also used to adjust the morphological parameters of the plant model in real time according to the real-time growth time, the preset total growth time and the preset magnification; The parameter adjustment module is used to determine the fusion weight according to the real-time growth time and the preset total growth time; the parameter adjustment module is also used to adjust the texture parameters of the plant model in real time according to the fusion weight, the set first texture color and the preset second texture color; the texture parameters, the fusion weight, the preset first texture color and the preset second texture color satisfy the formula: f final =F+(TF)*w; where w is the fusion weight, f final is the adjusted mapping parameter, F is the preset first mapping color, and T is the preset second mapping color; The parameter adjustment module is used to determine the growth rate according to the preset total growth time and the preset magnification; the parameter adjustment module is also used to adjust the morphological parameters of the plant model in real time according to the growth rate and the real-time growth time; wherein the morphological parameters before adjustment, the morphological parameters after adjustment and the growth rate satisfy the formula: m final =m before +k*t; where m final is the adjusted morphological parameter, m before is the morphological parameter before adjustment, k is the growth rate, and t is the real-time growth time.
4. A mobile terminal, characterized in that: The invention comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the method for simulating plant growth according to any one of claims 1 to 2.
5. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for simulating plant growth according to any one of claims 1 to 2 is implemented.
Citation Information
Patent Citations
Simulation method and device for model construction, storage medium, processor and terminal
CN108176052A
Potted plant growth process display method and device, storage medium and equipment
CN109559366A
Animation display method, terminal and computer readable storage medium
CN111324407A
Implementation method and device for dynamic change of virtual scene, medium and electronic equipment
CN111467805A
