Oolite Bulletins

For information and discussion about Oolite.
It is currently Thu Aug 17, 2017 3:27 pm

All times are UTC




Post new topic  Reply to topic  [ 67 posts ]  Go to page Previous 1 2 3 4 5 Next
Author Message
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 02, 2015 4:33 pm 
Offline
Commodore
Commodore
User avatar

Joined: Thu Nov 07, 2013 10:21 pm
Posts: 281
Is this any good?


Top
   
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 02, 2015 4:46 pm 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
Quote:
Is this any good?
Not sure.

$ python pltojs.py /usr/local/src/oolite/Resources/Config/shipdata.plist shipdata.json
Traceback (most recent call last):
File "pltojs.py", line 22, in <module>
if __name__ == "__main__": main()
File "pltojs.py", line 11, in main
plistObject = plistlib.readPlist(sys.argv[1])
File "/usr/lib/python2.7/plistlib.py", line 78, in readPlist
rootObject = p.parse(pathOrFile)
File "/usr/lib/python2.7/plistlib.py", line 406, in parse
parser.ParseFile(fileobj)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0


From what I can guess from the help file, the python library plistlib only reads the XML version.


Top
   
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 02, 2015 5:19 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
User avatar

Joined: Fri Nov 11, 2011 6:19 pm
Posts: 4008
There's a large number of nodejs modules to parse plists, most of which would probably work with in-browser JS with minimal modifications
https://www.npmjs.com/search?q=plist

(Probably quite a few of them only work with XML or Binary rather than OpenStep format plists, but you might get lucky)

_________________
OXPs: [EliteWiki] New Cargoes, [EliteWiki] Skilled NPCs, [EliteWiki] Curse of the Black Sunspot, and more


Top
   
 Post subject: Re: WebGL effort
PostPosted: Sat Jul 04, 2015 1:33 pm 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
There are now only two models but that's because I rewrote quite a few things (in preparation for multi-textures models notably) and now the data conversion process is a bit more involved.

Until I find out how to convert the plist into JSON automatically, I do it manually (it's not too hard, fortunately). I also need to insert the mesh into the "model" entry. I will focus on doing things on a very few number of ships.

I can now read data such as a the "custom view" quaternions. I created a drop-down menu to select them. Interestingly enough I don't quite get the expected view, which means there is a coordinate system mismatch somewhere.

Image

EDIT: Ok apparemment les quaternions dans les fichiers plist sont au format W X Y Z et non X Y Z W comme dans glMatrix.


Top
   
 Post subject: Re: WebGL effort
PostPosted: Sun Jul 05, 2015 1:20 pm 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
Ok I now understand how to put several ships in the scene their own attitude/position parameters.

Image

I should soon be able to tackle displacements.

I made this part in a different html page:

http://grondilu.github.io/oolite/


Top
   
 Post subject: Re: WebGL effort
PostPosted: Mon Jul 06, 2015 12:06 pm 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
I got a first prototype of the compass working.

Image

http://grondilu.github.io/oolite/test-compass.html


Top
   
 Post subject: Re: WebGL effort
PostPosted: Mon Jul 06, 2015 5:25 pm 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
OK, first try at controlling speed:

http://grondilu.github.io/oolite/test-coriolis.html

Image

Setting the matrices in the correct order and stuff was quite a headache. As a matter of fact I proceeded a bit by trial-and-error at some point so to be honest I'm not entirely sure everything is fine, but it seems OK.

Docking is obviously quite difficult without the scanner, not to mention the lack of fine tuning in the controls. But even with just the compass it seems doable.


Top
   
 Post subject: Re: WebGL effort
PostPosted: Mon Jul 06, 2015 6:09 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon May 20, 2013 9:53 pm
Posts: 2355
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Quote:
the lack of fine tuning in the controls
Nice minigame, I can "dock" without problems from any angles, just I feel myself in an Anaconda and missing the return to zero of pitch/roll when I release the keys.

_________________
OXPs by Norby


Top
   
 Post subject: Re: WebGL effort
PostPosted: Wed Jul 08, 2015 11:40 am 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
Very basic scanner prototype:

Image

http://grondilu.github.io/oolite/test-coriolis.html


Top
   
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 09, 2015 8:37 am 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
First attempt at drawing stars:

Image

http://grondilu.github.io/oolite/test-coriolis.html

I used the Hipparcos catalog and drew the stars as points on a large (1Mm but I could use any value) sphere around the observer.


Top
   
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 09, 2015 9:10 am 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
User avatar

Joined: Fri Nov 11, 2011 6:19 pm
Posts: 4008
Looking good.
Quote:
I used the Hipparcos catalog and drew the stars as points on a large (1Mm but I could use any value) sphere around the observer.
"Sphere of fixed stars" is about how Oolite does it. Ours is only at 75km - but is drawn first in the scene with depth-buffering disabled, so appears to be behind everything.

_________________
OXPs: [EliteWiki] New Cargoes, [EliteWiki] Skilled NPCs, [EliteWiki] Curse of the Black Sunspot, and more


Top
   
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 09, 2015 9:51 am 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 4897
Quote:
First attempt at drawing stars:

Image

http://grondilu.github.io/oolite/test-coriolis.html

I used the Hipparcos catalog and drew the stars as points on a large (1Mm but I could use any value) sphere around the observer.
Can I have a laser so I can pew-pew the station?

Jokes aside, I like a lot where this is going. And the flight model as it is right now is interesting, too. It kind of feels Newtonian, but I find it very challenging.

Looking forward to the full game. ;-)


Top
   
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 09, 2015 10:25 am 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
Quote:
Looking good.
Quote:
I used the Hipparcos catalog and drew the stars as points on a large (1Mm but I could use any value) sphere around the observer.
"Sphere of fixed stars" is about how Oolite does it. Ours is only at 75km - but is drawn first in the scene with depth-buffering disabled, so appears to be behind everything.
Interestingly enough, I wrote a projection matrix especially for stars, with the far plane at the infinite (that's actually possible, because mat4.perspective has a limit for f -> infinity), so I could put the actual stellar distances in real units, and it'd still work. That'd be unnecessary since no parallax would be visible, but still.


PS. Just checked by setting the radius at 1e15m. Still works. Oops, sorry, I was not looking at the local branch. 1e15m is too big for some reason. Not sure why yet.


Last edited by grondilu on Thu Jul 09, 2015 10:36 am, edited 3 times in total.

Top
   
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 09, 2015 10:26 am 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
Quote:
Jokes aside, I like a lot where this is going. And the flight model as it is right now is interesting, too. It kind of feels Newtonian, but I find it very challenging.
I suspect it's because you were looking at the compass too much, and it may still have bugs. (I've just made a few fixes but it's not tested much).


Top
   
 Post subject: Re: WebGL effort
PostPosted: Thu Jul 09, 2015 10:50 am 
Offline
Competent
Competent

Joined: Sat Jun 27, 2015 2:48 pm
Posts: 42
If I try very hard to put the stars on an astronomical distance (say 1e15m), first I get nothing if I try with Float32Array. If instead I try with a Float64Array, I get an interesting artifact :

Image

The stars seem to align on particular directions in the sky. I suspect it's because of the lack of precision in the trigonometric functions.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 67 posts ]  Go to page Previous 1 2 3 4 5 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited