Three-dimensional scene switching control method and device, electronic equipment and storage medium

文档序号:87753 发布日期:2021-10-08 浏览:13次 中文

阅读说明:本技术 一种三维场景切换控制方法、装置、电子设备及存储介质 (Three-dimensional scene switching control method and device, electronic equipment and storage medium ) 是由 毛欢欢 姚明珂 刘之海 高璐 吴佳琦 于 2021-06-30 设计创作,主要内容包括:本发明提供了一种三维场景切换控制方法、装置、电子设备以及存储介质,其包括:在三维场景中分别加载至少两个三维模型,所述至少两个三维模型重叠放置;创建与所述至少两个三维模型一一对应的至少两个切割模型;所述至少两个切割模型重合,且所述至少两个切割模型的法线相反,沿所述至少两个切割模型的法线方向,所述至少两个切割模型覆盖所述至少两个三维模型;将所述至少两个切割模型分别与所述至少两个三维模型进行绑定;控制所述至少两个切割模型以预设速度、预设路径沿所述至少两个切割模型的法线方向移动,以实现三维场景切换。本发明提高了三维场景切换的流畅性。(The invention provides a three-dimensional scene switching control method, a three-dimensional scene switching control device, electronic equipment and a storage medium, wherein the three-dimensional scene switching control method comprises the following steps: respectively loading at least two three-dimensional models in a three-dimensional scene, wherein the at least two three-dimensional models are overlapped; creating at least two cutting models in one-to-one correspondence with the at least two three-dimensional models; the at least two cutting models are overlapped, the normals of the at least two cutting models are opposite, and the at least two cutting models cover the at least two three-dimensional models along the normal directions of the at least two cutting models; binding the at least two cutting models with the at least two three-dimensional models respectively; and controlling the at least two cutting models to move along the normal directions of the at least two cutting models at a preset speed and a preset path so as to realize the switching of the three-dimensional scene. The method and the device improve the fluency of three-dimensional scene switching.)

1. A three-dimensional scene switching control method is characterized by comprising the following steps:

respectively loading at least two three-dimensional models in a three-dimensional scene, wherein the at least two three-dimensional models are overlapped;

creating at least two cutting models in one-to-one correspondence with the at least two three-dimensional models; the at least two cutting models are overlapped, the normals of the at least two cutting models are opposite, and the at least two cutting models cover the at least two three-dimensional models along the normal directions of the at least two cutting models;

binding the at least two cutting models with the at least two three-dimensional models respectively;

and controlling the at least two cutting models to move along the normal directions of the at least two cutting models at a preset speed and a preset path so as to realize the switching of the three-dimensional scene.

2. The three-dimensional scene switching control method according to claim 1, wherein a cutting model of the at least two cutting models includes at least one cutting plane.

3. The three-dimensional scene switching control method according to claim 2, wherein the cut surface is a plane or a curved surface.

4. The three-dimensional scene switching control method according to claim 1, wherein the preset speed is a constant speed or a variable speed.

5. The three-dimensional scene switching control method according to claim 1, wherein the preset path is a straight line or a curved line.

6. The three-dimensional scene switching control method according to claim 2, wherein creating at least two cut models in one-to-one correspondence with the at least two three-dimensional models includes:

designing cutting parameters according to requirements, wherein the cutting parameters comprise an initial position of the cutting model, a model boundary and the number of the cutting surfaces;

and creating at least two cutting models corresponding to the at least two three-dimensional models one by one according to the initial positions of the cutting models, the model boundaries and the number of the cutting surfaces.

7. The three-dimensional scene switching control method according to claim 1, wherein the at least two three-dimensional models include a first three-dimensional model and a second three-dimensional model; after the loading of the at least two three-dimensional models in the three-dimensional scene respectively, the method further comprises:

setting the first three-dimensional model as a visible model and the second three-dimensional model as an invisible model;

after the binding the at least two cutting models with the at least two three-dimensional models, respectively, further comprising:

setting the second three-dimensional model as a visible model.

8. A three-dimensional scene change control device, comprising:

the loading unit is used for respectively loading at least two three-dimensional models in a three-dimensional scene, and the at least two three-dimensional models are overlapped;

a cutting model creating unit for creating at least two cutting models corresponding to the at least two three-dimensional models one to one; the at least two cutting models are overlapped, the normals of the at least two cutting models are opposite, and the at least two cutting models cover the at least two three-dimensional models along the normal directions of the at least two cutting models;

