Page 1 of 1

Orientation doesn't work within timeline

Posted: 02.07.2008, 11:31
by Tomasz M. Bladyniec
Hello, I just figured out that "Orientation" function in SSC doesn't work while inside "Timeline" function. Here's the code:

Code: Select all

"Venus Express 1"   "Sol/Venus"
   {
      Class      "spacecraft"
      Mesh      "Venus Express.cmod"
      Radius      0.004
      Timeline   [
            {
               EllipticalOrbit
                  {
                  Period         1
                  SemiMajorAxis      39627
                  Inclination      90
                  Eccentricity      0.8296
                  LongOfPericenter   -80
                  MeanAnomaly      190
                       }
               Orientation   [90 -1 0 0]
               RotationOffset   290
            }
            ]
   }

"Venus Express 2"   "Sol/Venus"
   {
      Class      "spacecraft"
      Mesh      "Venus Express.cmod"
      Radius      0.004
      Timeline   [
            {
               EllipticalOrbit
                  {
                  Period         1
                  SemiMajorAxis      39627
                  Inclination      90
                  Eccentricity      0.8296
                  LongOfPericenter   -80
                  MeanAnomaly      190
                       }
               RotationOffset   290
            }
            ]
               Orientation   [90 -1 0 0]
   }


The only difference between these two is that orientation is inside or outisde the timeline function. In result, models are tilted about 90 degrees o each other. Is it a bug, or it was planned? How to fix it?
I use 1.6.0 r.4367, on Windows Vista. No modifications.

Re: Orientation doesn't work within timeline

Posted: 02.07.2008, 15:03
by symaski62
ou? SSC ERROR

:mrgreen: no bug

selden

Re: Orientation doesn't work within timeline

Posted: 02.07.2008, 18:09
by selden
I think it's a bug in Timeline.

I suspect Chris forgot to take Orientation into consideration when adding Timeline support. I think Orientation should be specified inside the Timeline block.

However, I also think the Orientation directive is obsolete and should be deprecated. If you look in the WikiBook, you'll find that Orientation is not documented on the SSC page.

If you're going to use a new feature like Timeline,
you also should use BodyFrame and one of the Rotation blocks (FixedRotation, UniformRotation, PrecessingRotation, ScriptedRotation or SampledOrientation), . Their operations are well defined in this situation.

I did a quick test, with and without a Timeline. Orientation with no Timeline produces the same result as having Orientation specified outside the Timeline block. See below.

Re: Orientation doesn't work within timeline

Posted: 02.07.2008, 20:39
by Tomasz M. Bladyniec
Yes, I know about it, thank you. However, I still don't know how to change orientation into new reference system. I would like to re-write old add-on into new code and I'm concerned that I can't do it exactly. Anyone has an idea how to do it?
Besides, it looks like rotation of Venus Express isn't proper in this ssc anyway. Its antenna should be always pointed on Earth, right?

Re: Orientation doesn't work within timeline

Posted: 02.07.2008, 21:12
by chris
selden wrote:I think it's a bug in Timeline.

I suspect Chris forgot to take Orientation into consideration when adding Timeline support. I think Orientation should be specified inside the Timeline block.

However, I also think the Orientation directive is obsolete and should be deprecated. If you look in the WikiBook, you'll find that Orientation is not documented on the SSC page.

If you're going to use a new feature like Timeline,
you also should use BodyFrame and one of the Rotation blocks (FixedRotation, UniformRotation, PrecessingRotation, ScriptedRotation or SampledOrientation), . Their operations are well defined in this situation.

I did a quick test, with and without a Timeline. Orientation with no Timeline produces the same result as having Orientation specified outside the Timeline block. See below.

There's no bug, but some explanation of how Orientation works is in order.

Orientation is distinct from an object's rotation model. The rotation model is defined by one of the following:
FixedRotation
UniformRotation
SampledOrientation
CustomRotation
ScriptedRotation

(Properties such as RotationOffset can also be used to specify a rotation model. However, this is an old way of specifying the rotation model left over from the days when the Celestia only supported constant rotation about a fixed axis. Now that there are multiple ways to define the rotation model, UniformRotation should be used instead.)

Orientation is applied to the model before the rotation model. It is typically used to transform an mesh into a different coordinate system. Unlike the rotation model, Orientation does not affect the body fixed frame of an object.

Orientation should appear outside of the timeline, just like other mesh transformation properties such as radius. I think that you want something like this:

Code: Select all

"Venus Express"   "Sol/Venus"
{
    Class      "spacecraft"
    Mesh      "Venus Express.cmod"
    Radius      0.004
    Orientation   [90 -1 0 0]
    Timeline   [
    # Phase 1
    {
        EllipticalOrbit
        {
            Period         1
            SemiMajorAxis      39627
            Inclination      90
            Eccentricity      0.8296
            LongOfPericenter   -80
            MeanAnomaly      190
        }
       
        UniformRotation
        {       
            MeridianAngle   290
        }
    }
    ] # end Timeline
}


--Chris

Re: Orientation doesn't work within timeline

Posted: 02.07.2008, 22:35
by selden
Chris,

Thanks for the clarification!

I've added it to the SSC page of the WikiBook.

Re: Orientation doesn't work within timeline

Posted: 02.07.2008, 23:05
by BobHegwood
Selden and Chris,

Thanks to you both for the English explanation here. Even I can understand it now (I think!) :wink: