0

Trying to model using C++ a 3D environnement, I plan to use the birth time at create of any object to indicate a triplet xyz...

Every stamp will be unique under the system... This is obtained by maintaining a static value preventing doublons...

this->birth = ::time(0);

static
Long double _last = 0.0;

if(this->birth > _last)
  _last = this->birth;
else
  { _last += double(0.0000001) ; 
     this->birth = _last; 
  }
                                                   

What could be the best efficient algorythm to obtain the x y and z components as coordinates on a sphere, for example...knowing that this->birth holds in its integer part the time_t value and in its decimal part the order number of the object if multiply by 1000000...

  • the question is unclear. How is the timestamp related to x,y,z coordinates? Do you perhaps want a `std::unordered_map< timestamp, object>` that lets you look up some `object`s based on the timestamp? – 463035818_is_not_an_ai Jan 25 '22 at 12:37
  • No....I will consider timestamp zero as the 3d center of the screen...what could the logical/natural place xyz of any timestamp....described in three D world's xyz coordinates... – David Harouche Jan 25 '22 at 17:10
  • I proudly modified the qiestion... you would re read it... – David Harouche Jan 25 '22 at 17:57
  • sorry, the question still reads like "I know the birth date of some persons, how can I (efficiently) get their weight?". It is unclear where you want to get xyz coordinates from `this->birth`. Are they members of some struct `object` ? – 463035818_is_not_an_ai Jan 25 '22 at 18:34
  • OK....the question could have been : noticying the serialization of an object, could I uniquly project it as an x y z coordinates on a filled sphere of radius r...? – David Harouche Jan 26 '22 at 18:01

0 Answers0