CN114494653A - Model scaling method and device in virtual space - Google Patents

Model scaling method and device in virtual space Download PDF

Info

Publication number
CN114494653A
CN114494653A CN202111640952.6A CN202111640952A CN114494653A CN 114494653 A CN114494653 A CN 114494653A CN 202111640952 A CN202111640952 A CN 202111640952A CN 114494653 A CN114494653 A CN 114494653A
Authority
CN
China
Prior art keywords
scaling
model
target
scaled
region
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.)
Pending
Application number
CN202111640952.6A
Other languages
Chinese (zh)
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 CN202111640952.6A priority Critical patent/CN114494653A/en
Publication of CN114494653A publication Critical patent/CN114494653A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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/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
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/20Indexing scheme for editing of 3D models
    • G06T2219/2016Rotation, translation, scaling

Landscapes

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

Abstract

The embodiment of the application provides a method and equipment for scaling a model in a virtual space. In the embodiment of the present application, in a case that a geometric model in a virtual space needs to be scaled, a target scaling region adapted to a required scaling direction may be determined on the geometric model, where the target scaling region may be a local region of the geometric model that does not cause model distortion after scaling according to the scaling direction; based on this, a scaling operation may be performed only on the target scaling region in the geometric model to bring the geometric model to the desired scaling length. Because the model distortion cannot be caused when the target scaling region is scaled, and other regions except the target scaling region in the geometric model are not scaled, the model distortion cannot be caused, so that the scaling effect of the geometric model can be ensured to meet the scaling requirement, and the distortion problem caused by model scaling can be effectively improved.

Description

