How to visualize the field of view of a sensor in UE4.26 ? Please check the image in description for reference

Hallo
I am exploring the option to visualize the field of view of a sensor, which is in 3D - Square pyramid. I gone through many tutorials and things and can’t able to find a way. I saw some with 2D line of vision, but it is not working. Can anyone able to shed some light intowhat method I have to adopt here. I am attaching the image and i want to make the field of view like in the image.
ray_casting

As for example image, it can be done with help of #include "DrawDebugHelpers.h", which have a function for drawing debug line(and many others).

The rest is the implementation problem. I assume you have 5 points of your pyramid:

  • draw thick lines between each pair of points;
  • pick a top point and in cycle draw a few dozens of lines to pyramid foundation with a resolution you need.

If this doesn’t help, then please explain which moment exactly is a problem in the process above.

1 Like

I believe the thing you’re looking for is Point Clouds.

This is a Unity project, but might help with some things you might be looking to achieve

1 Like

Hallo @IrSoil

thanks for the insight. In my case, I have the vertical and horizontal angle for the square pyramid and doesnot have the pyramid points. What can I do in this case ? Also can we able to draw square with debug line functions ?

Hallo, i checked this and this is another simulator like CARLA. I just need a way/method to draw the field of view lines.

In any case, even if you don’t have the points of the pyramide, you have to get them.

It’s not quite clear for me which exact angles you talking about, but for sure you can calculate all the points from starting data you have with help of some simple math&geometry.

Also can we able to draw square with debug line functions ?
I don’t remember if there a separate function for this, but square is still a 4 lines between 4 points, so DrawDebugLine is enough.

Also note that DrawDebug*() functions are limited to debug purpose and if you going to use it for shipping of your finished application then you have to google some other ways to draw. If visualizing in the editor is enough for your task - then just ignore this

Hey, i can get the points of the pyramid to visualise the square pyramid. But what you mena by other ways to draw the cone. Does it not work while playing the game ?
I just need the lines while playing the game.

I’ve just used an actual cone / triangle mesh and adjust its scale for something like this. You can toggle its render visibility for debug purposes. Defining a shape programmatically just seems like reinventing wheel to me, though perhaps there is some benefit depending on use case.

1 Like

Using the triangular mesh will have an effect on the physics of the player ?

you can turn off collision and/or physics