Oolite Bulletins

For information and discussion about Oolite.
It is currently Tue Nov 21, 2017 12:13 pm

All times are UTC




Post new topic  Reply to topic  [ 147 posts ]  Go to page Previous 16 7 8 9 10 Next
Author Message
PostPosted: Sat Sep 16, 2017 12:26 am 
Offline
Deadly
Deadly

Joined: Sat May 01, 2010 9:05 pm
Posts: 129
Location: Scotland
Quote:
as far as Oolite is concerned the rings are actually a single solid 3D object in the form of a square plane (think of it as a transparent canvas upon which rings are painted by the shader)
(head explodes, in slo-mo) I admit to not having done any graphics programming since implementing a Mandlebrot set in Assembler on a DOS system with a 64-colour card ... but I'd got the impression from the blurb that modern graphics cards had physics models that would do massive numbers of calculations in parallel to do things like "A in front of B" calculations.
Shrug. I'll go back to picking up the mouse-shaped microphone and instructing the computer through that. In CanaScots.

_________________
--
Shooting aliens for fun and ... well more fun.


Top
   
PostPosted: Sat Sep 16, 2017 10:07 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2469
Location: Finland
Quote:
So... here's how things are worked out at system creation time
- the planet is placed at its location
- the sun is placed in the sun_vector direction
- the planet is rotated so that its axis points along a vector described by the cross product of the sun vector and the vector [1,0,0]. This ensures the axis has a consistent direction perpendicular to the sun (All Oolite main planets have an axial tilt of 0)
- the station is placed in the direction of the station_vector
Can't get this right, cim :( . I'm probably not understanding something here.

Known problematic system is Ribior (6, 35). From planetinfo.plist I can extract the following:
Code:
station_vector = "-0.807 0.141 0.573";
sun_vector = "-0.204 -0.494 0.846";
The axis of the planet would then be parallel to:
Code:
> Vector3D(-0.204, -0.494, 0.846).cross([1,0,0]);
(-0, 0.846, 0.494)
And to see if the station is near the equatorial orbit I check the dot product:
Code:
> Vector3D(-0.204, -0.494, 0.846).cross([1,0,0]).dot([-0.807, 0.141, 0.573]);
0.402348
Not even close to zero, so something is obviously wrong somewhere. But where?


Top
   
PostPosted: Sat Sep 16, 2017 10:19 am 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
User avatar

Joined: Fri Nov 11, 2011 6:19 pm
Posts: 4015
Ah, okay - not the cross product - must have looked at the wrong line. It sets the planet orientiation to
quaternion_rotation_betweenHP(sun_dir,make_HPvector(1.0,0.0,0.0))
which in JS is either sun_vector.rotationTo([1,0,0]) or [1,0,0].rotationTo(sun_vector)

That gives you a quaternion but you can convert it back to a direction vector for the axis using .vectorForward

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


Top
   
PostPosted: Sat Sep 16, 2017 10:28 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2469
Location: Finland
Quote:
Ah, okay - not the cross product - must have looked at the wrong line. It sets the planet orientiation to
quaternion_rotation_betweenHP(sun_dir,make_HPvector(1.0,0.0,0.0))
which in JS is either sun_vector.rotationTo([1,0,0]) or [1,0,0].rotationTo(sun_vector)

That gives you a quaternion but you can convert it back to a direction vector for the axis using .vectorForward
Thanks, that's close enough. With a bit of trial and error, I got it now.
Code:
> Vector3D([-0.204, -0.494, 0.846]).rotationTo([1,0,0]).vectorUp().dot([-0.807, 0.141, 0.573]);
-0.00004321709275256769


Top
   
PostPosted: Sat Sep 16, 2017 10:55 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
@spara @cim Thank you so much for all the help, I really appreciate it.

@RockDoctor There would be other ways of doing rings, but there are many nice advantages of using shaders. For instance, instead of having a single type of ring with a single look, we can use code to generate rings in a procedural fashion, so that each one is unique. If you notice, it's not only the size and radial thickness of rings that change from planet to planet, but also the number of gaps, where those gaps are, the colour gradients are always a unique pattern, etc. so that no two rings are identical. So instead of hand crafting 500 individual rings as 3D objects, the shader code takes care of that for us. But that's just one point, and there are many other reasons why the shader solution is particularly interesting (e.g. the shadow problem that cim mentioned and which the shader code easily takes care of).


Top
   
PostPosted: Sat Sep 16, 2017 10:49 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
So the bug has been solved thanks to spara (many, many, many thanks!!). He tested all 2048 planets and it turns out only Ribior had a collision issue (at least we now know it for sure). I will be releasing a new version with the fix in the next days. Thanks you all for all the help!


Top
   
PostPosted: Sat Sep 16, 2017 11:11 pm 
Offline
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 12918
Location: Corke's Drift
Fame at last for Ribior - the only system in the Eight where you can ring-surf right into the slot!

_________________
The only good fnord is a dead fnord!


Top
   
PostPosted: Sat Sep 16, 2017 11:16 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
Quote:
Fame at last for Ribior
:lol:


Top
   
PostPosted: Mon Sep 18, 2017 11:40 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
Hi all, version 2.7 is now available in the manager. Here is the changelog:

- added "use strict"; to scripts which removes some warnings in the log.
- rings are now a little bit more common (1/8 of planets will have them).
- the description of a system will now tell whether it has rings or not (thanks phkb for the help implementing this!).
- close-up grain density now proportional to the colour intensity of the ring lane.
- fixed bug in which Ribior's main station would spawn inside rings (thanks to spara, cim and all others for the suggestions and spara for doing the all hard work for the fix).


Top
   
PostPosted: Tue Sep 19, 2017 11:15 am 
Offline
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 12918
Location: Corke's Drift
Say I want to disable rings in one particular system - can that be done?

_________________
The only good fnord is a dead fnord!


Top
   
PostPosted: Tue Sep 19, 2017 11:49 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
Quote:
Say I want to disable rings in one particular system - can that be done?
Well, it can be done but probably not as easily as you might want. You would have to change the JavaScript code and come up with a different way of selecting which planets get rings, as currently all planets with radius above a certain threshold get a ring (so systems are not specified individually). See the function this.systemWillPopulate in Scripts/systemfeatures-rings.js.

But if you don't mind me asking, are you seeing some problem, bug or ugly rings in some system out there which you'd like to disable?


Top
   
PostPosted: Tue Sep 19, 2017 11:58 am 
Offline
Average
Average
User avatar

Joined: Sat Dec 17, 2011 12:53 am
Posts: 14
Location: Deep space
Ain't no rings around Aquti, amigo!

_________________
¿Dónde está la cerveza?


Top
   
PostPosted: Tue Sep 19, 2017 12:00 pm 
Offline
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 12918
Location: Corke's Drift
No problem - the rings look fine. I'll tweak the numbers, as I did with cim's original. Arrr!

_________________
The only good fnord is a dead fnord!


Top
   
PostPosted: Tue Sep 19, 2017 12:14 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 418
@Cody Ok, let me know if you need any help.

@Coyote But was it supposed to be any rings around Aquti, amigo?


Top
   
PostPosted: Tue Sep 19, 2017 1:23 pm 
Offline
Retired Assassin
Retired Assassin
User avatar

Joined: Tue Feb 09, 2010 11:31 am
Posts: 8297
Location: Disunited Kingdom
<Chuckles>
Quote:
G'kar said "No one here is exactly what he appears"

_________________
Commander Smivs, the friendliest Gourd this side of Riedquat.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 147 posts ]  Go to page Previous 16 7 8 9 10 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 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