Model scaling method and device in virtual space
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for scaling a model in a virtual space.
Background
Virtual Reality technology (abbreviated as VR) can simulate a Virtual environment through a computer to provide people with an environmental immersion feeling, and with the continuous development of social productivity and scientific technology, demands of various industries on VR technology are increasingly strong.
In the field of home decoration, the virtual home decoration scheme can provide a vivid home decoration design function for users, and is concerned by more and more users. In the virtual-home approach, a user may simulate home-mounting by operating on a wide variety of geometric models in virtual space, including scaling, shifting, inserting, deleting, and the like. For the scaling operation, at present, the corresponding geometric model is scaled mostly by adjusting the scale parameter, but this often causes the scaled geometric model to have a distortion problem, and the virtual home decoration design effect is seriously affected.
Disclosure of Invention
Aspects of the present disclosure provide a method and apparatus for scaling a model in a virtual space, so as to improve distortion caused by scaling of the model.
The embodiment of the application provides a model scaling method in a virtual space, which comprises the following steps:
in response to a model scaling instruction, determining a model to be scaled in a virtual space;
determining a target scaling region which is adapted to the scaling direction on the model to be scaled according to the scaling direction specified in the model scaling instruction, wherein the target scaling region is a local region which does not cause model distortion after scaling according to the scaling direction in the model to be scaled;
and scaling the target scaling region according to the scaling direction so that the model to be scaled reaches the scaling length required in the model scaling instruction.
The embodiment of the application also provides a computing device, which comprises a memory, a processor and a communication component;
the memory is to store one or more computer instructions;
the processor, coupled with the memory and the communication component, to execute the one or more computer instructions to:
in response to a model scaling instruction, determining a model to be scaled in a virtual space;
determining a target scaling region which is adapted to the scaling direction on the model to be scaled according to the scaling direction specified in the model scaling instruction, wherein the target scaling region is a local region which does not cause model distortion after scaling according to the scaling direction in the model to be scaled;
and scaling the target scaling region according to the scaling direction so that the model to be scaled reaches the scaling length required in the model scaling instruction.
Embodiments of the present application also provide a computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform the aforementioned method of model scaling in virtual space.
In the embodiment of the present application, in a case that a geometric model in a virtual space needs to be scaled, a target scaling region adapted to a required scaling direction may be determined on the geometric model, where the target scaling region may be a local region of the geometric model that does not cause distortion of the model after being scaled according to the scaling direction; based on this, a scaling operation may be performed only on the target scaling region in the geometric model to bring the geometric model to the desired scaling length. Because the model distortion cannot be caused when the target scaling region is scaled, and other regions except the target scaling region in the geometric model are not scaled, the model distortion cannot be caused, so that the scaling effect of the geometric model can be ensured to meet the scaling requirement, and the distortion problem caused by model scaling can be effectively 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 flowchart of a method for scaling a model in a virtual space according to an exemplary embodiment of the present application;
FIG. 2 is a schematic diagram of a zoom direction and a target zoom region provided in an exemplary embodiment of the present application;
fig. 3 is a schematic effect diagram of an application scenario provided in an exemplary embodiment of the present application;
fig. 4 is a schematic structural diagram of a computing device according to another exemplary 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, 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 application.
At present, in the process of scaling the geometric model in the virtual space, the problem of model distortion often occurs. To this end, in some embodiments of the present application: under the condition that the geometric model in the virtual space needs to be scaled, a target scaling region which is matched with a required scaling direction can be determined on the geometric model, wherein the target scaling region can select a local region which does not cause model distortion after scaling according to the scaling direction in the geometric model; based on this, the scaling operation may be performed only on the target scaling region in the geometric model to bring the geometric model to the required scaling length. Because the model distortion cannot be caused when the target scaling region is scaled, and other regions except the target scaling region in the geometric model are not scaled, the model distortion cannot be caused, so that the scaling effect of the geometric model can be ensured to meet the scaling requirement, and the distortion problem caused by model scaling can be effectively improved.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for scaling a model in a virtual space according to an exemplary embodiment of the present application, where the method may be performed by a data processing apparatus, which may be implemented as a combination of software and/or hardware, and the data processing apparatus may be integrated in a computing device. Referring to fig. 1, the method includes:
step 100, responding to a model scaling instruction, and determining a model to be scaled in a virtual space;
step 101, according to a scaling direction specified in a model scaling instruction, determining a target scaling region adapted to the scaling direction on a model to be scaled, wherein the target scaling region is a local region which does not cause model distortion after scaling according to the scaling direction in the model to be scaled;
and 102, scaling the target scaling region according to the scaling direction so that the model to be scaled reaches the scaling length required in the model scaling instruction.
The method for scaling a model in a virtual space provided by this embodiment may be applied to scenes in which geometric models in a virtual space are scaled, so as to solve distortion problems that may be caused by scaling of the model in these application scenes, taking a door model as an example, the distortion problems include, but are not limited to, an excessively thick door frame being stretched, a door lock being pulled flat, and the like. The model scaling scheme provided by the embodiment can be applied to a virtual home decoration scene. Of course, the model scaling scheme provided by the embodiment may also be applied to other application scenarios, and the embodiment is not limited thereto. In addition, the geometric model in the virtual space may be diverse in different home decoration scenarios. For example, in a home setting scenario, the geometric model in virtual space may be a soft-packed model-a sofa model, a mural model, a curtain model, etc.; or a hard-mounted model-a door model, a window model, etc.
Referring to fig. 1, in step 100, a model to be scaled may be determined in a virtual space in response to a model scaling instruction. In practice, the user may be provided with an operable interface for the virtual space, and the user may edit the virtual space by performing various operations in the operable interface, and the editing operations of the user may generate computer instructions understandable by the computer. For example, a user may perform a selection operation on a geometric model in the virtual space and specify a zoom direction and/or a zoom length to generate a model zoom instruction for the geometric model. For convenience of description, the geometric model selected by the user and needing to be scaled is referred to as a model to be scaled.
Wherein, the zooming direction refers to a direction in which stretching/shrinking is required, fig. 2 is a schematic diagram of the zooming direction and the target zooming area provided in an exemplary embodiment of the present application, referring to fig. 2, the zooming direction of the left image is a horizontal direction, and the zooming direction of the right image is a vertical direction, in this embodiment, a subsequent zooming operation is performed along the zooming direction. In this regard, in this embodiment, an input item corresponding to the zooming direction may be provided to the user in the operable interface, and the user may input the zooming direction in the input item, for example, the zooming direction may be specified by setting an angle between coordinate axes/coordinate planes in the world coordinate system corresponding to the virtual space; of course, the user may also directly draw the direction line in the virtual space to specify the zooming direction, which is not limited in this embodiment.
Wherein, the scaling length can be used to represent the scaling degree required by the model to be scaled. In this embodiment, the length that needs to be executed by the scaling operation may be directly used as the scaling length, or the length that needs to be reached after the scaling of the model is performed may be used as the scaling length, and for the latter request, the length actually executed by the scaling operation may be calculated. In this regard, in this embodiment, an entry corresponding to the zoom length may be provided to the user in the operable interface, and the user may input the zoom length in the entry. For example, if the length required to be performed by the zoom operation is directly taken as the zoom length, the user may input +5cm to indicate that the model to be zoomed is stretched by 5cm, and the user may input-4 cm to indicate that the model to be zoomed is contracted by 4 cm. For another example, if the length to be reached after the model to be zoomed is used as the zoom length, the user can input 25cm to schematically stretch the model to be zoomed (20 cm in original length) by 5cm, and the user can input 16cm to schematically contract the model to be zoomed (20 cm in original length) by 4 cm.
Based on this, in step 101, a target scaling region adapted to the scaling direction may be determined on the model to be scaled according to the scaling direction specified in the model scaling instruction. In this embodiment, the attributes such as the shape and specification of the target zoom region are not limited. The target zooming area is adapted to the zooming direction, namely the zooming operation is carried out on the target zooming area according to the zooming direction, so that the model to be zoomed is not distorted, and the target zooming area can be a local area in the model to be zoomed. Therefore, in this embodiment, the target scaling region is a local region in the model to be scaled, which does not cause distortion of the model after scaling according to the scaling direction. In this embodiment, a local region in the model to be scaled, in which the texture or the texture can be scaled in the scaling direction without causing distortion, may be selected as the target scaling region. For example, referring to fig. 2, the zooming direction in the left image is the horizontal direction, a local area a enclosed by a dashed line in the left image can be used as a target zooming area, and no pattern exists in the target zooming area, so that zooming the target zooming area in the horizontal direction does not cause the distortion problem of the door model; referring to fig. 2, the zooming direction in the right drawing is a vertical direction, a local region d outlined by a dashed line in the right drawing may be used as a target zooming region, a middle pattern in a square pattern exists in the target zooming region, zooming the target zooming region in the vertical direction only causes the square pattern to be elongated/contracted, and does not cause the distortion problem of the door model.
Upon determining the target scaling region, in step 102, the target scaling region may be scaled according to the scaling direction, so that the model to be scaled reaches the scaling length required in the model scaling instruction. That is, the scaling operation is performed on the target scaling region according to the scaling length and the scaling direction required in the model scaling instruction, so that the model to be scaled meets the required scaling requirement. For example, referring to fig. 2, the target zoom area in the left image may be stretched in the horizontal direction to make the target zoom area 5cm long, so as to achieve the effect that the door model is 5cm long in the horizontal direction. And for other areas except the target scaling area in the model to be scaled, no scaling operation needs to be performed, so that the other areas are not deformed.
In this embodiment, the number of target zoom regions may be one or more. If the number of the target scaling areas is multiple, the scaling length required by the model scaling instruction is distributed to the multiple target scaling areas; and scaling the corresponding target scaling areas along the scaling direction according to the scaling lengths respectively allocated to the target scaling areas. Taking the left image in fig. 2 as an example, the local areas a and b in the left image may be used as target zoom areas, and in the case that the zoom length is 5cm, 5cm may be allocated to the target zoom areas a and b. For example, the zoom lengths are allocated according to the width ratios of the plurality of target zoom regions in the zoom direction, for example, the width ratios of the target zoom regions a and b in the horizontal direction are 3:2, 3cm of the zoom lengths may be allocated to the target zoom region a, and 2cm of the zoom lengths may be allocated to the target zoom region b, so that the target zoom region a may be elongated by 3cm, and the target zoom region b may be elongated by 2cm, so that the gate model may be elongated by 5 cm. Of course, this is merely exemplary, and the manner of assigning the zoom lengths to the plurality of target zoom regions in the present embodiment is not limited thereto.
Accordingly, in this embodiment, when the geometric model in the virtual space needs to be scaled, a target scaling region adapted to a required scaling direction may be determined on the geometric model, where the target scaling region may select a local region of the geometric model that does not cause model distortion after scaling according to the scaling direction; based on this, the scaling operation may be performed only on the target scaling region in the geometric model to bring the geometric model to the required scaling length. Because the model distortion cannot be caused when the target scaling region is scaled, and other regions except the target scaling region in the geometric model are not scaled, the model distortion cannot be caused, so that the scaling effect of the geometric model can be ensured to meet the scaling requirement, and the distortion problem caused by model scaling can be effectively improved.
In the above or below embodiments, various implementations may be adopted to determine the target scaling region on the model to be scaled.
In one implementation, a scalable region previously specified for a model to be scaled may be identified, the scalable region being a local region of the model to be scaled that does not result in distortion of the model after scaling; a target zoom region adapted to the zoom direction is selected from the scalable regions.
In this implementation, a scalable region may be pre-specified on the model to be scaled, where the scalable region on the model to be scaled may be one or more. Different scalable regions may adapt to not exactly the same scaling direction, i.e. there may be one or more adapted scalable regions in the same scaling direction. Generally, a single scalable region can extend to the boundary of the model to be scaled in the direction perpendicular to the corresponding scaling direction thereof, so as to ensure that when the scaling process occurs in the scalable region along the corresponding scaling direction thereof, the model to be scaled can produce the effect of overall scaling in the scaling direction, and avoid the problems of image distortion and the like caused by the fact that the scalable region does not extend to the boundary of the model and the boundary of the cross section, the target scaling region and other regions on the model to be scaled is misaligned. Referring to fig. 2, the zooming direction is the horizontal direction, and the target zooming area a adapted to the zooming direction extends to the upper and lower boundaries of the door model in the vertical direction, so that the door model can be guaranteed to generate the effect of overall zooming in the horizontal direction by performing zooming along the horizontal direction on the target zooming area a, and the problem of distortion, such as distortion of the overall shape of the door model caused by zooming, can be avoided.
In this implementation, the module to be scaled may contain several patches (also referred to as meshes), which may be polygonal, e.g., triangular patches, quadrilateral patches, etc. A patch is a data structure used in computer graphics to model various irregular objects. The surface of an object in the real world is intuitively formed by a curved surface, but in the computer world, because only discrete structures can be used for simulating continuous objects in reality, a large number of patches are used inside a computer to form the curved surface of a model to be zoomed. Based on this, the process of specifying a scalable area for the model to be scaled may be: in response to a parting line designation operation, identifying a position of a parting line designated on the model to be scaled; selecting a scalable patch on the model to be scaled based on the position of the partition line; and taking the area occupied by the scalable patch on the model to be scaled as a scalable area. Wherein the segmentation line may be a line through the entire model to be scaled, which in turn intersects the boundary of the model to be scaled in a direction perpendicular to the scaling direction in which it is adapted in the preceding scalable region. The parting line can be a straight line or a curve, and in the implementation mode, the appropriate type of parting line can be selected according to the texture or pattern condition on the model to be scaled. For example, if the texture or pattern is axisymmetric, the dividing line may be a straight line, and the position of the dividing line may be the symmetry axis of the texture or pattern. For example, if the pattern has a wavy shape, the dividing line may be a wavy line, and specifically, may be a wavy line that conforms to the undulation of the wavy pattern. In addition, in this implementation, an operable interface may be provided for a user, the user may draw a dividing line for the model to be zoomed in the operable interface, and the user may draw the dividing line in different zooming directions respectively, so as to select enough zoomable areas through the dividing line to adapt to various zooming directions. Here, the position of a user-drawn partition line on the model to be scaled may be identified, and a scalable patch may be selected on the model to be scaled based on the position of the partition line.
Optionally, in one exemplary approach: the patches in the model to be scaled that intersect the partition line may be selected as scalable patches. In this exemplary scheme, a scalable region may be selected by specifying a dividing line. In another exemplary scenario: and selecting the patch positioned between two adjacent dividing lines in the model to be scaled as a scalable patch. In this exemplary scheme, one scalable area may be selected by specifying two dividing lines. In yet another exemplary aspect: and selecting the patches positioned in the specified ranges at two sides of the dividing line in the model to be scaled as scalable patches. In this exemplary scheme, a scalable area may be selected by specifying a dividing line, and the specified range may be set according to actual needs, for example, the specified range may be 2cm, so that the patches within 2cm on both sides of the dividing line are selected as scalable patches. It should be understood that, in the present embodiment, the implementation scheme for selecting a scalable patch on the model to be scaled based on the position of the partition line is not limited thereto.
In this implementation, after the scalable patch is selected, the area occupied by the scalable patch on the model to be scaled may be used as the scalable area. Thus, attributes such as the shape and specification of the scalable area may be various, and therefore, in the present embodiment, these attributes of the scalable area are not limited.
Thus, in this implementation, in the case where a zoom direction is specified in the model zoom instruction, in this implementation, a target zoom region that is adapted to the desired zoom direction may be selected from among the scalable regions on the model to be zoomed. In concert with the above, there may be one or more target zoom regions selected from the scalable regions.
In another implementation, in response to a partition line specification operation, identifying a position of a partition line specified on the model to be scaled, the position of the partition line being adapted to the scaling direction; selecting a scalable patch on the model to be scaled based on the position of the partition line; and taking the area occupied by the scalable patch on the model to be scaled as a target scaling area.
In this implementation, the target scaling region may be constructed in the model to be scaled in real time in the case that the model to be scaled needs to be scaled. In practical application, a user may perform a dividing line specifying operation in an operable interface corresponding to the virtual space to draw dividing lines for the model to be scaled, where the number of the specified dividing lines may be one or more. The user-drawn segmentation line is adapted to the scaling direction it has specified in the model scaling instruction. For example, referring to the left diagram in fig. 2, if the zoom direction specified by the user is the horizontal direction, the user-drawn dividing line will be the vertical direction, and the dotted line a' in the left diagram is the dividing line. In this implementation, the number of the division lines specified for the model to be scaled may be one or more, and each of the division lines is adapted to the scaling direction specified in the model scaling instruction. Also, in this implementation, the position of the user-drawn partition line on the model to be scaled may also be identified, and a scalable patch may be selected on the model to be scaled based on the position of the partition line. Among other things, implementations of selecting a scalable patch may include, but are not limited to: selecting a surface patch intersected with the dividing line in the model to be scaled as a scalable surface patch; selecting a surface patch positioned between two adjacent dividing lines in the model to be scaled as a scalable surface patch; or, selecting the patches in the specified range at two sides of the dividing line in the model to be scaled as scalable patches, and the like. This part is consistent with the previous implementation, and specific details may refer to the description in the foregoing, which is not described herein again.
On the basis, the area occupied by the selected scalable patch on the model to be scaled can be used as the target scaling area. In this way, the target zoom region can be directly constructed. Here, the number of target zoom regions constructed may be one or more.
Two implementations of determining the target zoom area on the model to be zoomed are described above, but it should be understood that this is only an example, and the embodiment is not limited thereto.
Accordingly, in this embodiment, one or more target scaling regions may be determined on the model to be scaled, the determined target scaling regions are adapted to the required scaling direction, and the target scaling regions penetrate through the boundary of the model to be scaled in the direction perpendicular to the scaling direction, so that the model to be scaled can generate an overall scaling effect in the scaling direction after the target scaling regions are scaled, thereby avoiding distortion problems such as distortion of the overall shape of the model to be scaled due to only scaling the target scaling regions.
In the above or following embodiments, in the process of scaling the target scaling region according to the scaling direction, vertices of patches included in the target scaling region may be determined; and moving the vertex of the patch included in the target scaling region according to the scaling direction and the required scaling length specified in the model scaling instruction so as to drive the patch in the target scaling region to deform and scale the target scaling region.
In this embodiment, the vertices of the patches included in the target scaling region may be moved in a variety of implementations. In one exemplary implementation:
a reference line perpendicular to the zooming direction can be determined in the middle of the target zooming area;
if the zooming length indicates that the target zooming area needs to be stretched, respectively moving vertexes of patches positioned on two sides of the reference line in the target zooming area in a direction away from the reference line according to the zooming direction;
and if the scaling length indicates that the target scaling region needs to be shrunk, respectively moving the vertexes of the patches positioned at the two sides of the reference line in the target scaling region to the direction close to the reference line according to the scaling direction.
Wherein, the logic for determining whether to stretch or shrink the target zoom region according to the zoom length may be: if the length required to be executed by the scaling operation is directly used as the scaling length, the length can be determined according to the sign bit corresponding to the scaling length specified in the model scaling instruction. For example, if the sign bit is + then it is determined that a stretching operation needs to be performed, and if the sign bit is-, then it is determined that a shrinking operation needs to be performed. The decision logic may also be: if the length that the model to be zoomed needs to reach after being zoomed is taken as the zoom length, the zoom length can be determined according to the difference between the zoom length and the original length of the model to be zoomed in the zoom direction. For example, if the difference is a positive value, it is determined that the stretching operation needs to be performed, and if the difference is a negative value, it is determined that the shrinking operation needs to be performed. Of course, these are merely exemplary, and the present embodiment is not limited thereto.
It is worth mentioning that in this implementation, the reference line may be a straight line or a curved line. In the case where the reference line is a curved line, the shape of the reference line may be in accordance with the shape trend of the target zoom area, for example, if the target zoom area is a wave shape, the reference line may be a wave line in accordance with the wave shape. Moreover, in the case that the reference line is a curved line, the reference line being perpendicular to the zooming direction can be understood as the trend of the reference line being perpendicular to the zooming direction, for example, when the reference line is a wavy line, the normal of the wavy line is perpendicular to the zooming direction. In this implementation, the target scaling region may be divided into two parts by the reference line, and thus, the scaling of the target scaling region may be achieved by performing relative motion on vertices of patches within both side regions of the reference line in the target scaling region.
Alternatively, in this implementation, the reference line may take the centerline of the target scaling region and be perpendicular to the scaling direction specified in the model scaling instruction. The central line of the target zooming area is used as the reference line, so that the areas on two sides of the reference line can generate equal and opposite zooming effects, and the target zooming area can be guaranteed not to have distortion problems after being zoomed under the condition that textures or patterns exist in the target zooming area.
In addition, the movement distance of the vertex of each patch can be allocated according to the scaling length required in the model scaling instruction, and it is only required to ensure that the scaling length required in the model scaling instruction can be generated after the movement distances between the vertices of the patches in the target scaling region are matched, and the specific allocation rule is not limited in this embodiment. For example, vertices that are farther from the reference line may be assigned a greater distance of movement. For another example, vertices on both sides of the reference line may be assigned the same movement distance, which is (zoom length/2), indicating that the movement directions of the vertices on both sides of the reference line are different.
It should be understood that the above-described implementation is exemplary, and the implementation details are not limited to the above-described example, and the present embodiment may also adopt other implementations to move the vertices of the patches included in the target scaling region, for example, the distance between the vertices of the patches in the target scaling region may be increased by an equal amount in the scaling direction without specifying the reference line, and the present embodiment is not limited thereto. In addition, the vertices of the patches in the areas outside the target scaling area in the model to be scaled will adaptively move with the scaling of the target scaling area, but the distances between the vertices of the patches in these areas are not changed, i.e., the patches in these areas will not deform.
Accordingly, in this embodiment, the vertices of the patches included in the target scaling region may be moved according to the scaling direction specified in the model scaling instruction and the required scaling length, so that the target scaling region is scaled in the scaling direction. The mode through the summit of moving the facet can make the deformation in the target zoom area natural, regular, avoids appearing the distortion problem in the target zoom area, like this, can reach the effect of zooming the model of treating the zoom through zooming the target zoom area, moreover, can not take place the problem of losing one's body.
Fig. 3 is a schematic effect diagram of an application scenario according to an exemplary embodiment of the present application. Referring to fig. 3, the model to be scaled is a door model, and the original state of the door model can be referred to as the left diagram in fig. 3.
In the application scenario, a user can import a door model into a virtual space, and the door model may not be matched with the size of a door opening in the virtual space after the door model is imported, so that the door model needs to be scaled. In the model scaling scheme provided in this embodiment, the gate model is not scaled equally, but the scaling direction may be specified as the vertical direction in the model scaling instruction, and the scaling length is +10 cm. With the model scaling scheme provided by this embodiment, two target scaling regions c and d adapted to the vertical direction can be determined on the door model, and the required scaling length of +10cm can be allocated to the target scaling region c for +2cm and the target scaling region d for +8 cm.
Under the condition of keeping the vertex distances of the patches in other areas unchanged, the vertices of the patches in the target scaling areas c and d can be moved, for example, the vertices of the patches on both sides of the midline of the target scaling area d are respectively moved by 4cm in the direction departing from the midline, so that the target scaling area d is elongated by 8cm in the vertical direction; also, the target zoom region c may be elongated by 2cm in the vertical direction by moving the vertices of the patch. The effect of the elongation is shown in the right image of fig. 3.
Therefore, positions of a door frame, a door lock and the like in the door model are not deformed, the square patterns on the door are still kept to be square after being zoomed, although the proportion of the long side and the short side is changed, the overall visual form of the door model is not influenced, and the zoomed door model is not distorted.
It should be noted that 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.
Fig. 4 is a schematic structural diagram of a computing device according to another exemplary embodiment of the present application. As shown in fig. 4, the computing device includes: a memory 40 and a processor 41.
A processor 41, coupled to the memory 40, for executing the computer program in the memory 40 for:
in response to a model scaling instruction, determining a model to be scaled in a virtual space;
determining a target scaling region adapted to the scaling direction on the model to be scaled according to the scaling direction specified in the model scaling instruction, wherein the target scaling region is a local region which does not cause model distortion after scaling according to the scaling direction in the model to be scaled;
and scaling the target scaling area according to the scaling direction so that the model to be scaled reaches the scaling length required in the model scaling instruction.
In an alternative embodiment, the processor 41, in determining the target scaling region adapted to the scaling direction on the model to be scaled, is configured to:
identifying a scalable region which is specified for a model to be scaled in advance, wherein the scalable region is a local region which does not cause model distortion after scaling in the model to be scaled;
a target zoom region adapted to the zoom direction is selected from the scalable regions.
In an alternative embodiment, the processor 41, in specifying a scalable area for the model to be scaled, is configured to:
in response to a parting line designation operation, identifying a position of a parting line designated on the model to be scaled;
selecting a scalable patch on the model to be scaled based on the position of the partition line;
and taking the area occupied by the scalable patch on the model to be scaled as a scalable area.
In an alternative embodiment, processor 41, in selecting a scalable patch on the model to be scaled based on the location of the partition line, is configured to:
selecting a surface patch intersected with the dividing line in the model to be scaled as a scalable surface patch; alternatively, the first and second electrodes may be,
selecting a surface patch positioned between two adjacent dividing lines in the model to be scaled as a scalable surface patch; alternatively, the first and second electrodes may be,
and selecting the patches positioned in the specified ranges at two sides of the dividing line in the model to be scaled as scalable patches.
In an alternative embodiment, the processor 41 determines, on the model to be scaled, a target scaling region adapted to the scaling direction for:
in response to the operation of designating the dividing line, the position of the dividing line designated on the model to be zoomed is identified, and the position of the dividing line is matched with the zooming direction;
selecting a scalable patch on the model to be scaled based on the position of the partition line;
and taking the area occupied by the scalable patch on the model to be scaled as a target scaling area.
In an alternative embodiment, the processor 41, in scaling the target scaling region according to the scaling direction, is configured to:
determining the vertex of a patch contained in a target scaling region;
and moving the vertex of the patch included in the target scaling region according to the scaling direction and the required scaling length specified in the model scaling instruction so as to drive the patch in the target scaling region to deform and scale the target scaling region.
In an alternative embodiment, the processor 41, during the process of moving the vertices of the patch included in the target scaling region according to the scaling direction and the required scaling length specified in the model scaling instruction, is configured to:
determining a reference line perpendicular to the zooming direction in the middle of the target zooming area;
if the zooming length indicates that the target zooming area needs to be stretched, respectively moving vertexes of patches positioned on two sides of the reference line in the target zooming area in a direction away from the reference line according to the zooming direction;
and if the scaling length indicates that the target scaling region needs to be shrunk, respectively moving the vertexes of the patches positioned at the two sides of the reference line in the target scaling region to the direction close to the reference line according to the scaling direction.
In an alternative embodiment, the reference line is a middle line of the target zoom region and is perpendicular to the zoom direction.
In an alternative embodiment, the model to be scaled is a soft-or hard-mounted model in the virtual home space.
In an alternative embodiment, the number of target zoom regions is one or more.
In an alternative embodiment, the processor 41, in scaling the target scaling region according to the scaling direction, is configured to:
if the number of the target scaling areas is multiple, the scaling length required by the model scaling instruction is distributed to the multiple target scaling areas;
and scaling the corresponding target scaling areas along the scaling direction according to the scaling lengths respectively allocated to the target scaling areas.
Further, as shown in fig. 4, the computing device further includes: communication components 42, display 43, power components 44, audio components 45, and the like. Only some of the components are schematically shown in fig. 4, and the computing device is not meant to include only the components shown in fig. 4.
It should be noted that, for the technical details in the embodiments of the computing device, reference may be made to the related description in the foregoing method embodiments, and for the sake of brevity, detailed description is not provided herein, but this should not cause a loss of scope of the present application.
Accordingly, the present application further provides a computer-readable storage medium storing a computer program, where the computer program can implement the steps that can be executed by a computing device in the foregoing method embodiments when executed.
The memory of FIG. 4, described above, is used to store a computer program and may be configured to store other various data to support operations on a computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 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 communication component in fig. 4 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as a WiFi, a 2G, 3G, 4G/LTE, 5G and other mobile communication networks, or a combination thereof. 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 one exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
The display of fig. 4 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal 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.
The power supply assembly of fig. 4 described above provides power to the various components of the device in which the power supply assembly 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.
The audio component of fig. 4 described above may be configured to output and/or input an audio signal. 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.
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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement 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 tape 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 an … …" does not exclude the presence of other like elements 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 shall be included in the protection scope of the present application.