the binding unit is used for binding the at least two cutting models with the at least two three-dimensional models respectively;

and the scene switching unit is used for controlling the at least two cutting models to move along the normal directions of the at least two cutting models at a preset speed and a preset path so as to realize three-dimensional scene switching.

9. An electronic device comprising a memory and a processor, wherein,

the memory is used for storing programs;

the processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps in the three-dimensional scene switching control method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer-readable program or instructions, which when executed by a processor, is capable of implementing the steps of the three-dimensional scene switching control method according to any one of claims 1 to 7.

Technical Field

The invention relates to the technical field of three-dimensional scene switching, in particular to a three-dimensional scene switching control method and device, electronic equipment and a storage medium.

Background

Compared with the traditional two-dimensional scene display, the three-dimensional scene is in an enhanced display form, and can provide the most visual and accurate visual experience for users. Particularly, the three-dimensional scene display of the building in the park is very important content, but a plurality of building models in the park are shielded or overlapped, and at the moment, the three-dimensional scene switching display of the plurality of building models is an essential link.

In order to realize the switching display of the three-dimensional scene, patent CN112907755A proposes to realize the switching display of the three-dimensional scene by means of page jump; patent CN110876035A proposes that a three-dimensional scene is switched and displayed by means of model update.

However, the two modes have the problems of low loading speed and poor user experience, and when the model is large, the phenomena of obvious display blockage and black screen can be caused, so that three-dimensional scenes can not be smoothly and vividly switched.

Disclosure of Invention

In view of this, it is necessary to provide a three-dimensional scene switching control method, an apparatus, an electronic device, and a storage medium, so as to solve the technical problems in the prior art that a three-dimensional scene switching process is slow in loading speed, and cannot be smoothly and vividly switched.

In order to solve the above technical problem, the present invention provides a three-dimensional scene switching control method, including:

respectively loading at least two three-dimensional models in a three-dimensional scene, wherein the at least two three-dimensional models are overlapped;

creating at least two cutting models in one-to-one correspondence with the at least two three-dimensional models; the at least two cutting models are overlapped, the normals of the at least two cutting models are opposite, and the at least two cutting models cover the at least two three-dimensional models along the normal directions of the at least two cutting models;

binding the at least two cutting models with the at least two three-dimensional models respectively;

and controlling the at least two cutting models to move along the normal directions of the at least two cutting models at a preset speed and a preset path so as to realize the switching of the three-dimensional scene.

In one possible implementation, a cutting model of the at least two cutting models includes at least one cutting face.

In one possible implementation, the cutting surface is a plane or curved surface.

In one possible implementation, the preset speed is a constant speed or a variable speed.

In a possible implementation, the preset path is a straight line or a curved line.

In one possible implementation, creating at least two cutting models in one-to-one correspondence with the at least two three-dimensional models includes:

designing cutting parameters according to requirements, wherein the cutting parameters comprise an initial position of the cutting model, a model boundary and the number of the cutting surfaces;

and creating at least two cutting models corresponding to the at least two three-dimensional models one by one according to the initial positions of the cutting models, the model boundaries and the number of the cutting surfaces.

In one possible implementation, the at least two three-dimensional models include a first three-dimensional model and a second three-dimensional model; after the loading of the at least two three-dimensional models in the three-dimensional scene respectively, the method further comprises:

setting the first three-dimensional model as a visible model and the second three-dimensional model as an invisible model;

after the binding the at least two cutting models with the at least two three-dimensional models, respectively, further comprising:

setting the second three-dimensional model as a visible model.

The present invention also provides a three-dimensional scene switching control device, including:

the loading unit is used for respectively loading at least two three-dimensional models in a three-dimensional scene, and the at least two three-dimensional models are overlapped;

a cutting model creating unit for creating at least two cutting models corresponding to the at least two three-dimensional models one to one; the at least two cutting models are overlapped, the normals of the at least two cutting models are opposite, and the at least two cutting models cover the at least two three-dimensional models along the normal directions of the at least two cutting models;

the binding unit is used for binding the at least two cutting models with the at least two three-dimensional models respectively;

and the scene switching unit is used for controlling the at least two cutting models to move along the normal directions of the at least two cutting models at a preset speed and a preset path so as to realize three-dimensional scene switching.

