Reputation: 33
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?
Upvotes: 1
Views: 8672
Reputation: 308
For those who are struggling (like myself, once):
Upvotes: 0
Reputation: 1405
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
Upvotes: 1