Object control method and apparatus for virtual scene, medium, and electronic device
By displaying the target curves and control points of the target object in a virtual scene, the user can adjust these points to change the shape of the object, solving the problem of difficulty in adjusting the shape of the object in the prior art and improving user experience and control freedom.
Patent Information
- Application Number
- PCT/CN2024/122819
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-18
- Filing Date
- 2024-09-30
- Publication Date
- 2025-06-26
AI Technical Summary
When setting items in a virtual scene, the position and shape of the object are limited by the unit grid, which makes it difficult for users to adjust the appearance of the object.
By responding to the user's modification operation of the target object in the virtual scene, displaying the target curve associated with the target object and its control points, the user can adjust the control points to obtain a new target curve, and then generate a new target object based on the new target curve.
This enables users to quickly and intuitively adjust the shape of target objects in the virtual scene, improving users' gaming experience and freedom of control over the virtual scene.
Smart Images

Figure CN2024122819_26062025_PF_FP_ABST
Abstract
Description
Method, device, medium and electronic device for controlling objects in virtual scenes
[0001] This application claims priority to Chinese Patent Application No. 202311745001.4 filed on December 18, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] The present disclosure relates to a method, device, medium and electronic device for controlling objects in a virtual scene. Background Art
[0003] In related technologies, objects are generally set in virtual scenes by using a voxelized scene generation scheme. However, the position and shape of the objects generated by this scheme are restricted to a unit grid, and the appearance of the objects cannot be freely changed, making it difficult for users to adjust the appearance of objects in the virtual scene.
[0004] Summary of the Invention
[0005] This summary is provided to briefly introduce concepts that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0006] In a first aspect, the present disclosure provides a method for controlling an object in a virtual scene, comprising:
[0007] In response to a modification operation on a target object in a virtual scene, displaying a target curve associated with the target object and control points corresponding to the target curve, wherein the target object is obtained based on at least one sub-object and the target curve, and the target curve is used to control the shape of the at least one sub-object;
[0008] In response to the adjustment operation on the control point, obtaining an adjusted target curve;
[0009] A new target object is generated according to the adjusted target curve and the at least one sub-object.
[0010] In a second aspect, the present disclosure provides an object control device for a virtual scene, comprising:
[0011] a first response module configured to, in response to a modification operation on a target object in a virtual scene, display a target curve associated with the target object and control points corresponding to the target curve, wherein the target object is obtained based on at least one sub-object and the target curve, and the target curve is used to control a shape of the at least one sub-object;
[0012] a second response module configured to obtain an adjusted target curve in response to an adjustment operation on the control point;
[0013] The generating module is configured to generate a new target object according to the adjusted target curve and the at least one sub-object.
[0014] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when executed by a processing device.
[0015] In a fourth aspect, the present disclosure provides an electronic device, comprising:
[0016] a storage device having a computer program stored thereon;
[0017] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect.
[0018] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale. In the drawings:
[0020] FIG1 is a flowchart illustrating a method for controlling an object in a virtual scene according to some embodiments.
[0021] FIG2 is a schematic diagram showing a target object according to some embodiments.
[0022] FIG3 is a schematic diagram showing a target object according to yet other embodiments.
[0023] FIG4 is a schematic diagram showing a principle of a target object according to some embodiments.
[0024] FIG5 is a schematic diagram showing execution of a target task according to some embodiments.
[0025] FIG6 is a schematic diagram illustrating an operation control according to some embodiments.
[0026] FIG7 is a schematic diagram illustrating modification of a target curve according to some embodiments.
[0027] FIG8 is a schematic structural diagram of an object control device for a virtual scene according to some embodiments.
[0028] FIG9 is a schematic structural diagram of an electronic device according to some embodiments. DETAILED DESCRIPTION
[0029] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0031] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0032] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0033] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0035] Figure 1 is a flowchart illustrating a method for controlling objects in a virtual scene, according to some embodiments. As shown in Figure 1 , embodiments of the present disclosure provide a method for controlling objects in a virtual scene. This method can be performed by an electronic device, specifically, by a device for controlling objects in a virtual scene. This device can be implemented in software and / or hardware and configured in the electronic device. As shown in Figure 1 , the method can include the following steps.
[0036] Step 110, in response to a modification operation on a target object in a virtual scene, displays a target curve associated with the target object and control points corresponding to the target curve, wherein the target object is obtained based on at least one sub-object and the target curve, and the target curve is used to control the shape of the at least one sub-object.
[0037] Here, the virtual scene may refer to a game scene, such as a two-dimensional game scene, a three-dimensional game scene, a virtual reality scene, etc. The virtual scene may be a scene displayed by an electronic device, and the electronic device may be a virtual reality device, a mobile terminal, etc.
[0038] The target object may refer to a virtual object set in the virtual scene, such as stairs, fences, streetlights, telephone poles, roads, and the like. It should be understood that the target object in the virtual scene may be a virtual object set in the virtual scene by the game developer during game development, or may be a virtual object set in the virtual scene by the player during the game.
[0039] A modification operation on a target object in a virtual scene may refer to an edit operation on the target object triggered by a user. The user may trigger the modification operation by selecting the target object. Of course, the user may also trigger the modification operation in other ways. For example, the user may trigger the modification operation by clicking an edit control associated with the target object.
[0040] When the electronic device detects a modification operation on the target object, it displays the target curve associated with the target object and the control points corresponding to the target curve in the display interface of the virtual scene. The target curve associated with the target object can be one of a broken line, a rounded broken line, a catenary and a Bezier spline. The broken line refers to a broken line composed of several control points. The rounded broken line can be a broken line that is chamfered at each turning point using a third-order Bezier curve. The catenary can refer to the shape of a rope, chain, etc. that naturally droops under the action of gravity. The Bezier spline can be a line composed of several fourth-order Bezier curves. The target curve associated with each target object can be a curve pre-set by the player or game developer for controlling the shape of the target object. The control points corresponding to the target curve are control points used to adjust the shape of the target curve.
[0041] It should be understood that the target object can be constructed by at least one sub-object and a target curve, and the target curve is used to control the shape of the at least one sub-object. The target object can be understood as a deformable object, and the deformation of the target object can be adjusted by the target curve, thereby adjusting the shape of the target object. Moreover, the number of target curves used to control the shape of at least one sub-object can be one or more. For example, the target object can be a model generated by performing a single-track sweep along a target curve with a given cross-sectional shape (equivalent to the sub-object). For another example, the target object can be a model generated by performing a double-track sweep along two target curves with a given cross-sectional shape (equivalent to the sub-object).
[0042] FIG2 is a schematic diagram of a target object according to some embodiments. As shown in FIG2 , the target object is a fence consisting of a first sub-fence 208, a second sub-fence 209, and a third sub-fence 210. Each of the first sub-fence 208, the second sub-fence 209, and the third sub-fence 210 can be understood as a sub-object. A target curve associated with the target object (fence) includes a first line segment 201, a second line segment 202, and a third line segment 203. This target curve controls the shapes of the first sub-fence 208, the second sub-fence 209, and the third sub-fence 210. For example, the first line segment 201 controls the shape of the first sub-fence 208, the second line segment 202 controls the shape of the second sub-fence 209, and the third line segment 203 controls the shape of the third sub-fence 210. The shape of the target curve is controlled by a first control point 204, a second control point 205, a third control point 206, and a fourth control point 207.
[0043] As shown in Figure 2, when the user triggers a modification operation on the target object (fence) in Figure 2, the target curve associated with the target object (first line segment 201, second line segment 202 and third line segment 203) and the control points corresponding to the target curve (first control point 204, second control point 205, third control point 206 and fourth control point 207) can be displayed.
[0044] It is worth noting that the target object shown in FIG2 is merely an example for illustrating the present disclosure and is not intended to limit the target object. FIG3 is a schematic diagram of a target object according to yet another embodiment. As shown in FIG3 , a target object 301 is a model generated by sweeping a given cross-sectional shape (equivalent to a sub-object) along a target curve 302. The shape of the target curve 302 is controlled by five control points 303.
[0045] Step 120 : Obtaining an adjusted target curve in response to the adjustment operation on the control point.
[0046] Here, as shown in FIG2 and FIG3, the target curve associated with the target object and the control points corresponding to the target curve can be displayed. Then, the user can adjust the shape of the target curve by adjusting the control points to obtain the adjusted target curve.
[0047] The adjustment operation for the control point may include adding a control point, deleting a control point, moving a control point, rotating a control point, and the like.
[0048] For example, as shown in Figure 2, if the user moves the third control point 206 downward, the endpoints of the second line segment 202 and the third line segment 203 will move downward accordingly. For another example, as shown in Figure 3, the user can add one or more control points between two control points 303 to more finely adjust the shape of the target curve 302. Of course, the user can also delete one or more control points 303, in which case the shape of the target curve 302 will be controlled by the remaining control points 303. The user can also move any control point 303 to change the shape of the target curve 302.
[0049] Step 130: Generate a new target object according to the adjusted target curve and at least one sub-object.
[0050] Here, after the user adjusts the control points of the target curve, the shape of the target curve changes accordingly, resulting in an adjusted target curve. Since the target curve is used to control the shape of at least one sub-object, the shape of at least one sub-object can be adjusted accordingly based on the adjusted target curve to generate a new target object.
[0051] 2 , the user moves the third control point 206 downward, and accordingly, the endpoints of the second line segment 202 and the third line segment 203 move downward. In other words, the second sub-fence 209 and the third sub-fence 210 will follow the changes of the adjusted second line segment 202 and the adjusted third line segment 203.
[0052] 3 , the user can move any control point 303 to change the shape of the target curve 302. Accordingly, a new target object is generated by sweeping a given cross-sectional shape (equivalent to a sub-object) along the adjusted target curve 302.
[0053] It is worth noting that the new target object is obtained by adjusting the shape of the previous target object through the adjusted target curve.
[0054] Therefore, by responding to the modification operation on the target object in the virtual scene, the target curve associated with the target object and the control points corresponding to the target curve are displayed, and in response to the adjustment operation on the control point, the adjusted target curve is obtained, and then a new target object is generated based on the adjusted target curve and at least one sub-object. The user can adjust the shape of the target object by adjusting the control points of the target curve, so that the user can quickly, intuitively and conveniently adjust the shape of the target object in the virtual scene, thereby improving the user's gaming experience.
[0055] It is worth noting that the object control method for the virtual scene provided by the embodiment of the present disclosure can be applied to the game scene. In the game scene, the player can make the game display the target curve associated with the virtual object and its corresponding control point by performing modification operations on the virtual object in the game scene. Then, the player can adjust the control points of the target curve by adjusting the control points to adjust the shape of the virtual object. Based on the object control method for the virtual scene provided by the embodiment of the present disclosure, a series of modeling operations can be converted into the player's control operations on the control points and the target curve, so that the user can adjust the shape of the virtual object in the game scene more conveniently and controllably, which not only provides a more convenient, controllable and fast model modification method, but also can provide players with greater game freedom to improve the player's gaming experience.
[0056] In some feasible implementations, at least one sub-object is associated with a dynamic mesh, and the dynamic mesh is associated with at least one target modifier, and the target modifier is configured to modify the dynamic mesh associated with the at least one sub-object according to a preconfigured modeling operation and in combination with a target curve to obtain a target object.
[0057] In a game engine, scripting can be used to dynamically create, modify, and control the mesh of a game object (target object). For example, a plane, cube, or other shaped mesh can be dynamically generated through scripting, and its vertex coordinates, normals, texture coordinates, and triangle face connections can be adjusted as needed to achieve model deformation, collision, particle effects, and more. A DynamicMesh is a type of mesh that can modify the target object's mesh at runtime based on game logic.
[0058] Each sub-object can be associated with a corresponding dynamic mesh, which is in turn associated with at least one target modifier. A target modifier can be understood as pre-written script code that implements the modeling operations corresponding to the target modifier. The target modifier and target curve are used to modify the shape of the dynamic mesh associated with at least one sub-object to generate a target object. In other words, in the disclosed embodiments, a deformable target object can have its shape controlled by a target curve and target modifier.
[0059] Figure 4 is a schematic diagram illustrating the principles of a target object, according to some embodiments. As shown in Figure 4, a child object (GameObject) is associated with a DynamicMesh, which is then associated with three target modifiers (Modifier1, Modifier2, and Modifier3). Modifier1, Modifier2, and Modifier3, combined with the target curve, are calculated sequentially from top to bottom, transforming the DynamicMesh to generate a GameObject.
[0060] It is worth noting that, in the embodiment of the present disclosure, the target modifier may include at least one of an array modifier, a curve modifier, a curve binding modifier, a stretch modifier and a curve modeling modifier. Among them, the modeling operation corresponding to the array modifier is to copy multiple sub-objects at equal intervals. The modeling operation corresponding to the curve modifier is to sample the position of the target curve and make the sub-object bend according to the target curve. The modeling operation corresponding to the curve binding modifier is to bind the sub-object to the target curve and control the deformation of the sub-object through the target curve. The modeling operation corresponding to the stretch modifier is to divide the vertices of the sub-object into two parts according to the length relationship, one part follows the previous control point to move, and the other part follows the other control point to move. The modeling operation corresponding to the curve modeling modifier is to sweep along the target curve according to the given sub-object (cross-sectional shape) to generate a model.
[0061] Of course, in the above examples, only some target modifiers such as array modifier, curve modifier, curve binding modifier, stretch modifier and curve modeling modifier are cited. In actual application, different modifiers can be configured according to different needs.
[0062] Accordingly, in step 130 , a new target object may be generated by a target modifier based on the adjusted target curve and the dynamic mesh corresponding to the at least one sub-object.
[0063] Here, because the target curve controls the shape of at least one sub-object, when the target curve is adjusted, the shape of the at least one sub-object should change to follow the adjusted target curve. In this case, the target modifier can sample the adjusted target curve, adjust the parameters of the modeling operation pre-configured by the target modifier, and then re-execute the modeling operation pre-configured by the target modifier to modify the shape of the dynamic mesh corresponding to the at least one sub-object, generating a new target object.
[0064] Therefore, through the target modifier and dynamic mesh, users can ignore the complex modeling operations and complete the deformation operations on the target object by adjusting the target curve, which greatly improves the user experience.
[0065] In some possible implementations, the target modifier is configured to implement preconfigured modeling operations through a plurality of tasks.
[0066] Here, the script program for implementing the modeling operation in the target modifier is implemented by executing multiple tasks. In other words, each target modifier can be composed of multiple tasks (jobs).
[0067] For example, the first task of a target modifier might be to update the target curve, the second task might be to calculate the position of each vertex on the child object (model), the third task might be to calculate the child object's normals, and the fourth task might be to calculate the child object's bounds. By executing these four tasks, the dynamic mesh corresponding to the child object can be deformed according to the target curve.
[0068] Accordingly, the target tasks that need to be recalculated among multiple tasks can be determined based on the adjusted target curve, and the target tasks can be written into the task queue. Then, the target tasks in the task queue can be executed concurrently through multiple threads to generate a new target object based on the adjusted target curve and the dynamic mesh corresponding to at least one sub-object.
[0069] Here, since each Target Modifier is composed of multiple tasks, transforming the shape of the dynamic mesh through the Target Modifier is actually transforming the shape of the dynamic mesh by executing multiple pre-configured tasks.
[0070] The target tasks that need to be recalculated among multiple tasks can refer to tasks whose parameters have been modified by the adjusted target curve. Of course, the target tasks that need to be recalculated among multiple tasks can also refer to tasks corresponding to all target modifiers associated with the deformed sub-objects of the target object.
[0071] As shown in Figure 2 , the user moves third control point 206 downward, and accordingly, the endpoints of second and third line segments 202 and 203 move downward. At this point, because second line segment 202 controls the shape of second sub-fence 209 and third line segment 203 controls the shape of third sub-fence 210, the shapes of second and third sub-fences 209 and 210 should change, while the shape of first sub-fence 208 remains unchanged. In other words, the target modifier tasks corresponding to second and third sub-fences 209 and 210 require recalculation, while the target modifier task corresponding to first sub-fence 208 does not.
[0072] Figure 5 is a schematic diagram illustrating the execution of a target task according to some embodiments. As shown in Figure 5, when the target curve changes, the target modifier associated with the DynamicMesh changes. When the target modifier changes, the target task that needs to be recalculated enters the job queue. Multiple threads then concurrently execute the target tasks in the job queue, generating a new target object based on the adjusted target curve and the dynamic mesh corresponding to at least one child object.
[0073] Among them, executing the target tasks in the task queue concurrently by multiple threads may refer to assigning the target tasks that can be executed concurrently in the task queue to multiple threads for execution. Among them, the target tasks that can be executed concurrently may be determined based on the dependency relationship between the target tasks. Of course, executing the target tasks in the task queue concurrently by multiple threads may also refer to splitting a target task into multiple subtasks and then executing the multiple subtasks concurrently. For example, assuming that a virtual object has 10,000 vertices and the target task is a task of calculating vertices, the target task can be split into 5 subtasks, each subtask is responsible for calculating 2,000 vertices, and then the 5 subtasks can be assigned to 5 threads to execute.
[0074] In some embodiments, the target task in the task queue can be dispatched to multiple threads for concurrent execution through a component of the game engine for multi-threaded parallel processing.
[0075] If the game engine is Unity (a real-time 3D interactive content creation and operation platform), the component used for multi-threaded parallel processing can be the Job System. The Job System is a multi-threaded parallel processing component in the Unity engine. The Job System can distribute tasks to multiple threads for parallel processing, thereby improving game performance. The Job System achieves task parallelization through the use of jobs and job groups (Job System Groups), while also providing secure memory management and support for data parallel processing.
[0076] The Job System allows you to decompose computationally intensive tasks in the task queue into multiple subtasks, which can then be executed in parallel using multithreading. Furthermore, the Job System allows you to select concurrently executed tasks from the task queue based on inter-task dependencies, and then execute multiple tasks in parallel using multithreading.
[0077] It is worth noting that the number of multiple threads can be determined by the game engine, that is, how many threads the game engine can provide for concurrent execution of tasks.
[0078] The electronic device can dispatch the target tasks in the task queue to multiple threads for concurrent execution by calling the component for multi-threaded parallel processing in the game engine.
[0079] It should be understood that since each target modifier consists of a series of tasks, executing these tasks serially would be very time-consuming. This is particularly true on mobile devices, where computing power is limited. If tasks are executed serially, the target object's deformation speed will be very slow, significantly impacting the user experience. In the disclosed embodiments, the Unity engine's Job System is used to enable parallel execution of tasks, improving the target object's deformation speed on mobile devices.
[0080] Therefore, through the above implementation, the real-time deformation speed of the target object can be improved, and even on a mobile terminal, it can be ensured that the user can smoothly use the object control method of the virtual scene provided by the present disclosure to model in the virtual scene.
[0081] In some feasible implementations, before executing the target task, the source code corresponding to the target task is compiled into assembly language code by a compiler.
[0082] Here, each target task can be understood as a script program. Before executing the target task, the source code corresponding to the target task can be compiled into assembly language code by calling a compiler to improve the execution speed of the target task.
[0083] The compiler can be the Burst Compiler in the Unity engine (a compiler within Unity that compiles source code into machine code specific to a specific hardware platform at runtime). The electronic device can call the Burst Compiler in the Unity engine to compile each task written in C# into assembly language code. Because assembly language is a textual representation of binary instructions, it corresponds one-to-one with the instructions and can be executed by the central processing unit. Therefore, by converting to assembly language code, the execution of tasks can be accelerated.
[0084] Therefore, by compiling the source code of the target task into assembly language code in advance, the speed of task execution can be further improved, thereby ensuring that users can smoothly use the object control method of the virtual scene provided by the present disclosure to model in the virtual scene.
[0085] In some feasible implementations, in step 120, the electronic device may display an operation control for adjusting the control point in response to a selection operation on any control point, and adjust the control point in response to an adjustment operation on the operation control to obtain an adjusted target curve.
[0086] Here, the user can trigger the display of the control control for adjusting the control point by selecting any control point. The user can then adjust the control point by adjusting the control to obtain the adjusted target curve.
[0087] It should be understood that for different types of target curves, the operations provided by the operation controls corresponding to the control points may be different. For example, the operations provided by the operation controls corresponding to the control points may include but are not limited to one or more of a move operation and a rotation operation.
[0088] Figure 6 is a schematic diagram illustrating an operation control according to some embodiments. As shown in Figure 6, when a user clicks a control point 303, an operation control 601 corresponding to the control point 303 may be displayed. The user can then move the control point 303 by moving the operation control 601. In other words, the control point 303 can move along with the movement of the operation control 601.
[0089] Therefore, by operating the control, the user can adjust the position of the control point more conveniently and intuitively.
[0090] In some possible implementations, the target object is set in the virtual scene via a game engine editor. Accordingly, in step 110, in response to a modification operation on the target object in the virtual scene, the target curve associated with the target object and the control points corresponding to the target curve are displayed within the runtime environment of the game engine.
[0091] Here, the target object is set in the virtual scene through the game engine's editor. Taking the Unity engine as an example, game developers can add target objects to the virtual scene through the Unity engine's editor during the game development process. Among them, game developers can associate a sub-object with a deformable target object by selecting any curve from a polyline, rounded polyline, catenary, and Bezier spline, and selecting one or more modifiers from an array modifier, a curve modifier, a curve binding modifier, a stretch modifier, and a curve modeling modifier to set a deformable target object in the virtual scene. In other words, game developers can select different curves and modifier combinations to obtain different deformable target objects.
[0092] In the runtime environment of the game engine, players can control the target object to display its associated target curve and the control points of the target curve through modification operations, thereby adjusting the shape of the target object in the virtual scene at runtime.
[0093] Therefore, through the interaction between the editor and the user in the runtime environment, players can adjust objects in the virtual scene, thereby increasing the gameplay and fun of the game and greatly improving the user's gaming experience.
[0094] It is worth noting that the number of target curves associated with a target object may also be multiple. In other words, there may be multiple target curves used to control the shape of at least one sub-object.
[0095] In some possible implementations, the target curve associated with the target object includes an axis for controlling the direction of the target object and a contour line for controlling the appearance contour of the target object.
[0096] For example, if the target object is a road, the road's direction is controlled by its axis, which determines the direction and distance of the road's extension. The road's appearance is controlled by its contour line, which determines the road's width and shape.
[0097] As shown in FIG3 , the target curve 302 is the axis of the direction of the target object 301. The upper and lower contour lines of the target object 301 control the appearance of the target object 301.
[0098] Accordingly, the electronic device may display the axis and / or contour line, and the control points corresponding to the axis and / or contour line in response to a modification operation on the direction of the target object and / or the appearance contour of the target object.
[0099] Here, the modification operation for the direction of the target object and / or the appearance outline of the target object may refer to an edit operation for the direction of the target object and / or the appearance outline of the target object triggered by the user. The user may trigger the modification operation by clicking the position of the axis and / or contour line of the target object.
[0100] When a user chooses to modify the orientation and / or outline of a target object, the electronic device displays the target object's axis and / or outline, along with the control points for displaying the axis and / or outline. The user manipulates the control points to obtain the adjusted axis and / or outline, and then generates a new target object based on the adjusted axis and / or outline, combined with at least one sub-object.
[0101] It's worth noting that users can modify the direction and / or appearance of a target object based on their needs. For example, as shown in Figure 3, target curve 302 is the axis of the direction of target object 301. If the user needs to modify the direction of target object 301, they can adjust the control points of target curve 302. The upper and lower contour lines of target object 301 control the appearance of target object 301. If the user needs to modify the appearance of target object 301, they can adjust the control points of these upper and lower contour lines.
[0102] Therefore, by displaying the axis and / or contour line of the target object and the control points of the axis and / or contour line, the user can adjust the direction and / or contour of the target object to increase the freedom of building the virtual scene.
[0103] In some feasible implementations, the electronic device can, in response to a curve change operation on a target object, modify the target curve associated with the target object to a target curve associated with another object in a virtual scene, and then generate a new target object based on the modified target curve of the target object, wherein the shape and position of the new target object match the target curve associated with the other object.
[0104] Here, the curve modification operation for the target object may refer to an editing operation triggered by a user for modifying a target curve associated with the target object. The triggering operation may be triggered by a control or a preset control instruction.
[0105] It should be understood that each object in the virtual scene may have a target curve for controlling the shape of at least one sub-object. In other words, each object may be associated with one or more target curves for controlling the shape of the object by default.
[0106] If the user needs to change the default target curve associated with a target object to a different type of curve, they can do so using the curve modification operation. For example, the user can select a target curve associated with another object in the virtual scene and associate the selected target curve with the target object, thereby changing the target object's default target curve to the user-selected target curve. In other words, the target curve associated with the other object in the virtual scene becomes the target object's new target curve.
[0107] The electronic device then generates a new target object based on the modified target curve of the target object. In other words, the new target object is generated based on at least one sub-object and a target curve associated with another object. The shape and position of the target curve associated with the other object remain unchanged in the virtual scene. Instead, the electronic device moves at least one sub-object included in the target object onto the target curve associated with the other object and changes the shape of the at least one sub-object based on the target curve associated with the other object.
[0108] For example, when a user edits a target object, a railing, in a virtual scene, if the user wants the railing to be arranged close to the contour line of the road (another object in the virtual scene), the target curve associated with the railing can be modified to the contour line of the road. Then, the new railing generated based on the contour line of the road can be arranged close to the contour line of the road without the user having to repeatedly adjust the placement of the railing and the control points of the target curve of the railing.
[0109] FIG7 is a schematic diagram illustrating modifying a target curve according to some embodiments. As shown in FIG7 , the shape of a first target object 701 is controlled by a first target curve 702 comprising four control points. A second target object 703 in the virtual scene has a contour line 704. If a user wishes to arrange first target object 701 along the contour line of second target object 703, they can modify the first target curve 702 associated with first target object 701 to contour line 704 through a curve modification operation. The shape of first target object 701 is then adjusted based on contour line 704, allowing first target object 701 to be arranged along contour line 704.
[0110] Therefore, by modifying the target curve associated with the target object to the target curve associated with another object in the virtual scene, the target object in the virtual scene can quickly change its shape according to the target curve associated with the other object, greatly improving the efficiency of users setting virtual items in the virtual scene.
[0111] FIG8 is a schematic diagram of a structure of an object control device for a virtual scene according to some embodiments. As shown in FIG8 , an embodiment of the present disclosure provides an object control device 800 for a virtual scene, and the object control device 800 for a virtual scene includes:
[0112] A first response module 801 is configured to, in response to a modification operation on a target object in a virtual scene, display a target curve associated with the target object and control points corresponding to the target curve, wherein the target object is obtained based on at least one sub-object and the target curve, and the target curve is used to control the shape of the at least one sub-object;
[0113] A second response module 802 is configured to obtain an adjusted target curve in response to the adjustment operation on the control point;
[0114] The generating module 803 is configured to generate a new target object according to the adjusted target curve and the at least one sub-object.
[0115] Optionally, the at least one sub-object is associated with a dynamic mesh, and the dynamic mesh is associated with at least one target modifier, wherein the target modifier is configured to modify the dynamic mesh associated with the at least one sub-object according to a pre-configured modeling operation and in combination with the target curve to obtain the target object;
[0116] The generating module 803 is specifically configured to:
[0117] A new target object is generated by the target modifier according to the adjusted target curve and the dynamic mesh corresponding to the at least one sub-object.
[0118] Optionally, the target modifier is configured to implement the preconfigured modeling operation through a plurality of tasks;
[0119] The generating module 803 is specifically configured to:
[0120] Determining a target task that needs to be recalculated among the multiple tasks according to the adjusted target curve, and writing the target task into a task queue;
[0121] The target tasks in the task queue are concurrently executed through multiple threads to generate a new target object according to the adjusted target curve and the dynamic mesh corresponding to the at least one sub-object.
[0122] Optionally, the generating module 803 is specifically configured to:
[0123] The target tasks in the task queue are dispatched to multiple threads for concurrent execution through a component of the game engine for multi-threaded parallel processing.
[0124] Optionally, the object control device 800 of the virtual scene further includes:
[0125] The compiling module is configured to compile the source code corresponding to the target task into assembly language code through a compiler before executing the target task.
[0126] Optionally, the second response module 802 is specifically configured to:
[0127] In response to a selection operation on any of the control points, displaying an operation control for adjusting the control point;
[0128] In response to an adjustment operation on the operation control, the control point is adjusted to obtain an adjusted target curve.
[0129] Optionally, the target object is set in the virtual scene through an editor of a game engine, and the first response module 801 is specifically configured to:
[0130] In the runtime environment of the game engine, in response to a modification operation on a target object in the virtual scene, a target curve associated with the target object and control points corresponding to the target curve are displayed.
[0131] The functional logic executed by each functional module in the object control device 800 of the virtual scene has been described in detail in the part about the method, and will not be repeated here.
[0132] Reference is now made to FIG9 , which illustrates a schematic diagram of the structure of an electronic device (terminal device or server) 900 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device illustrated in FIG9 is merely an example and should not limit the functionality or scope of use of the embodiments of the present disclosure.
[0133] As shown in Figure 9, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0134] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although FIG9 shows the electronic device 900 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0135] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0136] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0137] In some embodiments, the electronic devices can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0138] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0139] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: in response to a modification operation on a target object in a virtual scene, displays a target curve associated with the target object and a control point corresponding to the target curve, wherein the target object is obtained based on at least one sub-object and the target curve, and the target curve is used to control the shape of the at least one sub-object; in response to an adjustment operation on the control point, obtains an adjusted target curve; and generates a new target object based on the adjusted target curve and the at least one sub-object.
[0140] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0141] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0142] The modules described in the embodiments of the present disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the module itself.
[0143] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0144] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0145] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0146] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0147] Although the subject matter has been described using language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. Regarding the apparatus in the above-described embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method and will not be elaborated upon here.
Claims
1. A method for controlling an object in a virtual scene, comprising: In response to a modification operation on a target object in a virtual scene, a target curve associated with the target object and control points corresponding to the target curve are displayed, wherein the target object is obtained according to at least one sub-object and the target curve, and the target curve is used to control the shape of the at least one sub-object; In response to the adjustment operation on the control point, obtaining an adjusted target curve; A new target object is generated according to the adjusted target curve and the at least one sub-object.
2. The method according to claim 1, wherein: The step of obtaining an adjusted target curve in response to the adjustment operation on the control point comprises: In response to a selection operation on any of the control points, displaying an operation control for adjusting the control point; In response to an adjustment operation on the operation control, the control point is adjusted to obtain an adjusted target curve.
3. The method according to claim 1, wherein: The at least one sub-object is associated with a dynamic mesh, the dynamic mesh is associated with at least one target modifier, and the target modifier is configured to modify the dynamic mesh associated with the at least one sub-object according to a preconfigured modeling operation and in combination with the target curve to obtain the target object; The generating a new target object according to the adjusted target curve and the at least one sub-object includes: A new target object is generated through the target modifier according to the adjusted target curve and the dynamic mesh corresponding to the at least one sub-object.
4. The method according to claim 3, wherein: The target modifier is configured to implement the preconfigured modeling operation through a plurality of tasks; The step of generating a new target object according to the adjusted target curve and a dynamic mesh corresponding to the at least one sub-object by the target modifier includes: Determining a target task that needs to be recalculated among the multiple tasks according to the adjusted target curve, and writing the target task into a task queue; The target tasks in the task queue are concurrently executed through multiple threads to generate a new target object according to the adjusted target curve and the dynamic mesh corresponding to the at least one sub-object.
5. The method according to claim 4, wherein: The method of concurrently executing target tasks in the task queue through multiple threads includes: The target tasks in the task queue are dispatched to multiple threads for concurrent execution through a component of the game engine for multi-threaded parallel processing.
6. The method according to claim 4 or 5, further comprising: Before executing the target task, the source code corresponding to the target task is compiled into assembly language code by a compiler.
7. The method according to claim 1, wherein: The target object is set in the virtual scene through an editor of the game engine, and the target curve associated with the target object and the control points corresponding to the target curve are displayed in response to the modification operation on the target object in the virtual scene, including: In the runtime environment of the game engine, in response to a modification operation on a target object in the virtual scene, a target curve associated with the target object and control points corresponding to the target curve are displayed.
8. The method according to claim 1, wherein: The target curve associated with the target object includes an axis line controlling the direction of the target object and a contour line controlling the appearance contour of the target object; In response to the modification operation on the target object in the virtual scene, displaying the target curve associated with the target object and the control points corresponding to the target curve includes: In response to a modification operation on the direction of the target object and / or the appearance contour of the target object, the axis line and / or the contour line are displayed, and control points corresponding to the axis line and / or the contour line are displayed.
9. The method according to claim 1, further comprising: In response to a curve modification operation on the target object, modifying a target curve associated with the target object to a target curve associated with another object in the virtual scene; A new target object is generated according to the modified target curve of the target object, wherein the shape and position of the new target object match the target curve associated with the other object.
10. An object control device for a virtual scene, comprising: A first response module is configured to display a target curve associated with the target object and control points corresponding to the target curve in response to a modification operation on the target object in the virtual scene, wherein the target object is obtained according to at least one sub-object and the target curve, and the target curve is used to control the shape of the at least one sub-object; A second response module is configured to obtain an adjusted target curve in response to the adjustment operation on the control point; The generating module is configured to generate a new target object according to the adjusted target curve and the at least one sub-object.
11. A computer readable medium having a computer program stored thereon, wherein when the program is executed by a processing device, the steps of the method according to any one of claims 1 to 9 are implemented.
12. An electronic device comprising: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Game scene display method and device, electronic equipment and storage medium
CN113230651A
Virtual item use method and device, terminal and storage medium
CN113813594A
Virtual image editing method and device, medium, electronic equipment and program product
CN116271832A
Object control method and device of virtual scene, medium and electronic equipment
CN117717779A
Animating a virtual object in a virtual world
US20170221249A1