Page 1 of 1

Body Orientation

Posted: 17.05.2007, 02:03
by buggs_moran
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"
}


Posted: 17.05.2007, 02:52
by chris
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

Posted: 17.05.2007, 04:17
by buggs_moran
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

Posted: 17.05.2007, 09:17
by selden
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" } }
                }
            }
        }
    }
}

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

Posted: 18.05.2007, 08:31
by chris
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

Posted: 18.05.2007, 11:56
by Fenerit
Thank you, Chris.

Posted: 19.05.2007, 01:57
by buggs_moran
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 { }
}

Posted: 19.05.2007, 12:02
by selden
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.