Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Search found 48 matches

by grondilu
Thu Jul 02, 2015 4:23 pm
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

cim wrote:
Subentities will often be offset relative to the parent entity. From shipdata.plist for the coriolis:
If I want to make progress at some point I will have to parse this file. I deplore the choice of the plist format. Any chance there is a convertor to JSON?
by grondilu
Thu Jul 02, 2015 2:10 pm
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

There was a silly mistake in my Perl script. The Coriolis station looks much better now :

Image

Notice that I had to adjust the Z component of the dock by 500 meters. Not sure why it was not connected to the rest of the model.
by grondilu
Wed Jul 01, 2015 8:52 pm
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

Well, I have translated the mesh converter script in Perl 5, made an adjustable viewing distance for each ship, added some information messages during image loading, and imported the Mesh for the Coriolis: http://i.imgur.com/nV33V9F.png It does not look too great, unfortunately. But that's OK for a ...
by grondilu
Wed Jul 01, 2015 7:10 pm
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

Pitch and roll indicators now :

Image

The HUD is a superimosed 2D canvas. It's quite a natural choice since the HUD is supposed 2D graphics.
by grondilu
Wed Jul 01, 2015 4:47 pm
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

Well, I've finally managed to do it but that was painful. And to be honest I still don't understand everything. The code that worked was: var scale = 2000; quat.multiply(Q, Q, [Math.sin(Pitch/scale), 0, 0, Math.cos(Pitch/scale)]); quat.multiply(Q, Q, [ 0, Math.sin(Yaw/scale), 0, Math.cos(Yaw/scale)]...
by grondilu
Wed Jul 01, 2015 2:58 pm
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

Well, I failed but I get a weird behavior that is I think worth of showing, so I push the attempt anyway.

Pick the "Quaternions" option instead of "Euler" at the bottom.

http://grondilu.github.io/oolite/ships.html
by grondilu
Wed Jul 01, 2015 8:39 am
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

So I added keyboard controls (arrow keys) for pitch and roll with the Euler angles method, and as expected I encounter difficulties with large angles. For instance if you pitch +90° so that your ship becomes vertical, then roll +90° so that you show its side, then pitching again does not rotate the ...
by grondilu
Tue Jun 30, 2015 3:59 pm
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

Thanks. With this I may be able to render the Coriolis station. And if I have a Coriolis station and the ships, I can do a big part of the gameplay in space. [...] I'm very much confused by what happened to the 1.8+ cobra3. I need to think on it hard to understand what's wrong. Well, while looking ...
by grondilu
Tue Jun 30, 2015 3:39 pm
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

For the adder 1.8+ model you have on the page ATM, here's a quick hack (the main function of the fragment shader) to allow it to render properly: void main(void) { vec4 color = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t)); gl_FragColor = vec4(color.r, color.g, color.b, 1.0); } The tr...
by grondilu
Tue Jun 30, 2015 11:05 am
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

Well, this is hard. Especially since I've realized I could not reuse Oolite's default shaders : http://i.imgur.com/NM56Pit.png A bit of googling tells me that although webGL is supposed to be a javascript OpenGL API, it's not fully compatible. I don't think I'll be able to render the 1.8+ models any...
by grondilu
Tue Jun 30, 2015 9:38 am
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

Well, I have some difficulties with the textures of the 1.8+ version of the CobraIII. First, I don't know yet how to apply several textures on a mesh, so I tried with only one. And then, something went wrong anyway. Maybe skipping one of the texture messes up the vertex affectation. This needs some ...
by grondilu
Tue Jun 30, 2015 7:18 am
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

I can try, but I'm not sure where they are or how to identify them. In the 1.82 release Resource folder, look inside Models for oolite-*.dat and inside Textures for oolite-*.png files. These are the ones Oolite uses at the moment. It seems that they are much bigger. cobra3_redux.dat has less than 1...
by grondilu
Tue Jun 30, 2015 6:40 am
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

another_commander wrote:
Good job. Is it possible to do this for the newer ships (the post-1.80 ones)?
I can try, but I'm not sure where they are or how to identify them.
by grondilu
Tue Jun 30, 2015 6:04 am
Forum: Porting to other platforms
Topic: WebGL effort
Replies: 112
Views: 124919

Re: WebGL effort

My conversion script seems to be working fine, and I finally understood how to show several models in the same screen without reloading all the buffers. A very difficult part was to preload all texture images. If I don't some models just don't show up. Thanks to this guy who provided a weird, yet ef...
by grondilu
Mon Jun 29, 2015 8:37 pm
Forum: Porting to other platforms
Topic: JavaScript / Emscripten
Replies: 7
Views: 18103

Re: JavaScript / Emscripten

What we want is a full rewrite of oolite in HTML5/WebGL. ... Also, it so happens that a WebGL online course will begin in a few days on coursera: https://www.coursera.org/course/webgl I've done some playing about with Three.js, but currently have limited bandwidth due to day_job && small_ch...