Download

The Problem with the function ProjectWorldToScreen and DeprojectScreenToWorld.

Hello guys,
I find a interesting BUG when using the function ProjectWorldToScreen and DeprojectScreenToWorld.
Generally speaking,it’s works well.But if the ViewOrigin is so large ,and ViewRotationMatrix is not Zreo, the problem come.
I try to place the Pawn at the location:(10000000,10000000,10000000)and set it rotation :45,45,45.And set the FOV:1.0f
Then I find a real interesting problem:The result of ProjectWorldToScreen witch WorldPosition is calculating by the result of DeprojectScreenToWorld has a large erro.
I have to find the function at \Engine\Source\Runtime\Engine\Private\GameplayStatics.cpp
And I think maybe the problem is from the function ProjectionData.ComputeViewProjectionMatrix().
I think the problem is the precision of float.But now I don’t know how to deal with it.
Do you have any advice?