跳轉到內容

Celestia/教程/衛星

來自華夏公益教科書,開放的世界,開放的書籍

在 Celestia 中,就像可以新增圍繞恆星執行的行星、小行星和彗星一樣,也可以圍繞這些天體放置衛星,甚至在這些衛星上放置衛星!本教程將向您展示如何做到這一點。

本教程假定您已閱讀上一頁:簡單小行星.

基本定義

[編輯 | 編輯原始碼]
"Name" "Sol/Parent Body"
{
	Class "class"
	Mesh "mesh.*"
	Texture "texture.*"
	Radius <number>
	Color [ <number> <number> <number> ]
	BlendTexture true

	EllipticalOrbit
	{
	Epoch	        <number>
	Period		<number>
	SemiMajorAxis	<number>
	Eccentricity	<number>
	Inclination	<number>
	AscendingNode	<number>
	ArgOfPericenter <number>
	MeanAnomaly	<number>
	}

	Albedo <number>
	RotationPeriod <number>
}

我們將逐一介紹引數。定義看起來與簡單小行星頁面中給出的定義非常相似,但有一些關鍵區別需要注意到。

此外,您可以在任何時候將註釋新增到您的 .ssc 程式碼中。註釋以 # 符號開頭,一直持續到下一行換行符。如果自己計算了引數或這些引數是猜測,新增解釋註釋是一個好主意。

引數列表

[編輯 | 編輯原始碼]

一般來說,衛星的大多數引數與小行星中的引數相同。對於網格、紋理、半徑、顏色、反照率和自轉,它們是相同的,因此請參考該頁面以獲取更多資訊。下面列出了區別。

"Name" "Sol/Parent Body"

這類似於小行星中的定義。這裡,Sol/母體 只是意味著將衛星放置在某個“母體”的軌道上,而該“母體”又繞著“Sol”(太陽)執行。這種層次結構可以無限期地擴充套件:對於衛星的衛星或亞衛星,它看起來像這樣

"Name" "Sol/Parent Body 2/Parent Body"

其中“名稱”繞著“母體”執行,“母體”繞著“母體 2”執行,“母體 2”繞著“Sol”執行。

	Class "moon"
	Class "minormoon"

Celestia 為衛星提供了兩個 SSC 物件類別:moonminormoon。它們非常直觀:moon 應該用於天體的主要衛星,而 minormoon 應該用於次要衛星。次要衛星較小,通常是不規則的,可能具有偏心和/或傾斜的軌道。新發現的衛星通常是次要衛星;所有主要衛星都已在 Celestia 的預設版本中新增。

	EllipticalOrbit
	{
	Epoch	        <number>
	Period		<number>
	SemiMajorAxis	<number>
	Eccentricity	<number>
	Inclination	<number>
	AscendingNode	<number>
	ArgOfPericenter <number>
	MeanAnomaly	<number>
	}

這段程式碼定義了衛星如何繞母體執行。可以使用其他引數,例如 PericenterDistance,但這是最常見的格式。與繞恆星(例如太陽)執行的天體相比,衛星的關鍵區別在於,對於衛星,SemiMajorAxis 的單位是公里,而不是天文單位。

使用質心定義

[編輯 | 編輯原始碼]

對於許多矮行星,例如冥王星,它們的衛星相對於母體而言非常大,因此它們的共同質心(質心)位於母體之外。對於這些天體,必須使用一種特殊方法,以便這兩個天體繞著它們的質心執行。

以下是一些示例程式碼

ReferencePoint "Barycenter" "Sol"
{
	EllipticalOrbit
	{
	Epoch	        <number>
	Period		<number>
	SemiMajorAxis	<number>
	Eccentricity	<number>
	Inclination	<number>
	AscendingNode	<number>
	ArgOfPericenter <number>
	MeanAnomaly	<number>
	}

	Visible true
	Clickable true
}

"Name" "Sol"
{
	Class "class"
	Mesh "mesh.*"
	Texture "texture.*"
	Radius <number>
	Color [ <number> <number> <number> ]
	BlendTexture true

	OrbitFrame {
	EquatorJ2000 { Center "Sol/Barycenter" }
	}

	EllipticalOrbit
	{
	Epoch	        <number>
	Period		<number>
	SemiMajorAxis	<number>
	Eccentricity	<number>
	Inclination	<number>
	AscendingNode	<number>
	ArgOfPericenter <number>
	MeanAnomaly	<number>
	}

	Albedo <number>
	RotationPeriod <number>
}

"Moon" "Sol/Name"
{
	Class "class"
	Mesh "mesh.*"
	Texture "texture.*"
	Radius <number>
	Color [ <number> <number> <number> ]
	BlendTexture true

	OrbitFrame {
	EquatorJ2000 { Center "Sol/Barycenter" }
	}

	EllipticalOrbit
	{
	Epoch	        <number>
	Period		<number>
	SemiMajorAxis	<number>
	Eccentricity	<number>
	Inclination	<number>
	AscendingNode	<number>
	ArgOfPericenter <number>
	MeanAnomaly	<number>
	}

	Albedo <number>
	RotationPeriod <number>
}

引數列表(使用質心)

[編輯 | 編輯原始碼]

同樣,衛星的大多數引數與小行星中的引數相同。對於網格、紋理、半徑、顏色、反照率和自轉,它們是相同的,因此請參考該頁面以獲取更多資訊。下面列出了區別。

參考點

[編輯 | 編輯原始碼]
ReferencePoint "Barycenter" "Sol"

在 SSC 檔案中將“ReferencePoint”放在物件名稱之前,會將該物件變成一個點,其他物件可以繞著它執行。

可點選和可見

[編輯 | 編輯原始碼]
	Visible true
	Clickable true

這些是布林引數,這意味著它們可以設定為 truefalse。如果將 Visible 設定為 true,則參考點的標籤將可見。如果將 Clickable 設定為 true,則參考點將可選擇,就像任何其他物件一樣。

設定正確的軌道座標系

[編輯 | 編輯原始碼]
"Name" "Sol"

在上面的程式碼中,您會注意到物件“名稱”看起來像繞著“Sol”執行,儘管實際上它繞著“Barycenter”執行,而“Barycenter”繞著“Sol”執行。那麼我們如何讓它繞著“Barycenter”物件執行呢?

透過設定正確的 OrbitFrame。在下面的程式碼中,我們告訴 Celestia 將“名稱”放在 Barycenter 的軌道上。

	OrbitFrame {
	EquatorJ2000 { Center "Sol/Barycenter" }
	}

選擇正確的軌道座標系時要非常小心。這裡,它被設定為“EquatorJ2000”,這意味著軌道元素位於赤道座標系中。如果您從論文中提取元素,請檢查軌道座標系是赤道(EQJ2000)還是黃道(ECJ2000)座標系。如果它說黃道,請改為使用以下程式碼

	OrbitFrame {
	EclipticJ2000 { Center "Sol/Barycenter" }
	}

如果軌道座標系有一箇中心是“Something/Something”,那麼 Period 的單位是天,而不是年,SemiMajorAxis 的單位是公里,而不是天文單位。

華夏公益教科書