Claims (13)

1. A method of scaling a model in a virtual space, comprising:
in response to a model scaling instruction, determining a model to be scaled in a virtual space;
determining a target scaling region which is adapted to the scaling direction on the model to be scaled according to the scaling direction specified in the model scaling instruction, wherein the target scaling region is a local region which does not cause model distortion after scaling according to the scaling direction in the model to be scaled;
and scaling the target scaling region according to the scaling direction so that the model to be scaled reaches the scaling length required in the model scaling instruction.
2. The method according to claim 1, wherein the determining a target scaling region on the model to be scaled, which is adapted to the scaling direction, comprises:
identifying a scalable region which is specified for the model to be scaled in advance, wherein the scalable region is a local region which does not cause model distortion after scaling in the model to be scaled;
selecting a target zoom region adapted to the zoom direction from the scalable regions.
3. The method of claim 2, wherein the process of specifying a scalable area for the model to be scaled comprises:
in response to a parting line specifying operation, identifying the position of a parting line specified on the model to be scaled;
selecting a scalable patch on the model to be scaled based on the location of the partition line;
and taking the area occupied by the scalable patch on the model to be scaled as the scalable area.
4. The method of claim 3, wherein selecting a scalable patch on the model to be scaled based on the location of the partition line comprises:
selecting a surface patch intersecting with the dividing line in the model to be scaled as a scalable surface patch; alternatively, the first and second electrodes may be,
selecting a surface patch positioned between two adjacent dividing lines in the model to be scaled as a scalable surface patch; alternatively, the first and second electrodes may be,
and selecting the patches positioned in the specified ranges at two sides of the dividing line in the model to be scaled as scalable patches.
5. The method according to claim 1, wherein the determining a target scaling region on the model to be scaled, which is adapted to the scaling direction, comprises:
in response to a dividing line specifying operation, identifying the position of a dividing line specified on the model to be scaled, the position of the dividing line being adapted to the scaling direction;
selecting a scalable patch on the model to be scaled based on the location of the partition line;
and taking the area occupied by the scalable patch on the model to be scaled as the target scaling area.
6. The method of claim 1, wherein said scaling said target scaling region in said scaling direction comprises:
determining the vertexes of the patches contained in the target scaling region;
and moving the vertex of the patch included in the target scaling region according to the scaling direction and the required scaling length specified in the model scaling instruction so as to drive the patch in the target scaling region to deform and scale the target scaling region.
7. The method of claim 6, wherein the moving vertices of patches included in the target scaling region according to the scaling direction and the required scaling length specified in the model scaling instruction comprises:
determining a reference line perpendicular to the zooming direction in the middle of the target zooming area;
if the scaling length indicates that the target scaling region needs to be stretched, respectively moving vertexes of patches positioned on two sides of the reference line in the target scaling region in a direction away from the reference line according to the scaling direction;
if the scaling length indicates that the target scaling region needs to be shrunk, moving vertexes of patches positioned on two sides of the reference line in the target scaling region to a direction close to the reference line according to the scaling direction respectively.
8. The method of claim 7, wherein the reference line is a midline of the target zoom region and the reference line is perpendicular to the zoom direction.
9. The method of claim 1, wherein the model to be scaled is a soft-or hard-mounted model in a virtual home space.
10. The method of claim 1, wherein the number of target zoom regions is one or more.
11. The method of claim 10, wherein said scaling said target scaling region in said scaling direction comprises:
if the number of the target scaling areas is multiple, distributing the scaling length required by the model scaling instruction to the multiple target scaling areas;
and scaling the corresponding target scaling areas along the scaling direction according to the scaling lengths respectively allocated to the target scaling areas.
12. A computing device comprising a memory and a processor;
the memory is to store one or more computer instructions;
the processor is coupled with the memory for executing the one or more computer instructions for:
in response to a model scaling instruction, determining a model to be scaled in a virtual space;
determining a target scaling region which is adapted to the scaling direction on the model to be scaled according to the scaling direction specified in the model scaling instruction, wherein the target scaling region is a local region which does not cause model distortion after scaling according to the scaling direction in the model to be scaled;
and scaling the target scaling region according to the scaling direction so that the model to be scaled reaches the scaling length required in the model scaling instruction.
13. 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 method of model scaling in virtual space of any of claims 1-11.
CN202111640952.6A 2021-12-29 2021-12-29 Model scaling method and device in virtual space Pending CN114494653A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111640952.6A CN114494653A (en) 2021-12-29 2021-12-29 Model scaling method and device in virtual space

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111640952.6A CN114494653A (en) 2021-12-29 2021-12-29 Model scaling method and device in virtual space

