A method and device for solving the problem of unity3d large model punching through the mold
A large model and mold-through technology, applied in the field of 3D visualization, can solve problems such as poor visual sense and unrealistic, achieve good accuracy, avoid overlapping and inconsistency, and solve the effect of punching mold problems
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0029] Such as figure 1 As shown, a method for solving the problem of piercing the mold of the Unity3D large model includes the following steps:
[0030] S1. Calculate the edge positions around the ship, and select multiple edge points and center points;
[0031] S2. Launch ray detection vertically downward from above the set height of the edge point in step S1;
[0032] S3. In step S2, when the detection ray hits land or ships, execute steps S4 and S5;
[0033] S4. Move all the edge points by 1 unit distance in any of the four directions forward, backward, left, and right, and repeat steps S2 and S3 until all the detection rays hit the sea surface;
[0034] S5. When all the rays determined in step S4 hit the sea surface, the position of the obtained edge point is obtained to obtain a new center point position, and the vector displacement of the center point position offset is calculated, and the ship is moved to the new center point position.
[0035] When the detection ra...
Embodiment 2
[0037] Such as figure 2 As shown, a method for solving the problem of piercing the mold of the Unity3D large model includes the following steps:
[0038] S1. Calculate the edge positions around the ship, and select multiple edge points and center points;
[0039] S2. Launch ray detection vertically downward from above the set height of the edge point in step S1;
[0040] S3. In step S2, when the detection rays hit land or ships, or when all the detection rays hit the sea surface, no operation is performed.
[0041] This is the situation where the ships do not overlap and are not on land. At this time, the position of the ship conforms to the actual situation and meets the visual requirements, so there is no need to move the ship and other operations; the distance of 1 unit, here represents the smallest unit in actual research and development Displacement amount; the height set in step S2 generally selects the upper side of the height*100 to emit rays downward.
Embodiment 3
[0043] Further on the basis of embodiments 1 and 2, the specific process of step S1 is: abstract the ship model into a regular cuboid, obtain its length, width and center point, calculate the edge of the ship, and select a plurality of edge points and the center point; after the ship is abstracted, it is easier to calculate the edge of the ship; the edge point selects multiple edge points in the four positions of the front, rear, left, and right of the ship; the positions of these edge points can be evenly calculated, and the density of the edge points can be adjusted according to the actual effect. In order to achieve better accuracy, it is beneficial to subsequent ray detection.
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 

