How do you get the 2D coordinate a SceneCaptureComponent2D is projecting to?

anonymous_user_d1f1f797
Wed, 15 Nov 2017 22:11:53 +0000
UI

Okay, So I have a minimap which is being drawn from a Scene Capture Component 2D, and it captures the whole terrain. Problem is that capturing all the actors in terrain every tick causes the game to drop below 60 FPS, so my work around is to just render the terrain once on event begin play. Then draw an image widget that overlays on top of the static minimap. Afterwards, whenever the player moves, then update the player icon on the image widget to the new position. This would circumnavigate all the computation of the minimap for each and every tick.

So, here in lies my problem: I want to get the player location in the world, and then project that into the 2D coordinates that would be on my minimap.

I was trying to find a way to get the projection matrix that the scene capture component 2D uses, and then maybe try to use that to map 3D points in world space to the 2D points that I’m trying to compute. Does anyone have any suggestions? The Scene Capture Component 2D allows you to access a custom projection matrix, but I don’t want to define a custom projection matrix, I just want to grab the projection matrix that’s already being used by the Capture Component, and use that to get the coordinates I want.

5 posts - 1 participant