# How can I convert 3d to 2d coords and get the 2d max height and width

Does any method can convert the 3d to 2d coords

I tried use the “World to Pixel”

but it do not know how to get the height and width. I think it 's relative to the camera rotation and distance.

does any one know that?

thanks very much.

You can use the HUD to project a 3d point to the screen position. Here’s some code I used in one of my prototyping experiments:

``				const FVector ScreenLoc = MyHUD->Project(Location);``

I have not understand how to get the 2d height and width from 3d objects

If you project the bounding box of the object into screen space, you then use that data to get the width and height.

I am sorry to bother you again, because I am still confusing on you explains FVector’s construction like following:
FVector
(
float f1,
float f2,
float f3
)

how can it show the information for width and height?

I guess if you want to show a bound information you should use a FVector4 something like
FVector4
{
float x,
float y,
float width,
float height,
}

For bounds, you should FBox because…that’s what we use. Then you project the min/max of the box into screen space. That gives you 2 points which you need to calculate the width/height.

ok, Now I got u means. thank you very much!

Hi，ryuikuya !
I also want get the 2D bounding box in rendered image. According to my knowledge, there isn’t any API in UE4 to realize this directly. I know there is an function GetBox() return aabb bounding box. I have tried to transform the aabb bounding box position to the image coordinate, and compute the the min and max positions of the aabb bounding box in the rendered image, but it is not accurate enough.
Have you finally achieve the purpose to get the accurate 2D bounding box in image coords. How to do such kind of thing. Thanks for any advises