x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

ConvertWorldLocationToScreenLocation has exponential growth of X value.

It appears that ConvertWorldLocationToScreenLocation is behaving incorrectly. In this example I am having an arrow point to an actor that is off screen. The arrow is positioned around the screen to show you what direction you need to scroll (in this case it's down and right). This should place the arrow in the bottom right of the screen. However when I convert the location to the screen location the X value of the screen location goes crazy and grows exponentially when I scroll vertically. When it gets too big, the node return false and results in the arrow being placed in the top left corner.

In Game Debug.

To get this effect, I use the ConvertWorldLocationToScreenLocation node and use a lerp to determine what part of the screen it should be on. I lerp X and Y individually to determine the position of the arrow widget. This is the logic behind it. Note I do make sure to scale it based on the Screen DPI. I've tried this with the location to widget position node as well and it also results in the same crazy numbers for such little movement.

Arrow positioning

It looks like it's simply saying that this position can not be project to screen space for some reason (probably reaching the limit of floats) and failing out. What I can't figure out is why the numbers are jumping so much at this distance.

Product Version: UE 4.11
Tags:
more ▼

asked Apr 28 '16 at 05:54 AM in Blueprint Scripting

avatar image

Justin.Dooley
2.1k 104 70 160

avatar image Justin.Dooley Apr 28 '16 at 06:22 PM

I'm still looking into this and have determined that the part that is failing is inside SceneView.cpp

 bool FSceneView::ProjectWorldToScreen(const FVector& WorldPosition, const FIntRect& ViewRect, const FMatrix& ViewProjectionMatrix, FVector2D& out_ScreenPos)
 {
         FPlane Result = ViewProjectionMatrix.TransformFVector4(FVector4(WorldPosition, 1.f));
         if ( Result.W > 0.0f )
         {
         ...
         }
     return false;
 }

It seems that Result is blank even though my World position is (1816.46545, 7144.05957, 272.999146). I'll keep digging!

EDIT: It seems that I can't go much further along this route. TransformFVector4 is a FORCEINLINE function and I don't really know how to debug that. Any suggestions?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The general conciseness from unreal slackers is that this is happening because the vector is moving behind the cameras plane. that's why it's failing out.

more ▼

answered Apr 28 '16 at 11:46 PM

avatar image

Justin.Dooley
2.1k 104 70 160

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question