The present invention also provides an electronic device comprising a memory and a processor, wherein,

the memory is used for storing programs;

the processor is coupled to the memory, and configured to execute the program stored in the memory to implement the steps in the three-dimensional scene switching control method in any one of the above implementations.

The present invention also provides a computer-readable storage medium for storing a computer-readable program or instruction, where the program or instruction, when executed by a processor, can implement the steps in the three-dimensional scene switching control method in any one of the above-mentioned implementation manners.

The beneficial effects of adopting the above embodiment are: the three-dimensional scene switching control method provided by the invention comprises the steps of creating at least two cutting models which correspond to at least two three-dimensional models one by one, setting the at least two cutting models to be superposed, and setting the at least two cutting models to have opposite normals, so that when the at least two cutting models move along the normal directions of the at least two cutting models at a preset speed and a preset path, as the three-dimensional models are visible in the normal directions of the cutting models corresponding to the three-dimensional models, the at least two three-dimensional models can be gradually visible or gradually invisible along with the movement of the at least two cutting models, thereby realizing three-dimensional scene switching, namely: three-dimensional scene switching can be realized through the movement of at least two cutting models, the time consumption of the three-dimensional scene switching is short, and the switching is smoother and more vivid.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic flowchart of a three-dimensional scene switching control method according to an embodiment of the present invention;

FIG. 2 is a schematic structural diagram of an embodiment of a three-dimensional model provided by an embodiment of the invention;

FIG. 3 is a schematic structural diagram of an embodiment of a cutting model provided in an embodiment of the present invention;

fig. 4 is a schematic structural diagram of a cutting surface according to a first embodiment of the present invention;

fig. 5 is a schematic structural diagram of a cutting surface according to a second embodiment of the present invention;

fig. 6 is a schematic structural view of a cutting surface according to a third embodiment of the present invention;

FIG. 7 is a flowchart illustrating an embodiment of S102 according to the present invention;

fig. 8 is a schematic structural diagram of an embodiment of a three-dimensional scene switching control apparatus according to an embodiment of the present invention;

fig. 9 is a schematic structural diagram of an embodiment of an electronic device according to an embodiment of the present invention.

Detailed Description

The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, "a plurality" means two or more unless otherwise specified.

Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase 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. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.

The invention provides a three-dimensional scene switching control method and device, electronic equipment and a storage medium, which are respectively described below.

As shown in fig. 1, a schematic flowchart of an embodiment of a three-dimensional scene switching control method provided in an embodiment of the present invention is shown, where the method includes:

s101, respectively loading at least two three-dimensional models in a three-dimensional scene, wherein the at least two three-dimensional models are overlapped;

s102, creating at least two cutting models which correspond to the at least two three-dimensional models one to one; the at least two cutting models are overlapped, the normals of the at least two cutting models are opposite, and the at least two cutting models cover the at least two three-dimensional models along the normal directions of the at least two cutting models;

s103, binding the at least two cutting models with the at least two three-dimensional models respectively;

and S104, controlling the at least two cutting models to move along the normal directions of the at least two cutting models at a preset speed and a preset path so as to realize three-dimensional scene switching.

The three-dimensional model in the embodiment of the invention can be any one of a building model, a three-dimensional map model or a game model, and the three-dimensional scene switching control method provided by the embodiment of the invention can be used for carrying out three-dimensional scene switching control on any one of the models.

It should be noted that: the number of the cutting models corresponds to the number of the three-dimensional models one by one, and when the three-dimensional models are bound in the S103, only one cutting model and one three-dimensional model need to be bound.

Compared with the prior art, the three-dimensional scene switching control method provided by the embodiment of the invention has the advantages that the at least two cutting models which are in one-to-one correspondence with the at least two three-dimensional models are created, the at least two cutting models are arranged to be overlapped, and the normals of the at least two cutting models are opposite, so that when the at least two cutting models move along the normal directions of the at least two cutting models at a preset speed and a preset path, the at least two three-dimensional models can be gradually visible or gradually invisible along with the movement of the at least two cutting models because the three-dimensional models are visible in the normal directions of the cutting models corresponding to the three-dimensional models, and the three-dimensional scene switching is realized, namely: the three-dimensional scene display can be gradually switched from one three-dimensional model to other three-dimensional models through the movement of at least two cutting models, the time consumption for switching the three-dimensional scene is short, and the switching is smoother and more vivid.

