CN114494635B - Virtual decoration method, device, equipment and storage medium - Google Patents

Virtual decoration method, device, equipment and storage medium Download PDF

Info

Publication number
CN114494635B
CN114494635B CN202111630393.0A CN202111630393A CN114494635B CN 114494635 B CN114494635 B CN 114494635B CN 202111630393 A CN202111630393 A CN 202111630393A CN 114494635 B CN114494635 B CN 114494635B
Authority
CN
China
Prior art keywords
object model
position information
decoration object
decoration
coordinate system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111630393.0A
Other languages
Chinese (zh)
Other versions
CN114494635A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chengshi Wanglin Information Technology Co Ltd
Original Assignee
Beijing Chengshi Wanglin Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Chengshi Wanglin Information Technology Co Ltd filed Critical Beijing Chengshi Wanglin Information Technology Co Ltd
Priority to CN202111630393.0A priority Critical patent/CN114494635B/en
Publication of CN114494635A publication Critical patent/CN114494635A/en
Application granted granted Critical
Publication of CN114494635B publication Critical patent/CN114494635B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/10Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/006Mixed reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/04Architectural design, interior design

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Architecture (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application provides a virtual decoration method, device, equipment and storage medium. In the embodiment of the application, the decoration object model can rotate around the rotation center, so that the effect that the decoration object model rotates around the specified rotation axis is achieved, the flexible adjustment of the rotation axis for adjusting the decoration object model is realized, the flexibility of the setting of the rotation axis in virtual decoration is improved, and the experience of a user for the virtual decoration is improved.

Description

Virtual decoration method, device, equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a virtual decoration method, apparatus, device, and storage medium.
Background
With the development of Virtual Reality (VR) technology, the technology is widely applied to various applications (such as APP). Such as interior decoration, house property development, online shopping, etc.
In an indoor decoration scene, the furniture can be modeled to obtain a virtual furniture model. However, the virtual furniture model rotates around the geometric center of the model as the rotation center, resulting in poor user experience. For example, in the case of a door, the door in the real world rotates around a door axis as a rotation axis, and a door model rotates around a geometric center of the model as a rotation center, so that the door model cannot simulate the rotation of a real door. For example, in the case of furniture, a user wants to observe a decoration effect by rotating a furniture model around a certain line of the furniture model as a rotation axis, but the furniture model cannot satisfy the observation requirement of the user by rotating around a geometric center thereof as a rotation center.
Disclosure of Invention
Aspects of the present application provide a virtual decoration method, apparatus, device, and storage medium for flexibly adjusting a rotation axis of a decoration object model, which is helpful for improving user experience.
The embodiment of the application provides a virtual decoration method, which comprises the following steps:
acquiring a central point of a decoration object model and a specified rotating shaft which is set by taking the decoration object model as a reference object;
determining the relative position relation between the specified rotating shaft and the central point of the decoration object model;
determining the position information of the specified rotating shaft in a set coordinate system according to the position information of the central point in the set coordinate system and the relative position relation;
adjusting the rotation center of the decoration object model according to the position information of the specified rotation axis in the set coordinate system and the position information of the central point in the set coordinate system;
and rotating the decoration object model according to the adjusted rotation center so that the decoration object model rotates around a specified rotation axis in the decoration space model.
The embodiment of the present application further provides a virtual decoration device, include:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a central point of a decoration object model and a specified rotating shaft which is arranged by taking the decoration object model as a reference object;
the first determination module is used for determining the relative position relationship between the specified rotating shaft and the central point of the decoration object model;
the second determining module is used for determining the position information of the specified rotating shaft in a set coordinate system according to the position information of the central point in the set coordinate system and the relative position relation;
the adjusting module is used for adjusting the rotating center of the decoration object model according to the position information of the specified rotating shaft in the set coordinate system and the position information of the central point in the set coordinate system;
and the rotating module is used for rotating the decoration object model according to the adjusted rotating center so as to enable the decoration object model to rotate around the specified rotating shaft in the decoration space model.
An embodiment of the present application further provides an electronic device, including: a memory and a processor; wherein the memory is used for storing a computer program;
the processor is coupled to the memory for executing the computer program for performing the steps in the above-described virtual decoration method.
Embodiments of the present application further provide a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the above-mentioned virtual decoration method.
In the embodiment of the application, the decoration object model can rotate around the rotation center, so that the effect that the decoration object model rotates around the specified rotation axis is achieved, the flexible adjustment of the rotation axis for adjusting the decoration object model is realized, the flexibility of the setting of the rotation axis in virtual decoration is improved, and the experience of a user for the virtual decoration is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flow chart of a virtual decoration method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating adjustment of a center of rotation of a decoration object model according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a virtual decoration device according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
In a virtual decoration scene, a virtual furniture model rotates by taking a geometric center of the model as a rotation center, so that the user experience is poor. To solve the technical problem, an embodiment of the present application provides a solution, and the basic idea is: the decoration object model rotates around the rotation center, the effect that the decoration object model rotates around the appointed rotation axis is achieved, the flexible adjustment of the rotation axis of the adjustment decoration object model is achieved, the flexibility of the rotation axis setting in the virtual decoration is improved, and the experience of a user for the virtual decoration is improved.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
It should be noted that: like reference numerals refer to like objects in the following figures and embodiments, and thus, once an object is defined in one figure or embodiment, further discussion thereof is not required in subsequent figures and embodiments.
Fig. 1 is a schematic flow chart of a virtual decoration method provided in an embodiment of the present application. As shown in fig. 1, the virtual decoration method includes:
101. acquiring a central point of the decoration object model and a specified rotating shaft which is set by taking the decoration object model as a reference object.
102. The relative positional relationship of the specified rotation axis and the center point of the decoration object model is determined.
103. And determining the position information of the specified rotating shaft in the set coordinate system according to the position information and the relative position relation of the central point in the set coordinate system.
104. And adjusting the rotation center of the decoration object model according to the position information of the specified rotation axis in the set coordinate system and the position information of the center point in the set coordinate system.
105. And rotating the decoration object model according to the adjusted rotation center so that the decoration object model rotates around the specified rotation axis in the decoration space model.
In the present embodiment, the decoration object model is a model of a decoration object in a target space to be decorated. The home decoration object can be furniture such as a cabinet, a table and a chair, a sofa and the like, infrastructure such as a door and the like, or decorations such as wall paintings, potted plants and the like. In the embodiment of the application, for the home decoration object, a three-dimensional model of the home decoration object, that is, a decoration object model, may be constructed. The decoration object model can be placed at a proper position in the three-dimensional model of the target space so as to simulate the decoration effect of the corresponding decoration object in the target space.
In the embodiments of the present application, a specific implementation of building a three-dimensional model of a home decoration object is not limited. Alternatively, a three-dimensional model of the home decoration object, i.e., a virtual three-dimensional model, may be obtained as the decoration object model by a three-dimensional reconstruction technique such as automatic modeling. Alternatively, the home decoration object may be photographed by a panoramic camera to obtain complete panoramic data of the home decoration object. And in the later stage, a three-dimensional model of the home decoration object is obtained through three-dimensional reconstruction technologies such as automatic modeling and the like, and the panoramic data is mapped onto the three-dimensional model of the home decoration object to obtain a real three-dimensional model of the home decoration object as a decoration object model.
The target space to be decorated can be the physical space of a house, a venue, a factory workshop and the like to be decorated. In the embodiment of the application, a three-dimensional model of the target space, namely a decoration space model, can be constructed. For a specific embodiment of constructing the decoration space model of the target space, reference may be made to the above-mentioned related contents of constructing the decoration object model, and details are not described herein again.
In some application scenarios, for a user simulating decoration, the decoration object model needs to be rotated to view decoration effects at a certain angle, which requires providing the function of rotating the decoration object model. In the prior art, the decoration object model is generally rotated by taking a central point as a rotation center, but the rotation mode is poor in flexibility. The central point of the decoration object model is the geometric center of the decoration object model.
In some embodiments, for some home-mounted objects, it is not practical to rotate around the center point of the home-mounted object as the center of rotation. For example, in the case of a door, the door rotates around a door axis as a rotation axis in a real physical space. For the object model of the door, the center point of the door model is used as the rotation center for performing the center rotation, so that the door model cannot simulate the rotation of the real door. For example, in the case of furniture, a user wants to observe a decoration effect by rotating a furniture model around a certain line of the furniture model as a rotation axis, but the furniture model cannot satisfy the observation requirement of the user by rotating around a geometric center thereof as a rotation center.
In the embodiment of the present application, in order to improve the flexibility of rotating the decoration object model, in step 101, a central point of the decoration object model and a designated rotation axis set with the decoration object model as a reference may be obtained.
The designated rotation axis may be an actual rotation axis of the home decoration object corresponding to the decoration object model. For example, for a door model, the specified axis of rotation may be a left door axis or a right door axis of the door model, or the like. Alternatively, the specified rotation axis may be an axis set with the decoration object model as a reference. For example, for a model table, the designated axis of rotation may be a leg or side of the table, or any line on the table, etc. Of course, the specified rotation axis may or may not be located on the decoration object model. For example, for a door model, the designated axis of rotation may be the left door axis of the door model, and so on. For the mural model, the designated rotation axis may be any straight line on the mural model, or may be a straight line having a set distance from a certain straight line on the mural model, or the like. For example, a wall corner line 1 meter to the left of the mural model, etc.
In the embodiments of the present application, a specific embodiment of obtaining a specified rotation axis set with the decoration object model as a reference is not limited. In some embodiments, the rotation axis of the decoration object model may be set in advance; and stores the correspondence between the identification of the modified object model and the rotation axis. Accordingly, the rotation axis corresponding to the identification of the device object model can be acquired as the specified rotation axis based on the correspondence between the identification of the decoration object model and the rotation axis. In other embodiments, a graphical user interface may be provided with a pivot axis setting control through which a user may set a specified pivot axis. For the electronic equipment executing the virtual decoration method, responding to the operation of the rotating shaft setting control, and acquiring the rotating shaft set by the operation as a specified rotating shaft; and so on.
Wherein the designated rotation axis may be implemented in the form of description information described with the decoration object model as a reference. E.g. the left door spindle of the door, the right edge of the table, etc.
Of course, the embodiment of the present application also does not limit the specific implementation manner of obtaining the center point of the decoration object model. For an electronic device that performs a virtual decoration method, a correlation between an identification of a decoration object model and a central point may be set in advance. Accordingly, the center point of the decoration object model may be acquired based on the correspondence between the identification of the decoration object model and the center point. Alternatively, the center point of the decoration object model may be acquired from a device that constructs the decoration object model. The equipment for constructing the decoration object model can automatically acquire the central point of the model in the process of constructing the model.
Since the center point of the decoration object model and the designated rotation axis are provided with the decoration object model as a reference, in step 102, the relative positional relationship between the designated rotation axis and the center point of the decoration object model can be determined. Alternatively, the relative positional relationship between the specified rotation axis and the center point of the decoration object model may be determined based on the center point of the decoration object model and the relative positional relationship of the specified rotation axis in the decoration object model.
Specifically, the size description information of the decoration object model can be acquired. The size of the decoration object model and the size of the actual decoration object can be reduced in equal proportion according to a certain scale. For example, the scale of the decoration object model to the actual decoration object is 1: the height is 2.4m, the width is 1.6m, the thickness is 5cm, and the corresponding dimension description information of the decoration object model can be as follows: height of 2.4cm, width of 1.6cm, thickness of 0.05cm, etc. Of course, in the embodiment of the present invention, the actual size of the decoration object may also be used as the size description information of the model, or the size description information of each decoration object model may be represented by any other available information representing the real-time size of the model in the model, which is not limited in the embodiment of the present invention. For example, in consideration of the fact that the three-dimensional model of the target space may be scaled, the real-time size of the decoration object model relative to the three-dimensional model of the target space may be used as the size description information when the decoration object model is displayed in the three-dimensional model of the target space.
Further, the relative position relationship between the center point of the decoration object model and the specified rotation axis in the decoration object model can be determined according to the size description information of the decoration object model. Further, a relative positional relationship of the center point of the decoration object model and the specified rotation axis in the decoration object model may be determined, in order to determine the relative positional relationship between the specified rotation axis and the center point. The relative position relation between the rotating shaft and the center point of the decoration object model is specified, and the center point of the decoration object model can be used as a reference object for description. The distance information in the relative position relation described by taking the central point of the decoration object model as a reference object is the distance information presented in the decoration space model, and the distance information has a certain scale with the real distance of the real world. For example, specifying the relative positional relationship between the axis of rotation and the center point of the decoration object model can be described as: the specified axis of rotation is 1cm to the left of the center point of the decoration object model, and so on. Wherein, 1cm is the distance displayed in the decoration space model, and has a certain scale with the real distance of the real world.
For the door model, assuming that the rotation axis is designated as the left door axis of the door model, the dimension description information of the door model is: the height is 2.4cm, the width is 1.6cm, and the thickness is 0.05cm. Accordingly, according to the size description information of the decoration object model, the relative position relationship of the central point of the door model and the specified rotation axis in the decoration object model can be determined as follows: the rotation axis is specified at 0.8cm left from the center point of the decoration object model, and so on.
After the relative position relationship between the designated rotation axis and the center point of the decoration object model is determined, in step 103, the position information of the designated rotation axis in the set coordinate system can be determined according to the position information and the relative position relationship of the center point in the set coordinate system.
In the embodiment of the present application, the set coordinate system may be any coordinate system. Alternatively, the set coordinate system may be a coordinate system established in a decoration space model corresponding to the target space to be decorated, such as a world coordinate system. Accordingly, a world coordinate system may be established in the decoration space model as the set coordinate system.
Furthermore, the center point of the decoration object model can be projected into the set coordinate system, and the position information of the center point in the set coordinate system is obtained. Optionally, for the world coordinate system established in the decoration space model, the central point of the decoration object model may be projected onto the corresponding position of the world coordinate system according to the setting position of the decoration object model in actual decoration, so as to obtain the position information of the central point in the world coordinate system.
Further, the position information of the designated rotating shaft in the set coordinate system can be determined according to the position information of the central point in the set coordinate system and the relative position relationship between the designated rotating shaft and the central point. The positional information of the designated rotation axis in the set coordinate system can be described in an intersecting manner. For example, the z-axis and the like can be represented by two planes of x =0, y = 0.
Since the decoration object model performs center rotation around the rotation center, the rotation center of the decoration object model before adjustment can be the center point of the decoration object model, and therefore, if the decoration object model is to be rotated around the specified rotation axis, the rotation center of the decoration object model needs to be adjusted to be on the straight line of the specified rotation axis. Thus, the decoration object model can rotate around the appointed rotation axis only when rotating around the adjusted rotation center. Based on this, in the embodiment of the present application, in order to achieve the effect of performing the axial rotation of the decoration object model around the specified rotation axis, in step 104, the rotation center of the decoration object model may be adjusted according to the position information of the specified rotation axis in the set coordinate system and the position information of the center point in the set coordinate system.
In the embodiment of the present application, a specific embodiment of adjusting the rotation center of the decoration object is not limited. Alternatively, a translation (translate) method in geometry may be employed to adjust the rotation center of the decoration object model according to the position information of the specified rotation axis in the set coordinate system and the position information of the center point in the set coordinate system. Specifically, the translation scale of the rotation center of the decoration object model may be determined based on the position information of the specified rotation axis in the set coordinate system and the position information of the center point in the set coordinate system. The translation scale of the rotation center of the decoration object model can be vector information. For example, the translation vector may represent a translation scale of a center of rotation of the decoration object model, or the like.
Alternatively, as shown in fig. 2, the vertical plane S of the specified rotation axis L may be determined in the set coordinate system according to the position information of the specified rotation axis L in the set coordinate system. The vertical plane of the designated rotation axis refers to a plane perpendicular to the designated rotation axis. Further, the projection position information of the designated rotation axis L and the center point a on the vertical plane may be determined based on the position information of the designated rotation axis in the set coordinate system and the position information of the center point a of the decoration object model in the set coordinate system, respectively. Shown as points L1 and A1, respectively, in fig. 2. Further, the translation scale of the rotation center of the decoration object model on the vertical plane can be determined according to the projection position information L1 and A1 of the designated rotation axis L and the center point a on the vertical plane, respectively.
Regarding the designated rotation axis L shown in fig. 2, the positional information of the center point a of the decoration object model in the set coordinate system is assumed to be (x 0, y0, z 0), and the designated rotation axis L is parallel to the y axis of the set coordinate system. Accordingly, the vertical plane of the rotation axis L is designated as the vertical plane S of the y-axis, i.e., the plane denoted by y = 0. Further, it is determined that the projection position information L1 of the specified rotation axis L on the vertical plane S is (x 1, z 1); the projection position information A1 of the center point a on the vertical plane S is (x 0, z 0). Further, the translation scale of the rotation center of the decoration object model on the vertical plane can be determined to be (x 0-x1, z0-z 1). Fig. 2 is an exemplary illustration only of the designated rotation axis being parallel to the y-axis of the set coordinate system, but is not limited thereto.
After determining the translation scale of the center of rotation of the decoration object model, the center of rotation of the decoration object model may be adjusted according to the translation scale. The center of rotation of the decoration object model before adjustment can be the center point of the decoration object model.
Specifically, the rotation center before the decoration object model is adjusted may be translated by the translation scale to obtain the adjusted rotation center.
For the embodiment of determining the translation scale of the rotation center of the decoration object model on the vertical plane, the translation scale can be translated on the vertical plane according to the projection position information of the rotation center before adjustment on the vertical plane to obtain the translated projection position information; and determines any one of target points (defined as a first target point) on a target straight line passing through the target position and perpendicular to the vertical plane S as an adjusted rotation center. The target position is a position corresponding to the translated projection position information, and the first target point is any point on the target straight line. In the embodiment of the present application, the first target point may be any point of the target straight line on the line segment in the decoration space model, or the first target point may be any point of the target straight line on the line segment of the decoration object model.
For example, in the case shown in fig. 2, the projection position information (x 0, z 0) on the vertical plane S of the rotation center (x 0, y0, z 0) before adjustment may be translated by the translation scale (x 0-x1, z0-z 1) on the vertical plane to obtain the projection position information (x 1, z 1) after translation. Correspondingly, the target position is a position L1 corresponding to the translated projection position information (x 1, z 1); the target straight line is a straight line passing through the target position L1, i.e., a straight line on which the specified rotation axis L is located. Further, it is determined that any point on the straight line on which the designated rotation axis L is located is the adjusted rotation center (x 1, yn, z 1).
In other embodiments, the foot of the central point on the designated rotating shaft can be determined in the set coordinate system according to the position information of the designated rotating shaft in the set coordinate system and the position information of the central point in the set coordinate system; and determining a translation vector from the central point to the plumb foot according to the position information of the plumb foot in the set coordinate system and the position information of the central point in the set coordinate system. And then, adjusting the rotation center of the decoration object model according to the translation vector from the central point to the foot. Specifically, the rotation center before the decoration object model is adjusted may be moved by the translation vector to obtain the adjusted rotation center.
The embodiment of adjusting the rotation center of the decoration object model shown in the above embodiment is merely an example and is not limited thereto.
After the adjusted rotation center is determined, the decoration object model may be rotated according to the adjusted rotation center in step 105, so that the decoration object model is rotated around the designated rotation axis in the decoration space model.
In the present embodiment, for an embodiment in which the specified rotation axis is located at the decoration object model, in order to rotate the decoration object model around the specified rotation axis in the decoration space model, the decoration object model may be rotated around the adjusted rotation center in the target rotation direction with respect to any target point (defined as a second target point) on the decoration object model except for the specified rotation axis. Wherein the target rotation direction is a rotation direction in which a rotation trajectory plane of the second target point can be made perpendicular to the specified rotation axis. The rotation trajectory plane of the second target point refers to a plane formed by a trajectory of the second target point rotating around the adjusted rotation center. Since the target rotation direction is a rotation direction in which the rotation trajectory plane of the second target point is perpendicular to the specified rotation axis, and the adjusted rotation center is located on the specified rotation axis, the decoration object model can be rotated around the adjusted rotation center in the target rotation direction, and the decoration object model can be rotated around the specified rotation axis.
For example, for the decoration object model shown in fig. 2, the target rotation direction for any point M on the decoration object model except for the specified rotation axis L1 is: the rotation direction of the rotation locus plane of the point M perpendicular to the predetermined rotation axis, that is, the rotation direction around the predetermined rotation axis L1 axis can be set. Further, the decoration object model may be rotated around the adjusted rotation center O1 (x 1, yn, z 1) in the target rotation direction. Since the adjusted rotation center O1 (x 1, yn, z 1) is located on the designated rotation axis L1, and the target rotation direction is: the trajectory plane can be rotated in the direction perpendicular to the specified rotation axis L1 at any point M on the decoration object model except the specified rotation axis L1, and therefore, for the decoration object model, the decoration object model is rotated around the adjusted rotation center O1 (x 1, yn, z 1) in the target rotation direction, and the effect of rotating the decoration object model around the specified rotation axis L1 can be achieved.
In this embodiment, the decoration object model can rotate around the rotation center through the decoration object model, so that the decoration object model can rotate around the designated rotation axis, the flexible adjustment of the rotation axis of the decoration object model is realized, the flexibility of the setting of the rotation axis in the virtual decoration is improved, and the experience of a user on the virtual decoration is improved.
It should be noted that the execution subjects of the steps of the methods provided in the above embodiments may be the same device, or different devices may be used as the execution subjects of the methods. For example, the execution subject of steps 101 and 102 may be device a; for another example, the execution subject of step 101 may be device a, and the execution subject of step 102 may be device B; and so on.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 101, 102, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel.
Accordingly, embodiments of the present application also provide a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the above-mentioned virtual decoration method.
Fig. 3 is a schematic structural diagram of a virtual decoration device according to an embodiment of the present application. As shown in fig. 3, the virtual decoration device includes: an acquisition module 30a, a first determination module 30b, a second determination module 30c, an adjustment module 30d, and a rotation module 30e.
The obtaining module 30a is used for obtaining the center point of the decoration object model and the specified rotation axis set by taking the decoration object model as a reference object.
The first determining module 30b is used for determining the relative position relationship between the specified rotation axis and the central point of the decoration object model.
And the second determining module 30c is used for determining the position information of the specified rotating shaft in the set coordinate system according to the position information and the relative position relation of the central point in the set coordinate system.
The adjusting module 30d adjusts the rotation center of the decoration object model based on the position information of the designated rotation axis in the set coordinate system and the position information of the center point in the set coordinate system.
And a rotating module 30e for rotating the decoration object model according to the adjusted rotation center so that the decoration object model rotates around the specified rotation axis in the decoration space model.
In some embodiments, the adjusting module 30d, when adjusting the rotation center of the decoration object model, is specifically configured to: determining the translation scale of the rotation center of the decoration object model according to the position information of the specified rotation axis in the set coordinate system and the position information of the center point in the set coordinate system; adjusting the rotation center of the decoration object model according to the translation scale; wherein, the rotation center before the decoration object model is adjusted is the central point.
Optionally, the adjusting module 30d, when determining the translation scale of the rotation center of the decoration object model, is specifically configured to: determining a vertical plane of the designated rotating shaft in the set coordinate system according to the position information of the designated rotating shaft in the set coordinate system; respectively determining the projection position information of the designated rotating shaft and the central point on the vertical plane according to the position information of the designated rotating shaft in the set coordinate system and the position information of the central point in the set coordinate system; and determining the translation scale of the rotation center of the decoration object model on the vertical plane according to the projection position information of the specified rotation axis and the center point on the vertical plane respectively.
Optionally, the adjusting module 30d is specifically configured to, when adjusting the rotation center of the decoration object model: translating the translation scale on the vertical plane according to the projection position information of the rotation center on the vertical plane before adjustment to obtain the translated projection position information; determining a first target point on a target straight line which passes through the target position and is vertical to the vertical plane as an adjusted rotation center; the target position is a position corresponding to the translated projection position information, and the first target point is any point on the target straight line.
Alternatively, the specified rotation axis is located on the decoration object model. The rotating module 30e is specifically configured to, when rotating the decoration object model: rotating the decoration object model around the adjusted rotation center according to the target rotation direction aiming at a second target point on the decoration object model, so that the decoration object model rotates around the appointed rotation axis in the decoration space model; the second target point is any point on the decoration object model except for the specified rotating shaft; the target rotation direction is a rotation direction in which the rotation trajectory plane of the second target point is perpendicular to the specified rotation axis.
In other embodiments, the processor 30b, when determining the relative position relationship between the designated rotation axis and the center point of the decoration object model, is specifically configured to: and determining the relative position relation between the specified rotating shaft and the central point according to the relative position relation between the central point of the decoration object model and the specified rotating shaft in the decoration object model.
Optionally, the virtual decoration device further includes: a building block 30f. The establishing module 30f is configured to: before determining the position information of the specified rotation axis in the set coordinate system, a world coordinate system is established in the decoration space model as the set coordinate system.
The virtual decoration device that this embodiment provided, accessible decoration object model is rotatory around the rotation center, reaches decoration object model and around the rotatory effect of appointed rotation axis, has realized the nimble adjustment to the rotation axis of adjustment decoration object model, helps improving the flexibility that the rotation axis set up in the virtual decoration, and then helps improving the experience of user to the virtual decoration.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 4, the electronic device may include: a memory 40a and a processor 40b; the memory 40a is used for storing computer programs.
The processor 40b is coupled to the memory 40a for executing a computer program for: acquiring a central point of the decoration object model and a specified rotating shaft which is set by taking the decoration object model as a reference object; determining the relative position relation between the appointed rotating shaft and the central point of the decoration object model; determining the position information of the appointed rotating shaft in the set coordinate system according to the position information and the relative position relation of the central point in the set coordinate system; adjusting the rotation center of the decoration object model according to the position information of the specified rotation axis in the set coordinate system and the position information of the center point in the set coordinate system; and rotating the decoration object model according to the adjusted rotation center so that the decoration object model rotates around the specified rotation axis in the decoration space model.
In some embodiments, the processor 40b, when adjusting the center of rotation of the decoration object model, is specifically configured to: determining the translation scale of the rotation center of the decoration object model according to the position information of the specified rotation axis in the set coordinate system and the position information of the center point in the set coordinate system; adjusting the rotation center of the decoration object model according to the translation scale; wherein, the rotation center before the decoration object model is adjusted is the central point.
Optionally, the processor 40b, when determining the translation scale of the rotation center of the decoration object model, is specifically configured to: determining a vertical plane of the designated rotating shaft in the set coordinate system according to the position information of the designated rotating shaft in the set coordinate system; respectively determining the projection position information of the designated rotating shaft and the central point on the vertical plane according to the position information of the designated rotating shaft in the set coordinate system and the position information of the central point in the set coordinate system; and determining the translation scale of the rotation center of the decoration object model on the vertical plane according to the projection position information of the specified rotation axis and the center point on the vertical plane respectively.
Optionally, the processor 40b is specifically configured to, when adjusting the rotation center of the decoration object model: translating the translation scale on the vertical plane according to the projection position information of the rotation center before adjustment on the vertical plane to obtain the translated projection position information; and the first target point which passes through the target position and is on the target straight line vertical to the vertical plane is the adjusted rotation center, the target position is the corresponding position of the translated projection position information, and the first target point is any point on the target straight line.
In other embodiments, the designated axis of rotation is located on the furnishing object model. The processor 40b, when rotating the decoration object model according to the adjusted rotation center, is specifically configured to: rotating the decoration object model around the adjusted rotation center according to the target rotation direction aiming at a second target point on the decoration object model, so that the decoration object model rotates around the appointed rotation axis in the decoration space model; the second target point is any point on the decoration object model except for the specified rotating shaft; the target rotation direction is a rotation direction in which the rotation trajectory plane of the second target point is perpendicular to the specified rotation axis.
Optionally, the processor 40b, when determining the relative position relationship between the designated rotation axis and the center point of the decoration object model, is specifically configured to: and determining the relative position relation between the specified rotating shaft and the central point according to the relative position relation between the central point of the decoration object model and the specified rotating shaft in the decoration object model.
Optionally, the processor 40b is further configured to: before determining the position information of the specified rotation axis in the set coordinate system, a world coordinate system is established in the decoration space model as the set coordinate system.
In some optional embodiments, as shown in fig. 4, the electronic device may further include: communication component 40c, power component 40d, display component 40e, and audio component 40 f. Only some of the components are schematically shown in fig. 4, and it is not meant that the electronic device must include all of the components shown in fig. 4, nor that the electronic device can include only the components shown in fig. 4.
The electronic equipment that this embodiment provided, accessible fitment object model is rotatory around the center of rotation, reaches the effect that fitment object model is rotatory around appointed rotation axis, has realized the nimble adjustment to the rotation axis of adjustment fitment object model, helps improving the flexibility that the rotation axis set up in the virtual fitment, and then helps improving the experience of user to the virtual fitment.
In embodiments of the present application, the memory is used to store computer programs and may be configured to store other various data to support operations on the device on which it is located. Wherein the processor may execute a computer program stored in the memory to implement the corresponding control logic. The memory may be implemented by any type or combination of volatile and 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.
In the embodiments of the present application, the processor may be any hardware processing device that can execute the above described method logic. Alternatively, the processor may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), or a Micro Controller Unit (MCU); programmable devices such as Field-Programmable Gate arrays (FPGAs), programmable Array Logic devices (PALs), general Array Logic devices (GAL), complex Programmable Logic Devices (CPLDs), etc. may also be used; or Advanced Reduced Instruction Set Computer (RISC) processors (ARM) or System On Chip (SOC), etc., but is not limited thereto.
In embodiments of the present application, the communication component is configured to facilitate wired or wireless communication between the device in which it is located and other devices. The device where the communication component is located can access a wireless network based on communication standards, such as WiFi,2G or 3G,4G,5G or a combination of the WiFi, the 2G or the 3G, the 4G and the 5G. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may also be implemented based on Near Field Communication (NFC) technology, radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, or other technologies.
In the embodiment of the present application, the display assembly may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the display assembly includes a touch panel, the display assembly may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
In embodiments of the present application, a power supply component is configured to provide power to various components of the device in which it is located. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device in which the power component is located.
In embodiments of the present application, the audio component may be configured to output and/or input audio signals. For example, the audio component includes a Microphone (MIC) configured to receive an external audio signal when the device in which the audio component is located is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in a memory or transmitted via a communication component. In some embodiments, the audio assembly further comprises a speaker for outputting audio signals. For example, for devices with language interaction functionality, voice interaction with a user may be enabled through an audio component, and so forth.
It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
The storage medium of the computer is a readable storage medium, which may also be referred to as a readable medium. Readable storage media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer 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 disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (7)