Publications (1)

Publication Number Publication Date
CN114494653A true CN114494653A (en) 2022-05-13

Family

ID=81497288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111640952.6A Pending CN114494653A (en) 2021-12-29 2021-12-29 Model scaling method and device in virtual space

Country Status (1)

Country Link
CN (1) CN114494653A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109359380A (en) * 2018-10-16 2019-02-19 上海莉莉丝科技股份有限公司 Zoom method, device, equipment and medium
CN111062864A (en) * 2019-12-20 2020-04-24 网易(杭州)网络有限公司 Animation model scaling method and device, electronic equipment and storage medium
CN112721173A (en) * 2020-12-16 2021-04-30 深圳市纵维立方科技有限公司 Model processing method and device, electronic equipment and computer readable storage medium
CN113470095A (en) * 2021-09-03 2021-10-01 贝壳技术有限公司 Processing method and device for indoor scene reconstruction model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109359380A (en) * 2018-10-16 2019-02-19 上海莉莉丝科技股份有限公司 Zoom method, device, equipment and medium
CN111062864A (en) * 2019-12-20 2020-04-24 网易(杭州)网络有限公司 Animation model scaling method and device, electronic equipment and storage medium
CN112721173A (en) * 2020-12-16 2021-04-30 深圳市纵维立方科技有限公司 Model processing method and device, electronic equipment and computer readable storage medium
CN113470095A (en) * 2021-09-03 2021-10-01 贝壳技术有限公司 Processing method and device for indoor scene reconstruction model

