Problem with LineSystem

Hello everyone

I want to draw 6 triangle with the help of linesysytem, I try to do it but I cannot see any line on my PG.
this is my PG: is it possible let me know where is my error and how can I do it?

There are a number of problems:

  • you push invalid data in myPoints (line 85)
  • CreateLineSystem is expecting an array of array for the points (line 102)
  • the position of the camera is wrong (line 108)

1 Like

Thank you so much @Evgeni_Popov
in my project I have 120,000 points and the result must be like below picture:

but, when I tested this code in my final code with 120,000 points I just got the line like the line in my PG.

createLineSystem is a right way to get the final model?

Your picture is an object made of triangles it seems, so you need to create triangles.

But most importantly, you must know the structure of your point list:

  • why is it an array of a 4 vertex array in your PG?
  • what those 4 vertices represent? A quad (meaning 2 triangles)?

Given the screenshot above, I would think your points are simply the altitude of a 2D tesselated plane, so only the Y coordinate matters. If that’s the case, you could use the Babylon heightfield object: Height_Map - Babylon.js Documentation

To have a clearer view of your point list, I would create first a point cloud system: Points Cloud Particle System - Babylon.js Documentation

the json file is in this form. each 4 vertex make one triangle it means the first vertex is equal to fourth vertex ( it’s somehow multipolygon).

how can I make triangle with four point?