Body Orientation

Post requests, images, descriptions and reports about work in progress here.
Topic author
buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 6 months
Location: Massachusetts, USA

Body Orientation

Post #1by buggs_moran » 17.05.2007, 02:03

I am a bit confused. I have an object that I was working on. I want it to sit at a certain lat and long. So I took the lat, long and radius and converted them to cartesian. Works great. The lat is 62.8, long is -123.5 and radius is 1821. I want to place a sphere (lets say a caldera for at this location.) I want it to automatically face "up" (i.e. north pole of object pointing out from center of moon) and I can't get it right. This is my code, can someone tell me where I went wrong.

Code: Select all

"Tvashtar Volcano" "Sol/Jupiter/Io" {      

Radius 100.000
Class "asteroid"
OrbitFrame { BodyFixed { Center "Sol/Jupiter/Io"} }
FixedPosition [ -459.418727624617 -694.105982301049 1619.62721576345 ]
BodyFrame { BodyFixed { Center "Sol/Jupiter/Io"} }
FixedRotation { MeridianAngle -123.5}
OrientationLock "Sol/Jupiter/Io"
}

Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M

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

Post #2by chris » 17.05.2007, 02:52

First of all, the OrientationLock isn't necessary--there is no such thing in Celestia. Other than that, you're definitely on the right track. Is it positioned at expected place? I'm guessing the answer is yes and that it's the orientation that's a problem--can you describe exactly what's going wrong? A common fix for some models is to add a 90 degree rotation about the x-axis. Just add the line Orientation [ 90 1 0 0 ]

--Chris

Topic author
buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 6 months
Location: Massachusetts, USA

Post #3by buggs_moran » 17.05.2007, 04:17

The location on the surface is perfect. I created a spreadsheet that accepts lat, long and radius and spits out the exact cartesian coordinates.

I wanted to put an object at this point with the rotational axis pointing at the center of the moon (i.e along a radius). Right now it points in what seems to be parallel direction as the axis of Io and Jupiter. I thought that is what Meridian Angle was supposed to take care of...

Then I am going to place other objects sitting on the surface in a ring around that central sphere. I would imagine those objects could be done like this...

Code: Select all

"Tvashtar Volcano" "Sol/Jupiter/Io" {      

   Radius 100.000
   Class "asteroid"
   OrbitFrame { BodyFixed { Center "Sol/Jupiter/Io"} }
   FixedPosition [ -459.418727624617 -694.105982301049 1619.62721576345 ]
   BodyFrame { BodyFixed { Center "Sol/Jupiter/Io"} }
   FixedRotation { MeridianAngle -123.5 }
}

"Ord1" "Sol/Jupiter/Io/Tvashtar Volcano" {      
   Radius 10.0
   #Class "invisible"
   OrbitFrame { BodyFixed { Center "Sol/Jupiter/Io/Tvashtar Volcano"} }
   FixedPosition [ 0 100  0 ]
   BodyFrame { BodyFixed { Center "Sol/Jupiter/Io/Tvashtar Volcano"} }
   FixedRotation {  MeridianAngle -123.5 }
}

etc
Homebrew:

WinXP Pro SP2

Asus A7N8X-E Deluxe

AMD Athlon XP 3000/333 2.16 GHz

1 GB Crucial RAM

80 GB WD SATA drive

ATI AIW 9600XT 128M

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 7 months
Location: NY, USA

Post #4by selden » 17.05.2007, 09:17

I use the twovector construct to Modify the object's orientation. There must be a way to include this in the original specification, but I haven't figured out how.

Here's an example: the -z (down) vector declaration points it toward the Earth's center and the y vector determines its azimuthal angle.

Code: Select all

Modify "hale_dome_base" "Sol/Earth"
{
 
    BodyFrame
    {
        TwoVector
        {
            Center "Sol/Earth/hale_dome_base"
            Primary   
            {
                Axis "-z"
      RelativePosition {Target "Sol/Earth"}
            }
            Secondary   
            {
                Axis "y"
                ConstantVector   
                {
# point large doorway NW
                    Vector [ 0.707 -0.707 0]
                    Frame {  BodyFixed { Center "Sol/Earth" } }
                }
            }
        }
    }
}
Selden

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 18
With us: 18 years
Location: Thyrrenian sea

Post #5by Fenerit » 17.05.2007, 22:25

Selden, a question: an object with directives like these, can work in Celestia 1.4.1 or I need to upgrade the program?

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

Post #6by chris » 18.05.2007, 08:31

Fenerit wrote:Selden, a question: an object with directives like these, can work in Celestia 1.4.1 or I need to upgrade the program?


Reference frames like Selden and Buggs are using will only work in version 1.5.0.

--Chris

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 18
With us: 18 years
Location: Thyrrenian sea

Post #7by Fenerit » 18.05.2007, 11:56

Thank you, Chris.

Topic author
buggs_moran
Posts: 835
Joined: 27.09.2004
With us: 20 years 6 months
Location: Massachusetts, USA

Post #8by buggs_moran » 19.05.2007, 01:57

I guess I just don't get this. I have been trying, rather frustratingly to get this to work.

Let's say I wanted a central hub of a moon base, I get it all defined and it works (this I know how to do with OrbitFrame etc.) Represented by the "o" in my pic.

Now, I want to arrange little arrow shaped buildings (represented by the "v" pointing out in 4 directions at a distance of 2 km. Like so...

......2
......^
3 < o > 1
......v
......4

How would I turn the buildings in this code? Is there a way to do it without the orientation command?

Code: Select all

"Ord1" "Sol/Earth/Moon/Base" {      
   Radius 1.0
   Class "asteroid"
   OrbitFrame { BodyFixed { Center "Sol/Earth/Moon/Base"} }
   FixedPosition [ 2 0 0 ]
   BodyFrame { BodyFixed { Center "Sol/Earth/Moon/Base"} }
        FixedRotation { }
}

"Ord2" "Sol/Earth/Moon/Base" {      
   Radius 1.0
   Class "asteroid"
   OrbitFrame { BodyFixed { Center "Sol/Earth/Moon/Base"} }
   FixedPosition [ 0 2 0 ]
   BodyFrame { BodyFixed { Center "Sol/Earth/Moon/Base"} }
        FixedRotation { }
}

"Ord3" "Sol/Earth/Moon/Base" {      
   Radius 1.0
   Class "asteroid"
   OrbitFrame { BodyFixed { Center "Sol/Earth/Moon/Base"} }
   FixedPosition [ -2 0 0 ]
   BodyFrame { BodyFixed { Center "Sol/Earth/Moon/Base"} }
        FixedRotation { }
}

"Ord4" "Sol/Earth/Moon/Base" {      
   Radius 1.0
   Class "asteroid"
   OrbitFrame { BodyFixed { Center "Sol/Earth/Moon/Base"} }
   FixedPosition [ 0 -2 0 ]
   BodyFrame { BodyFixed { Center "Sol/Earth/Moon/Base"} }
        FixedRotation { }
}
Homebrew:

WinXP Pro SP2

Asus A7N8X-E Deluxe

AMD Athlon XP 3000/333 2.16 GHz

1 GB Crucial RAM

80 GB WD SATA drive

ATI AIW 9600XT 128M

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 7 months
Location: NY, USA

Post #9by selden » 19.05.2007, 12:02

To rotate an outlying building around its vertical (Z) axis, specify an appropriate MeridianAngle within the FixedRotation block.

For your example, the four MeridianAngles would be multiples of 90 degrees.
Selden


Return to “Add-on development”