Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Author Topic: Real time GPS input  (Read 11902 times)

momax

  • Newbie
  • Posts: 6
  • newbie
Real time GPS input
« on: October 13, 2013, 05:42:11 am »

Hi everyone,

i am truly amazed by the potential of Outerra...

didn't find an answer to my question in the forums and the website, but there may be one I didn't see...

Would it be feasible to script/mod Outerra in its current state so that GPS coordinates serve as real time input for spatial placement in Outerra (similar to the Googe Earth "Real Time GPS" functionality)?
That would allow for cool uses, like exploring a raw version of the surrounding landscape.

Too low level for a mod? Or maybe it is already planned for implementation as a standard functionality?

Thanks
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Real time GPS input
« Reply #1 on: October 13, 2013, 10:16:14 am »

You could use the IGC interface to control the camera & get some feedback from the world. The API allows to set camera pos & rot in ECEF coordinates, which can be converted from latitude/longitude and height. The API is accessible from a C++ module or from Javascript.
Logged

momax

  • Newbie
  • Posts: 6
  • newbie
Re: Real time GPS input
« Reply #2 on: October 13, 2013, 11:23:05 am »

thanks a lot for the quick and detailed reply  :)
Logged

momax

  • Newbie
  • Posts: 6
  • newbie
Re: Real time GPS input
« Reply #3 on: October 21, 2013, 07:23:32 am »

erm...

i'm clearly out of my league with the C++ scripting capability of Outerra...
but even for the javascript approach i am lacking the very first steps (even after doing some search&read on the forums and the wiki).

could you expand a little bit on how to call the webpage that will contain my javascript?
thanks!
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Real time GPS input
« Reply #4 on: October 21, 2013, 09:26:35 am »

There's no "official" way, but what you can do is to mod the www/map.html or www/mapnav.html files that are open when you press g or m keys to launch Google maps or OSM, respectively.

Second part is to bind to the IGC interface in Javascript. For IGC you'd do this:
Code: [Select]
var igc = $eview.$query_interface("ot::js::igc.get");

//now you can call IGC methods (ot/igc.h) on the igc object
var pos = igc.pos();
pos.x += 10;
igc.set_pos(pos);

It's a bit clumsy in JS, needs a simple math library that can operate on vectors and quaternions.
« Last Edit: October 21, 2013, 09:28:46 am by cameni »
Logged

momax

  • Newbie
  • Posts: 6
  • newbie
Re: Real time GPS input
« Reply #5 on: October 21, 2013, 09:42:32 am »

thanks, i will try like this!
Logged

goodfellow

  • Newbie
  • Posts: 6
Re: Real time GPS input
« Reply #6 on: April 12, 2017, 03:10:14 pm »

Hi cameni,

I posted a similar question here https://forum.outerra.com/index.php?topic=3727.new;topicseen#new
but after a deeper search i came to this topic and it seems more aligned with what i had in mind.
I anticipate that my programming skills are near zero so apologies if my questions are down to basics.

I would like to use Outerra on the oculus cv1 while a second screen would translate in real time the movement of the IGC on google maps (or open street map).
If it's possible, how would i achieve such? How do i find and access the Outerra API and mod the  www/map.html or www/mapnav.html files?

Thank you very much in advance!
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Real time GPS input
« Reply #7 on: April 13, 2017, 04:33:44 am »

I guess you need a separate window to show the map. OT renders only to one render target, so if you are using it for Oculus you aren't able to render something else into a separate window currently.

It could be possibly done by making a separate app that displays the maps and takes positions from the IGC api, but for that you'd need a C++ plugin that can send the data to the app. Ideally you'd just use html with Google/OSM maps and somehow get the positional data into Javascript there from the plugin.
Logged

goodfellow

  • Newbie
  • Posts: 6
Re: Real time GPS input
« Reply #8 on: April 13, 2017, 05:47:21 am »

Thank you cameni for your help and the quick reply.

Let´s see if i follow: basically i could have google maps opened on chrome/firefox/... and get a constant importing (like refreshing every second?) from the Outerra´s plug-in, correct? I´s bitter to admit that I don´t know from where to start  :facepalm:
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Real time GPS input
« Reply #9 on: April 15, 2017, 03:33:41 pm »

I guess Langdon's work with IGC is closest to this, maybe it could be adapted.
Logged

goodfellow

  • Newbie
  • Posts: 6
Re: Real time GPS input
« Reply #10 on: April 17, 2017, 07:34:50 am »

Thank you cameni,

do you refer to this? https://forum.outerra.com/index.php?topic=2705.45
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Real time GPS input
« Reply #11 on: April 18, 2017, 03:30:38 am »

Yes I think that was the thread ... but Langdon also replied in the previous thread where you posted.
Logged