简体   繁体   中英

Draw not debug lines in UE4

Really new for Unreal Engine 4. My main point is draw transparent 3d object with sprecific border made by lines. For these i have array of points which make lines. so i have a procedural mesh for creating in c++ object, but it can only draw polygons.

After searching information about line drawing in UE4, have tried to use "draw debug lines", but it is only for debug and only for 2 points (i need draw array of points)

so - my problem is : drawing lines in c++ code of UE4.

how can i draw not debug lines?

If you have an array with all your linked point, why not iterate throught this array and create a DebugLine for each "linked points" ?

TArray<FVector> myArray = .... ;
for (size_t i = 0; i < myArray.Num() - 1; ++i)
{
    FVector LinkStart = myArray[i];
    FVector LinkEnd = myArray[i+1];
    DrawDebugLine(GetWorld(), LinkStart, LinkEnd, 
        FColor(255,0,0), false, -1, 0, 10 );
}

If you really do not want debug line, there is another method to Drawline in the SceneManagement from the FPrimitiveDrawInterface classes.(I've never used it, not sure it's the better solution for your issue)

In a harder way, you can use the procedural generation of mesh in C++, where you create mesh and populate vertices and edges. Take a look at the doc , and you may be able to adapt the code for your case

I know I am 3 years and 8 months late.

For those who are struggling (like myself, once):

Thank you :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM