Ringworld and such

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Gregor
Posts: 3
Joined: 17.04.2002
With us: 22 years 7 months

Ringworld and such

Post #1by Gregor » 17.04.2002, 02:26

OK, so one of the first things I decided to do to hack Celestia is to try adding an object like Larry Niven's Ringworld (sort of an equatorial slice of a dyson sphere, for those who don't know).

I made a quick and dirty 3ds model of the ringworld and the shadow squares that give it day and night, and I grabbed various bits of data from the web (url is below).

The main things left to do are to find (or invent) the correct star to place Ringworld around (I put it around Sol for testing), and to texture the model.

Does anyone know off the top of their head of any G3 Ve stars 201 lightyears from Sol and 248 lightyears above the galactic plane? 8)

One oddity I noticed is that -- since I had to fool Celestia into thinking that the thing is just a very large planet -- Ringworld is not properly lit, nor do the shadow squares actually cast shadows on it. I assume the program casts light to/from the center of planets ... which is the star itself in this case.

I could fix the shadow square eclipsing problem by making each shadow square a separate body and just putting them in the same orbit, but that would be annoying, and does nothing to correct the light sourcing on Ringworld itself.


Here is the ssc file if anyone wants to sanity check it:

Code: Select all

# Larry Niven's Ringworld v1.0
#
# Note: This file is based on the Ringworld setting by Larry Niven.
# It is purely fictional and very much derivative.
#
# Data for the Ringworld was obtained from:
# http://www.alcyone.com/max/reference/scifi/ringworld.html


"Ringworld" "Sol"
{
   Mesh      "ringworld.3ds"
   Radius      153000000 # 1.02 au

# The Ringworld's center doesn't orbit the star like a planet's;
# instead, the entire thing IS an orbital band.  Still, Celestia
# doesn't seem to like it without this info.

   EllipticalOrbit {
      Period            100  # who cares?
      SemiMajorAxis     0.0000001 #  # Is zero valid?
      Eccentricity      0.0000001 # Is zero valid?
   }

   RotationPeriod 218.64 # 9.11 days
   Albedo 0.1
}


"Shadow Squares" "Sol"
{
   Mesh      "shadowsquares.3ds"
   Radius      43900000 # 0.293 au

   EllipticalOrbit {
      Period            100
      SemiMajorAxis     0.0000001
      Eccentricity      0.0000001
   }

   RotationPeriod 340.8 # 14.2 days
   Albedo 0.1
}
- Jimmy "Gregor" McKinney

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #2by Rassilon » 17.04.2002, 07:53

This is going to be cool...

On shadows...eclipse shadows dont cast them right?

The only other downfall is not being able to add an atmosphere and cloud cover...Now that really be awsome!

btw, Do you need a texture for it?
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Guest

Post #3by Guest » 17.04.2002, 15:22

Rassilon wrote:This is going to be cool...

On shadows...eclipse shadows dont cast them right?

Nope. What happens is that Celestia thinks that the ring is actually a spherical planet located more or less right next to the star, so half of the ring is in "day" and half is in "night". Same is true for the shadow squares.

Hmm. It also occurs to me that Celestia thinks that the shadow squares are in exactly the same orbit as the ringworld itself. They'll never cast shadows on it that way, even if the lighting on the ring worked right... doh. :roll:

I assume the lighting problem would be a fairly tough fix. While it is relatively simple to trace a single ray from a mesh's origin to the primary's origin to determine if something is eclipsing it (which I assume is how Celestia goes about it), this obviously doesn't work for a proper Ringworld.

Any solution I can immediately see that doesn't require changes to the model would require ray calculations from several points all along the inner circumference, which slows things down.

I could change the model so that each short segment of the Ringworld was an independent object merely sharing the same orbit as the other segments (just like I may do for the shadow squares). But I think spreading them out along the orbit might be a bit tedious (I'm just assuming it is possible; I don't know), and the resulting object would probably have ugly seams and gaps.