1. A virtual decoration method is characterized by comprising the following steps:
acquiring a central point of a decoration object model and a specified rotating shaft which is set by taking the decoration object model as a reference object;
determining the relative position relation between the specified rotating shaft and the central point of the decoration object model;
determining the position information of the specified rotating shaft in a set coordinate system according to the position information of the central point in the set coordinate system and the relative position relation;
adjusting the rotation center of the decoration object model according to the position information of the specified rotation axis in the set coordinate system and the position information of the central point in the set coordinate system;
rotating the decoration object model according to the adjusted rotation center so that the decoration object model rotates around a specified rotation axis in the decoration space model;
wherein the adjusting the rotation center of the decoration object model according to the position information of the designated rotation axis in the set coordinate system and the position information of the center point in the set coordinate system comprises:
determining a vertical plane of the designated rotating shaft in the set coordinate system according to the position information of the designated rotating shaft in the set coordinate system; wherein, the rotation center before the decoration object model is adjusted is the central point;
according to the position information of the specified rotating shaft in the set coordinate system and the position information of the central point in the set coordinate system, respectively determining the projection position information of the specified rotating shaft and the projection position information of the central point in the vertical plane;
determining the translation scale of the rotation center of the decoration object model on the vertical plane according to the projection position information of the specified rotation axis and the central point on the vertical plane respectively;
translating the translation scale on the vertical plane according to the projection position information of the rotation center before adjustment on the vertical plane to obtain the translated projection position information;
and determining a first target point which passes through a target position and is on a target straight line perpendicular to the vertical plane as the adjusted rotation center, wherein the target position is a position corresponding to the translated projection position information, and the first target point is any point on the target straight line.
2. The method of claim 1, wherein the specified axis of rotation is located on the furnishing object model; the rotating the decoration object model according to the adjusted rotation center includes:
rotating the decoration object model around the adjusted rotation center according to a target rotation direction aiming at a second target point on the decoration object model, so that the decoration object model rotates around a specified rotation axis in the decoration space model;
the second target point is any point on the decoration object model except the designated rotating shaft; the target rotation direction is a rotation direction in which a rotation trajectory plane of the second target point is perpendicular to the designated rotation axis.
3. The method of claim 1, wherein the determining the relative position relationship of the specified rotation axis to the center point of the decoration object model comprises:
and determining the relative position relation between the appointed rotating shaft and the central point according to the central point of the decoration object model and the relative position relation of the appointed rotating shaft in the decoration object model.
4. The method according to any one of claims 1 to 3, further comprising, before determining the position information of the specified rotation axis in the set coordinate system based on the position information of the center point in the set coordinate system and the relative positional relationship,:
and establishing a world coordinate system in the decoration space model as the set coordinate system.
5. A virtual decoration apparatus, comprising:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a central point of a decoration object model and a specified rotating shaft which is arranged by taking the decoration object model as a reference object;
the first determination module is used for determining the relative position relationship between the specified rotating shaft and the central point of the decoration object model;
the second determining module is used for determining the position information of the specified rotating shaft in a set coordinate system according to the position information of the central point in the set coordinate system and the relative position relation;
the adjusting module is used for adjusting the rotating center of the decoration object model according to the position information of the specified rotating shaft in the set coordinate system and the position information of the central point in the set coordinate system;
the rotating module is used for rotating the decoration object model according to the adjusted rotating center so as to enable the decoration object model to rotate around a specified rotating shaft in the decoration space model;
the adjusting module is specifically configured to: determining a vertical plane of the designated rotating shaft in the set coordinate system according to the position information of the designated rotating shaft in the set coordinate system; wherein, the rotation center before the decoration object model is adjusted is the central point;
according to the position information of the specified rotating shaft in the set coordinate system and the position information of the central point in the set coordinate system, respectively determining the projection position information of the specified rotating shaft and the projection position information of the central point in the vertical plane;
determining the translation scale of the rotation center of the decoration object model on the vertical plane according to the projection position information of the specified rotation axis and the central point on the vertical plane respectively;
translating the translation scale on the vertical plane according to the projection position information of the rotation center before adjustment on the vertical plane to obtain the translated projection position information;
and determining a first target point which passes through a target position and is on a target straight line perpendicular to the vertical plane as the adjusted rotation center, wherein the target position is a position corresponding to the translated projection position information, and the first target point is any point on the target straight line.
6. An electronic device, comprising: a memory and a processor; wherein the memory is used for storing a computer program;
the processor is coupled to the memory for executing the computer program for performing the steps of the method of any of claims 1-4.
7. A computer-readable storage medium having stored thereon computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the method of any one of claims 1-4.
CN202111630393.0A 2021-12-28 2021-12-28 Virtual decoration method, device, equipment and storage medium Active CN114494635B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111630393.0A CN114494635B (en) 2021-12-28 2021-12-28 Virtual decoration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111630393.0A CN114494635B (en) 2021-12-28 2021-12-28 Virtual decoration method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114494635A CN114494635A (en) 2022-05-13
CN114494635B true CN114494635B (en) 2023-04-07

