Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

The method and medium of dragging and dropping objects by the mouse in the unity3d scene

An object and scene technology, applied in the field of Unity3D, can solve problems such as operation and maintenance troubles, achieve the effect of less code, avoid adjustment difficulties, and avoid low efficiency

Active Publication Date: 2022-05-17
宝宝巴士股份有限公司
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, it is necessary to use a new camera b to take pictures of the dragged object separately, and then fuse it with the image taken by the main camera a, which is troublesome to operate and maintain

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • The method and medium of dragging and dropping objects by the mouse in the unity3d scene
  • The method and medium of dragging and dropping objects by the mouse in the unity3d scene
  • The method and medium of dragging and dropping objects by the mouse in the unity3d scene

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0048] In order to make the present invention more comprehensible, a preferred embodiment is now described in detail with accompanying drawings as follows.

[0049] The method of the present invention is suitable for scenes where the camera is fixed and the depth of field does not change much. On the basis of the parallel dragging method of the camera viewing surface, an independent plane is introduced, which is equivalent to a plane between other objects in the scene and the camera. A piece of white paper faces the camera to cover other objects, distinguishing the two, and then through the algorithm, the object can be dragged at the mouse pointer in the screen space, and not on a separate plane in the world coordinates. Other objects coincide.

[0050] Such as Figure 1 to Figure 5 Shown, in a kind of Unity3D scene of the present invention, the method for dragging by the surface of mouse to object comprises the following steps:

[0051] Step 1. Create a plane game object (P...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention provides a method for dragging a mouse to an object by surface in a Unity3D scene, comprising: 1. creating a plane game object; 2. placing the plane game object between the plane where the scene is located and the camera; 3. starting to drag When dragging, use the built-in API of Unity to obtain the screen coordinates where the mouse is located, and obtain the ray from the camera passing through the screen coordinates in the 3D world coordinates; 4. Determine the intersection point of the extension line of the ray and the plane game object as the target position, and calculate the target position; 5. Transform the position of the dragged object into the target position, then the dragged object will be on the plane game object and under the mouse pointer, so as to realize the dragging process, as long as the plane game object is not in the scene If other objects intersect, the dragged object will not coincide with other objects. The present invention also provides a computer-readable storage medium, which can prevent the dragged object from overlapping with other objects in the scene after being dragged.

Description

technical field [0001] The invention relates to the technical field of Unity3D, in particular to a surface-based dragging method and medium of a mouse on an object in a Unity3D scene. Background technique [0002] Currently, when dragging a 3D object in a Unity3D scene, the object is generally parallel to the viewing surface of the camera. This will cause the dragged object to easily overlap with other objects in the scene during the dragging process. After overlapping, bad visual effects will occur. Affecting the user experience is something that developers do not want consumers to see. In order to avoid the occurrence of coincidence phenomenon, generally use two methods when using the Unity engine to drag and drop objects: [0003] 1. Dragging method parallel to the camera’s viewing surface: the dragged object is dragged on a dragging surface that is parallel to the camera’s viewing surface and separated by a distance x from the camera’s viewing surface. In order to ensur...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): A63F13/52G06F3/0486
CPCA63F13/52G06F3/0486A63F2300/30
Inventor 唐光宇卢学明范金良俞永浩汤非凡
Owner 宝宝巴士股份有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products