It should be understood that: the number of loaded three-dimensional models can be adjusted according to actual conditions, and is not limited herein. For convenience of explanation, the following embodiments will be described by taking an example in which two three-dimensional models are loaded in a three-dimensional scene.

In one embodiment of the present invention, as shown in fig. 2, first, a first three-dimensional model a and a second three-dimensional model B are loaded in a three-dimensional scene, wherein the first three-dimensional model a and the second three-dimensional model B may be cylinders, cubes or cones in shape, and in some embodiments of the present invention, the first three-dimensional model a is a cube and the second three-dimensional model B is a triangular pyramid.

In an embodiment of the present invention, as shown in fig. 3, after the first three-dimensional model a and the second three-dimensional model B are loaded, a first cutting model a and a second cutting model B corresponding to the first three-dimensional model a and the second three-dimensional model B are respectively created, wherein the first cutting model a and the second cutting model B are completely overlapped, and normals of the first cutting model a and the second cutting model B are opposite.

Further, since the first three-dimensional model a and the second three-dimensional model B are arranged in an overlapping manner, in order to avoid errors or other problems occurring in the three-dimensional scene after the first three-dimensional model a and the second three-dimensional model B are loaded, after S101, the first three-dimensional model a needs to be set as a visible model, and the second three-dimensional model B needs to be set as an invisible model.

Similarly, when a plurality of three-dimensional models are loaded in a three-dimensional scene, one three-dimensional model needs to be set as a visible model, and other models need to be set as invisible models, so as to avoid errors or other problems of the three-dimensional scene.

Similarly, after S103, in order to realize that the at least two three-dimensional models are respectively visible or invisible with the movement of the at least two cutting models, after S102, the second three-dimensional model B should be set as a visible model, avoiding the problem that the second three-dimensional model B is not visible even with the movement of the second cutting model B.

Further, as shown in fig. 4, when the first and second cutting models a and B intersect the first and second three-dimensional models a and B, the first three-dimensional model a is visible in a normal direction of the first cutting model a; the second three-dimensional model B is visible along the normal direction of the second cutting model B.

Further, to increase the variety of three-dimensional scene cuts, in some embodiments of the invention, the first cut model a or the second cut model b comprises at least one cut plane; and the cutting surface is a plane or a curved surface. The cutting surface can be an irregular plane such as a Bessel curve or a torus.

Specifically, as shown in fig. 3 and 4, the first cutting pattern a or the second cutting pattern b is a plane.

As shown in fig. 5, the first cutting pattern a and the second cutting pattern b are a curved surface.

As shown in fig. 6, the first cutting pattern a and the second cutting pattern b are composed of two planes.

Through the arrangement, the animation diversity of three-dimensional scene switching can be increased, the requirements of different customers are met, and the interestingness and the applicability of three-dimensional scene switching are improved.

Further, the preset speed is constant speed or variable speed.

Through the arrangement, the interestingness and the applicability of three-dimensional scene switching can be further improved.

The specific speed value of the preset speed may be adjusted according to actual requirements to obtain an optimal or most required three-dimensional scene switching effect, which is not specifically limited herein.

Further, in order to avoid increasing the area of the cutting surface when the first three-dimensional model a and the second three-dimensional model B have a large difference in depth, which results in the switching of the three-dimensional scene, in some embodiments of the present invention, the preset path is a straight line or a curved line.

The preset path can be a curve, so that the area of a cutting surface can be reduced, and the three-dimensional scene switching fluency can be further improved.

Furthermore, after the three-dimensional scene is switched, the user needs to perform the scene switching again, and in order to avoid re-creating or calling the cutting model, in some embodiments of the present invention, the preset path may be a reciprocating path, that is: the three-dimensional scene switching can be performed for multiple times, and the speed of performing three-dimensional scene switching again is improved.

Further, as shown in fig. 7, S102 includes:

s701, designing cutting parameters according to requirements, wherein the cutting parameters comprise the initial position of a cutting model, the boundary of the cutting model and the number of cutting surfaces;

s702, at least two cutting models corresponding to the at least two three-dimensional models one by one are created according to the initial positions of the cutting models, the model boundaries and the number of cutting surfaces.