This lighting problem seems likely to exist for any sort of structure that surrounds a star in Celestia rather than orbiting it, such as a Dyson sphere. It'll be lit precisely like an inside-out planet. (And the solution gets even slower for a Dyson Sphere, since you have to account for rays traced along the vertical circumference as well as the horizontal.)

There are some other problems with objects of this type that I didn't mention:

The first is with the "click on an object to select it" system. There probably isn't a problem if you have a Dyson Sphere, which is close to the size of its bounding box, but with Ringworld, it interferes with selecting stars that are quite obviously not anywhere near the object. It also prevents you from click-selecting anything inside the ring, at least if the camera is not physically inside as well. The only fix I can think of is to test whether polygons of the mesh actually lie at the point the user clicked, once we have determined that they clicked inside the bounding box.

The second problem has to do (apparently) with the order in which that Celestia draws objects. Ringworld's radius is just larger than Earth's orbital radius. When you are looking at Earth, sometimes the planet disappears into/behind Ringworld even though it should be in front of it, and vice versa. Again, this is probably because Celestia believes the ringworld to be in a much closer orbit to the star than the mesh indicates. The order also seems to change depending on whether the object is selected.

Finally, Celestia seems to use some sort of far clipping plane thing. The result is that when you look at the "Great Arch" that the ringworld is supposed to produce as seen from its inner surface, a largish section directly opposite the star from your position is not drawn because it is too far away.

The only other downfall is not being able to add an atmosphere and cloud cover...Now that really be awsome!

btw, Do you need a texture for it?


Well, if you want to do one, sure. I could probably do one myself, but I really have much more interest in making the thing and getting it to show up reasonably than in polishing it off.

By the way, the Ringworld right now is literally just a ring. I haven't attempted to model the rim walls or any sort of structures other than the squares (I didn't have the one book in the series that I own handy, and it may even be unnecessary due to the scale of the thing). While it is to actual scale in diameter and in the width above and below the ecliptic, it is not to scale as far as cross sectional thickness goes. I just wanted to get the thing working first.

Incidentally, I happen to have lying around on my harddrive a partially completed model of Arthur C. Clarke's Rama spacecraft (cf. Rendezvous with Rama). It would be fairly simple to convert it to 3ds and put it in Celestia. But it'd be pretty dark without some sort of internal light source to mimic the linear suns, so I may hold off on that. From the outside, Rama is pretty much just a big spinning cylinder with some bumps on the end, and that's not terribly interesting.

Other things I've considered making are Babylon 5 and a Crystal Shell style solar system ala the old TSR Spelljammer setting (flat or hemispherical planets, platonic solids as planets, etc).

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #4by Rassilon » 17.04.2002, 15:47

As soon as Chris adds more features for MAX materials then I could see a good future in models in Celestia used as Celestial bodies...The Crystal Spheres you mention...are simply quartz looking planets? I thought of doing those at one point...I did do Svartos from the Doctor Who episode Dragonfire...with Crystal (ice) Mountians on its dark side illuminated by a Night Texture, but for some reason Chris took this out of the latest Celestia updates, so I never released it...

I still do have a picture of it though...

http://cybermindtraveller.freewebspace.com/pics/svartos2.jpg

And heres a few Ringworld sites that might help a bit...

http://www.hellcrown.com/ringworld/
http://www.larryniven.org/frameset.htm
^ look under downloads and art galleries for more renderings...

As for the texture...I'll do one when you release the 3ds file...that way I can get it mapped correctly...well unless you decide to do it ;)
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #5by chris » 17.04.2002, 18:11

Anonymous wrote:Nope. What happens is that Celestia thinks that the ring is actually a spherical planet located more or less right next to the star, so half of the ring is in "day" and half is in "night". Same is true for the shadow squares.

Hmm. It also occurs to me that Celestia thinks that the shadow squares are in exactly the same orbit as the ringworld itself. They'll never cast shadows on it that way, even if the lighting on the ring worked right... doh. :roll:

I assume the lighting problem would be a fairly tough fix. While it is relatively simple to trace a single ray from a mesh's origin to the primary's origin to determine if something is eclipsing it (which I assume is how Celestia goes about it), this obviously doesn't work for a proper Ringworld.

Any solution I can immediately see that doesn't require changes to the model would require ray calculations from several points all along the inner circumference, which slows things down.

Celestia's implementation of shadows is not very general. For one, it assumes that the shadow caster is spherical. Second, self shadowing is not supported. There are lots of shadow rendering algorithms out there, but most of them assume a point light source, which isn't at all adequate for Celestia--the penumbra is a key feature of solar eclipses on Earth. I may implement some sort of stencil or depth texture shadow algorithm for irregular objects, but it will probably be restricted to rendering sharp edged shadows.

I could change the model so that each short segment of the Ringworld was an independent object merely sharing the same orbit as the other segments (just like I may do for the shadow squares). But I think spreading them out along the orbit might be a bit tedious (I'm just assuming it is possible; I don't know), and the resulting object would probably have ugly seams and gaps.

This lighting problem seems likely to exist for any sort of structure that surrounds a star in Celestia rather than orbiting it, such as a Dyson sphere. It'll be lit precisely like an inside-out planet. (And the solution gets even slower for a Dyson Sphere, since you have to account for rays traced along the vertical circumference as well as the horizontal.)
A properly coded stencil shadow algorithm would handle structures that surround a star. I could implement a fast version of the algorithm for the common case of an effectively infinite light source (distance to sun much greater than the size of the object.)

The first is with the "click on an object to select it" system. There probably isn't a problem if you have a Dyson Sphere, which is close to the size of its bounding box, but with Ringworld, it interferes with selecting stars that are quite obviously not anywhere near the object. It also prevents you from click-selecting anything inside the ring, at least if the camera is not physically inside as well. The only fix I can think of is to test whether polygons of the mesh actually lie at the point the user clicked, once we have determined that they clicked inside the bounding box.
Polygon-accurate picking is coming in version 1.2.5 . . .

The second problem has to do (apparently) with the order in which that Celestia draws objects. Ringworld's radius is just larger than Earth's orbital radius. When you are looking at Earth, sometimes the planet disappears into/behind Ringworld even though it should be in front of it, and vice versa. Again, this is probably because Celestia believes the ringworld to be in a much closer orbit to the star than the mesh indicates. The order also seems to change depending on whether the object is selected.
Another limitiation of the Celestia engine. Sorry. Celestia isn't designed for overlapping objects. The immense range of scales which Celestia has to deal with means that I have to do some rather unconventional things when rendering . . . The engine is tuned to render objects of a wide range of sizes separated by great distances. In fact, this is the opposite of most game engines, where the world consists of objects of roughly the same scale clustered tightly together. Some cases that I do want to be able to handle are spacecraft landing on asteroids or docking with other spacecraft, so some ability to handle objects with overlapping bounding spheres will be introduced. However, the need to push everything down to OpenGL's single precision FP rendering pipeline means that there will always be some cases that fail.

Finally, Celestia seems to use some sort of far clipping plane thing. The result is that when you look at the "Great Arch" that the ringworld is supposed to produce as seen from its inner surface, a largish section directly opposite the star from your position is not drawn because it is too far away.

I believe that this is fixed in the most recent version of Celestia. Are you using 1.2.4?

--Chris

Topic author
Gregor
Posts: 3
Joined: 17.04.2002
With us: 22 years 7 months

Crystal Spheres

Post #6by Gregor » 18.04.2002, 01:28

Rassilon wrote:The Crystal Spheres you mention...are simply quartz looking planets?


No, the concept is based on old theories of how the heavens worked, since people had reasoned that the distance to close objects (like planets) could be measured with parallax, but none was detectable for stars (not enough precision at the time). They decided that the stars were fixed lights.

A crystal sphere is basically a Dyson sphere large enough to encase an entire system, with "stars" embedded on the inner surface. "Stars" is a loose term in the Spelljammer setting ... they could be anything from burning torches carried by the gods to reflective jewels. Between various crystal spheres is this swirly, flammable, rainbow-colored medium called Phlogiston. Obviously I'm not expecting Celestia to simulate that :)

