Download

Draw 3d lines over landscape

Hello everyone,

I’m working on a grid-based game and I’m trying to dynamically render 3D lines over a landscape that will indicate the range of movement, something similar to the attached screenshot. Notice how the lines are curved so that they are exactly over the terrain, even if there are bumps.

I’ve tried dynamically spawning static mesh instances but this doesn’t seem very elegant (Need to create a texture with a white line for every direction).

What would be the best way to achieve something like that?

Thank you

Isn’t that a really good way of doing it though?

Gradient.PNG.jpg
It has issues with default render target filtering. i found unfiltered texture group, but that won’t allow to easily get outline.

You can inherit from FPrimitiveSceneProxy, override the ‘GetDynamicMeshElements’ method, using Collector.GetPDI() to get a FPrimitiveDrawInterface, then using its DrawLine method.

Here is an example.

You can also check my Grid plugin, the LineComponent and GridOutlineComponent maybe helpful.

You can inherit from FPrimitiveSceneProxy, override the ‘GetDynamicMeshElements’, using Collector.GetPDI() to get a FPrimitiveDrawInterface, then using its DrawLine method.

here is an example.

you can also check my plugin. the GridOutlinePrimitiveComponent.h and GridOutlinePrimitiveComponent.cpp maybe helpful