Hi, I have Vector3 points representing x,y and z. I want those points to make 2D points but the view must be like 2.5D view.
For example, I have this 3D shape
Now I find the points (3D points) of this shape according to camera view. And the output is like:
The above screenshot (black lines) are drawn by using line renderer. I draw lines from the position of Vertex 1 to Vertex 2. The 3D output is okay. But my actual target is get points in 2D only, while the output should be same like in the above screenshot of 3D view.
Now I want same output by using Vector2 having x and y only.
I tried to add Z position of each point with x and y.
i.e
Actually I have to use that Vector2D points in other projects like CAD drawings as well. So I want all points in Vector2. Is there any simple demo for recommendation? Thanks for nice suggestion
That’s trivial, that’s just the object holding your data, and your CAD software doesn’t have a “Unity Vector2” in any case, so you are going to have to export it. In Unity you can cast any Vector3 to a Vector2 anytime you want.
No, we have our own company’s CAD system. Also that CAD can export our project points into the actual CAD software points as well. These Vector2 points can be used as x and y in CAD in future
public Vector2 V3To2(Vector3 point)
{
Vector2 newPos = Camera.main.WorldToScreenPoint(point);
newPos /= 100.0f; //If posiition is out of camera screen
return newPos;
}
You are genious, it worked perfectly. Thank you so much.