Outerra forum

Anteworld - Outerra Game => Tech demo, support, updates => Topic started by: andfly on September 17, 2014, 01:37:54 pm

Title: Help for ECEF coordinates
Post by: andfly on September 17, 2014, 01:37:54 pm
I have a technical question for cameni.
I hope  have found the right section of the forum (I read support ...).
I need to read the world position in ECEF coordinates of a model using script commands.
This possibility exists without reading the longitude latitude and height through JSBSim and perform a coordinate conversion?
I seemed to have seen it once in the Wiki, the command GET_POS (maybe I just imagined it and now can not find it).
I also tried the command get_pos_offset, but, due to problems of non-comprehension of the English language, I could not figure out if I can be useful, and however, have not been able to get any value (surely I did not use proper grammar).
Can you help me?
Title: Re: Help for ECEF coordinates
Post by: cameni on September 17, 2014, 02:04:05 pm
You can get the ECEF position from the geomob object, via get_pos()

Code: [Select]
var v = this.get_geomob(0);
var ecef = v.get_pos();
Title: Re: Help for ECEF coordinates
Post by: andfly on September 17, 2014, 02:45:54 pm
You can get the ECEF position from the geomob object, via get_pos()

Code: [Select]
var v = this.get_geomob(0);
var ecef = v.get_pos();
Thank you so much for your reply lightning !!!
If I'm not too stressful, can you explain how to read, in the variable "ecef", separate data of the coordinates x, y and z ?
I realize that for those who know Javascript should be elementary, but I did not even know the existence of Javascript before knowing Outerra and I read a manual found on the web just to be able to build something in the world of Anteworld.
Fortunately, my knowledge of the Basic language has allowed me to understand most of the possible commands,but my gaps are still huge ...
I do not claim a programming class and if the answer involves too many basics ...
forget it, no problem!
I will cover the famous manual and I will come to end.

However, really, thank you !!!
Title: Re: Help for ECEF coordinates
Post by: cameni on September 17, 2014, 02:48:41 pm
The returned variable contains x, y and z members, so you just use them simply as ecef.x, ecef.y ...
Title: Re: Help for ECEF coordinates
Post by: andfly on September 17, 2014, 02:53:30 pm
The returned variable contains x, y and z members, so you just use them simply as ecef.x, ecef.y ...
Great !!!

Thanks.