I'll check out those links.
- Jimmy "Gregor" McKinney

Topic author
Gregor
Posts: 3
Joined: 17.04.2002
With us: 22 years 7 months

Post #7by Gregor » 18.04.2002, 01:44

chris wrote:
A properly coded stencil shadow algorithm would handle structures that surround a star. I could implement a fast version of the algorithm for the common case of an effectively infinite light source (distance to sun much greater than the size of the object.)

Polygon-accurate picking is coming in version 1.2.5 . . .


Cool

I believe that this is fixed in the most recent version of Celestia. Are you using 1.2.4?

--Chris


I thought I was using the most recent version until you asked, since I haven't had it for very long (just under two weeks) and hadn't seen any new version announcements on the page since I got it.

Celestia is claiming to be version 1.2.2 (for Windows, bleh). However, the archive in my downloads directory and the one on the download page are both numbered 1.2.3 ... 8O Your guess is as good as mine as to which I actually have.
- Jimmy "Gregor" McKinney

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Crystal Spheres

Post #8by Rassilon » 18.04.2002, 22:47

Gregor wrote:
Rassilon wrote:The Crystal Spheres you mention...are simply quartz looking planets?

No, the concept is based on old theories of how the heavens worked, since people had reasoned that the distance to close objects (like planets) could be measured with parallax, but none was detectable for stars (not enough precision at the time). They decided that the stars were fixed lights.

A crystal sphere is basically a Dyson sphere large enough to encase an entire system, with "stars" embedded on the inner surface. "Stars" is a loose term in the Spelljammer setting ... they could be anything from burning torches carried by the gods to reflective jewels. Between various crystal spheres is this swirly, flammable, rainbow-colored medium called Phlogiston. Obviously I'm not expecting Celestia to simulate that :)

I'll check out those links.


Too bad I never got into Spelljammer...sounds really cool! You could make a sphere at a distance of 0 from the sun...with the radius of several 100 AUs and there you go...well if Im picturing it correctly...Using surface inversion and texturing you could give the appearence of stars on the inside... I could see this happening as long as the model incased the outside visibility completely!
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Ringworld and such

Post #9by marc » 22.05.2002, 06:41

Gregor wrote:Does anyone know off the top of their head of any G3 Ve stars 201 lightyears from Sol and 248 lightyears above the galactic plane?


How about HD512 / HIP 772 ? Its a G3V 200.592 ly from Sol and is perpendicular to the galactic plane. Wheter it is above or below im not sure.

On the subject of correct shadow projection. if each shadow square was modelled as a planet, and the ringworld divided into sections which were in turn modelled as separate planets. (say 8 of them) Then the shadows should work shouldnt they?.
In my hacked version of celestia (mostlyharmless) ive disabled celestia from re-calculating the center of 3ds files. this should help.

Nikola

Post #10by Nikola » 22.05.2002, 15:20

Anonymous wrote:Nope. What happens is that Celestia thinks that the ring is actually a spherical planet located more or less right next to the star, so half of the ring is in "day" and half is in "night". Same is true for the shadow squares.

Hmm. It also occurs to me that Celestia thinks that the shadow squares are in exactly the same orbit as the ringworld itself. They'll never cast shadows on it that way, even if the lighting on the ring worked right... doh. :roll:


Couldn't you make some sort of 'hotspot' in 3ds object which would not be in center but on the edge of the ring, and then put the ring into proper orbit with synchronised revolution?

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

revised ringworld

Post #11by marc » 22.05.2002, 19:31

After a very late night I've come up with this:

I havnt read the book yet. How is the scale? the ring orbits at 1AU

Image

and this

Image

some more

http://mostlyharmless.sourceforge.net/s ... world1.jpg

http://mostlyharmless.sourceforge.net/s ... world3.jpg

the ring is made up of 16 sections which are treated as planets.
The shadows are black squares with transparency built into the *.3ds model.
Each shadow square is also treated as a planet.

More work needs to be done to the textures to add more continents

Ill put the whole lot in the next mostlyharmless patch. (0.0.3)

some of the *.ssc file

