'Three.js: paths of objects

Some objects moving in 3D space. Every second they get new coordinates. It can last hours with infinite paths. The task is to see they path. I'm new in Three.js and there's my solution: https://jsfiddle.net/uL6h2amq/

I need help:

  • ‘points’ is an array of array. Example: 3 spheres, after getting 2 points:
points = [
  [ (Vector3(x, y, z), Vector3(x, y, z), ],
  [ (Vector3(x, y, z), Vector3(x, y, z), ],
  [ (Vector3(x, y, z), Vector3(x, y, z), ],
];

Is it good? Maybe there’s another approach in Three.JS?

  • a path is rendered a bit faster then a sphere. Why? How to fix it?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source