Family

ID=81495868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111630393.0A Active CN114494635B (en) 2021-12-28 2021-12-28 Virtual decoration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114494635B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108648276A (en) * 2018-05-17 2018-10-12 上海宝冶集团有限公司 A kind of construction and decoration design method, device, equipment and mixed reality equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5463467B2 (en) * 2010-04-01 2014-04-09 株式会社浅間製作所 Operating method and operating program for mobile decoration device
CN105096384B (en) * 2015-07-22 2018-10-26 深圳多新哆技术有限责任公司 Adjust the method and device of virtual article position and attitude angle
CN110288716B (en) * 2019-06-14 2023-08-08 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN113536514A (en) * 2020-04-15 2021-10-22 阿里巴巴集团控股有限公司 Data processing method, device, equipment and storage medium
CN113253842A (en) * 2021-05-20 2021-08-13 深圳市商汤科技有限公司 Scene editing method and related device and equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108648276A (en) * 2018-05-17 2018-10-12 上海宝冶集团有限公司 A kind of construction and decoration design method, device, equipment and mixed reality equipment

Also Published As

Publication number Publication date
CN114494635A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
CN106200983B (en) A kind of system of combination virtual reality and BIM realization virtual reality scenario architectural design
CN109584295A (en) The method, apparatus and system of automatic marking are carried out to target object in image
US20210035346A1 (en) Multi-Plane Model Animation Interaction Method, Apparatus And Device For Augmented Reality, And Storage Medium
CN105389854A (en) Decoration effect displaying method and system of cubic room
CN106683177A (en) Data interactive method and device based on interactive roaming house decoration
CN115393467A (en) House type graph generation method, device, equipment and medium
CN109840939A (en) Three-dimensional rebuilding method, device, electronic equipment and storage medium
WO2015096518A1 (en) Method and apparatus for dynamically displaying three-dimensional model
CN110634100A (en) Household type graph generation method and device, electronic equipment and storage medium
US20030189567A1 (en) Viewing controller for three-dimensional computer graphics
CN110162258A (en) The processing method and processing device of individual scene image
CN114494635B (en) Virtual decoration method, device, equipment and storage medium
CN114237540A (en) Intelligent classroom online teaching interaction method and device, storage medium and terminal
Koller et al. Supporting disassembly in remanufacturing with augmented reality
US20200334909A1 (en) Methods for guiding a user when performing a three dimensional scan and related mobile devices and computer program products
US9547943B2 (en) Framework and method for creating virtual model of three-dimensional space
CN114727090B (en) Entity space scanning method, device, terminal equipment and storage medium
CN113052981A (en) Model editing and constructing method and related equipment and computer storage medium
CN109669541A (en) It is a kind of for configuring the method and apparatus of augmented reality content
CN115393469A (en) House type graph generation method, device, equipment and medium
CN114820968A (en) Three-dimensional visualization method and device, robot, electronic device and storage medium
CN114329675A (en) Model generation method, model generation device, electronic device, and readable storage medium
CN109931923A (en) A kind of navigation guide map generalization method and apparatus
CN109935318B (en) Three-dimensional pulse wave display method and device, computer equipment and storage medium
JP2024506879A (en) Methods and apparatus, computer equipment and storage media for presenting virtual representations

Legal Events

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