In order to better implement the three-dimensional scene switching control method in the embodiment of the present invention, on the basis of the three-dimensional scene switching control method, as shown in fig. 8, correspondingly, an embodiment of the present invention further provides a three-dimensional scene switching control device 800, including:

a loading unit 801, configured to load at least two three-dimensional models in a three-dimensional scene, where the at least two three-dimensional models are placed in an overlapping manner;

a cutting model creating unit 802 for creating at least two cutting models corresponding to at least two three-dimensional models one to one; the at least two cutting models are overlapped, the normals of the at least two cutting models are opposite, and the at least two cutting models cover the at least two three-dimensional models along the normal directions of the at least two cutting models;

a binding unit 803, configured to bind the at least two cutting models with the at least two three-dimensional models, respectively;

and the scene switching unit 804 is configured to control the at least two cutting models to move along normal directions of the at least two cutting models at a preset speed and a preset path, so as to implement three-dimensional scene switching.

Here, it should be noted that: the three-dimensional scene switching control apparatus 800 provided in the foregoing embodiment may implement the technical solutions described in the foregoing embodiments of the three-dimensional scene switching control method, and the specific implementation principles of the modules or units may refer to the corresponding contents in the foregoing embodiments of the method, which are not described herein again.

The three-dimensional scene switching control device 800 provided in real time by the present invention is configured to create at least two cutting models corresponding to at least two three-dimensional models one-to-one by setting the cutting model creation unit 802, and set at least two cutting models to coincide with each other, and normals of at least two cutting models are opposite, so that when at least two cutting models move along normal directions of at least two cutting models at a preset speed and a preset path, since the three-dimensional models are visible in the normal direction of the cutting models corresponding thereto, it is possible to realize that at least two three-dimensional models are respectively gradually visible or gradually invisible with movement of at least two cutting models, thereby realizing three-dimensional scene switching, that is: the three-dimensional scene display can be gradually switched from one three-dimensional model to other three-dimensional models through the movement of at least two cutting models, the time consumption for switching the three-dimensional scene is short, and the switching is smoother and more vivid.

Fig. 9 shows a schematic structural diagram of an electronic device provided in an embodiment of the present invention. As shown in fig. 9, the electronic device 900 includes a memory 901 and a processor 902. The memory 901 may be configured to store, among other things, various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device. The memory 901 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.

The memory 901 is used for storing programs;

the processor 902, coupled to the memory 901, is configured to execute the program stored in the memory 901, so as to:

respectively loading at least two three-dimensional models in a three-dimensional scene, wherein the at least two three-dimensional models are overlapped;

creating at least two cutting models in one-to-one correspondence with the at least two three-dimensional models; the at least two cutting models are overlapped, the normals of the at least two cutting models are opposite, and the at least two cutting models cover the at least two three-dimensional models along the normal directions of the at least two cutting models;

binding the at least two cutting models with the at least two three-dimensional models respectively;

and controlling the at least two cutting models to move along the normal directions of the at least two cutting models at a preset speed and a preset path so as to realize the switching of the three-dimensional scene.

It should be understood that: the processor 902, when executing the program in the memory 901, may also implement other functions in addition to the above functions, which may be referred to in the foregoing description of the corresponding method embodiments.

Further, the type of the electronic device 900 mentioned in the embodiment of the present invention is not particularly limited, and the electronic device 900 may be a portable electronic device such as a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a wearable device, and a laptop computer (laptop). Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices that carry an iOS, android, microsoft, or other operating system. The portable electronic device may also be other portable electronic devices such as laptop computers (laptop) with touch sensitive surfaces (e.g., touch panels), etc. It should also be understood that in other embodiments of the present invention, the electronic device 900 may not be a portable electronic device, but may be a desktop computer having a touch-sensitive surface (e.g., a touch panel).

Accordingly, the present application also provides a computer-readable storage medium, which is used for storing a computer-readable program or instruction, and when the program or instruction is executed by a processor, the program or instruction can implement the method steps or functions provided by the above method embodiments.

Those skilled in the art will appreciate that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program, which is stored in a computer readable storage medium, to instruct related hardware. The computer readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory.

The three-dimensional scene switching control method, the three-dimensional scene switching control device, the electronic device and the storage medium provided by the invention are described in detail, a specific example is applied in the description to explain the principle and the implementation of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于动态画幅的3D点云处理方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!