Similar Documents

Publication Publication Date Title
CN107015788B (en) Method and device for displaying images on mobile device in animation mode
US11087436B2 (en) Method and apparatus for controlling image display during image editing
US20180011818A1 (en) Webpage Update Method And Apparatus
CN106658139B (en) Focus control method and device
CN111583379B (en) Virtual model rendering method and device, storage medium and electronic equipment
AU2019457052B2 (en) Table processing method and apparatus, and intelligent interactive tablet and storage medium
WO2023029379A1 (en) Image special effect generation method and apparatus
US20230386041A1 (en) Control Method, Device, Equipment and Storage Medium for Interactive Reproduction of Target Object
JP2023513382A (en) Image cutting method, device, equipment and storage medium
CN107077347B (en) View management architecture
CN109688457A (en) A kind of anti-occlusion method of video, device, electronic equipment and medium
CN111428455B (en) Form management method, device, equipment and storage medium
CN114494653A (en) Model scaling method and device in virtual space
CN102932607A (en) Caption graphics and text information generation method and device
CN111984151A (en) Whiteboard canvas size and position roaming control method for improving processing efficiency
CN107239212A (en) Segmentation selection view rendering method, device and user terminal
CN109189537B (en) The dynamic display method of page info calculates equipment and computer storage medium
CN113742804B (en) Furniture layout diagram generation method, device, equipment and storage medium
CN110286827A (en) A kind of element zoom control method, device, equipment and storage medium
CN115981640A (en) Interface layout method and device, electronic equipment and storage medium
CN111782313B (en) Display method, device, equipment, system and storage medium
JP2023522370A (en) Image display method, device, equipment and storage medium
CN113721911B (en) Control method, medium and equipment for display proportion of virtual scene
CN111210493A (en) Method for realizing writing software flow chart
CN109783112A (en) The exchange method of virtual environment and physical hardware, device and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220513

RJ01 Rejection of invention patent application after publication