"Ring Section 1" "HD 512"
{
Mesh "ringsection.3ds"
Texture "ringworld_aus.png"
Radius 30352003.9483 #O tan theta
EllipticalOrbit {

Period 0.0249589 # 9.11/365
SemiMajorAxis 1.02 #au 153000000 km
}

}


"Shadow Square 1" "HD 512"
{
Mesh "shadowsquare.3ds"
Texture "shadowsquare.jpg"

Radius 8732250 #O tan theta
EllipticalOrbit {

Period 0.038904 # 14.2/365
SemiMajorAxis 0.293 #au 4390000 km
}

}

"Ring Section shadow 1" "HD 512"
{
Mesh "ringsectionshadow.3ds"
Texture "shadow.png"
Radius 26600000 #O tan theta
EllipticalOrbit {
Period 0.038904 # 9.11/365
SemiMajorAxis 0.90 #au 153000000 km
#ArgOfPericenter 337.5
}
#RotationOffset 337.5
}

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #12by marc » 22.05.2002, 19:59

I muffed the scale. Perhaps it should look more like this. With 20 shadow squares.

http://www.rahul.net/rootbear/graphics/ ... d/rw0.html

Image

Will have another crack at it later.

Mikeydude750
Posts: 169
Joined: 31.01.2002
With us: 22 years 9 months
Location: Wisconsin

Post #13by Mikeydude750 » 22.05.2002, 22:06

Hey marc, could you post the files for your model on your site? I'd like to see it myself.

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #14by marc » 23.05.2002, 02:42

I modified celestia so it does not recalculate the center of the 3ds models, which was essential for lining up the ring.
ver 0.0.3 of mostlyharmless has the ringworld in there along with thrusters which ive just added.
goto
http://mostlyharmless.sourceforge.org for the patch.

vega1583

nice job man!

Post #15by vega1583 » 25.05.2002, 22:59

good job, but it I may, I'd like to suggest something! make the rings farther out and not quite as FAT. heh heh. and the testture could be better too. but other then that and an atmosphere nice job!


Vega1583

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

updated ringworld to scale

Post #16by marc » 29.05.2002, 16:51

oops
Last edited by marc on 29.05.2002, 16:57, edited 1 time in total.

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

updated ringworld to scale

Post #17by marc » 29.05.2002, 16:53

marc wrote:Here is my updated version of Larry Nivens ringworld. To scale this time!
The shodows even move across the landscape in sync with the shadowsquares.

Just unzip this file into your celestia directory, it will not overwrite any files.

http://sourceforge.net/project/showfile ... e_id=91975

After a while this causes celestia 1.24 to crash on my system.
athalon 1G, 512M, win2000, geforce MX400,
There is eneough time to explore it though.
I think it's something to do with the high number of ring sections (360)
There are 360 of these sections all rendered as planets and all sharing the same mech and texture.
It seems to work fine when I reduce it to 20 sections but then you cant see the whole ring.
Can anyone shed some light on this?

Some screenshots.

Image


Image

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #18by Rassilon » 29.05.2002, 17:21

This works with Celestia 1.2.4 or your version marc?
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #19by marc » 30.05.2002, 00:05

Rassilon

It did work (then crashes) on both celestia 1.2.4 and my hack.
Now the next day it just crashesbefore you even get to the system. (it did work those screenshots are from a clean version of celestia)
If you delete all but 20 of the ring sections it seems to work fine.

Does it crash on your system?

As soon as sourceforge is back up Ill have another version online that puts the ringworld around sol. This gets past the crashing when approaching the ringworld system. (but it will still crash after a while).

I like your extra solarsystems project, well done. Can i include it in Mostly Harmless?
Last edited by marc on 30.05.2002, 02:20, edited 1 time in total.

Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 9 months
Location: Altair

Post #20by Rassilon » 30.05.2002, 02:11

Its not been tried yet...but when I do I'll let you know...

On the extrasolar systems...feel free...though I am redoing alot of the textures in there...When the project is complete I sense it will be much different :mrgreen:
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!


Return to “Development”