How to see rotataing objects from TOP by CEL?

All about writing scripts for Celestia in Lua and the .cel system
Topic author
dejudicibus
Posts: 10
Joined: 26.11.2005
With us: 19 years

How to see rotataing objects from TOP by CEL?

Post #1by dejudicibus » 03.12.2005, 13:09

I read several times the CEL Script Guide but I still have no idea how to generate very simple scenes by using scripts.

For example:

I would like to see a galaxy (or a star system) from top, being the galaxy (or planets) rotating around its center. A very simple scene, as if you moved away along an orthogonal axis to galaxy (or system) plane.

But how? I would like to do that for any galaxy or star system, not hardcoding absolute coordinates, but relatively to the selected target.

But how????? I am confused by so manu coordinate modes. I really do NOT understand them. :(
Dario de Judicibus - Rome, Italy (EU)
Site: http://www.dejudicibus.it
Blog: http://lindipendente.splinder.com

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

Post #2by selden » 03.12.2005, 13:42

To look down on the Earth from above the North Pole:

Code: Select all

{
select { object "Earth" }
wait { duration 2 }
gotolonglat { time 1 distance 10 longitude 0 latitude 90 }
wait { duration 2 }
}
Selden

Topic author
dejudicibus
Posts: 10
Joined: 26.11.2005
With us: 19 years

Post #3by dejudicibus » 03.12.2005, 15:26

selden wrote:To look down on the Earth from above the North Pole:

Code: Select all

{
select { object "Earth" }
wait { duration 2 }
gotolonglat { time 1 distance 10 longitude 0 latitude 90 }
wait { duration 2 }
}


Thank you. I assume it works for any object.
Dario de Judicibus - Rome, Italy (EU)

Site: http://www.dejudicibus.it

Blog: http://lindipendente.splinder.com

Topic author
dejudicibus
Posts: 10
Joined: 26.11.2005
With us: 19 years

Post #4by dejudicibus » 03.12.2005, 15:34

No, it does NOT work for any object....

I tried

Code: Select all

   select { object "Sol/Earth"}
   gotolonglat { time 4 distance 1 longitude 0 latitude 90 }
   renderflags { set "orbits" }
   wait { duration 1 }


tpo see the Earth rotating around the sun (at center) from top, but I see nothing. I really do NOT understand CEL language.
Dario de Judicibus - Rome, Italy (EU)

Site: http://www.dejudicibus.it

Blog: http://lindipendente.splinder.com

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

Post #5by selden » 04.12.2005, 14:22

Code: Select all

{
wait {duration 5 }

renderflags { clear "constellations|boundaries|automag|grid"
                set "orbits|cloudmaps|galaxies|planets|stars|nightmaps" }
renderflags {   set "markers|eclipseshadows|ringshadows|comettails|atmospheres" }
orbitflags { set "planet" clear "moon|asteroid|comet|spacecraft" }

select { object "Sol" }
gotolonglat { time 1 distance 1000 longitude 0 latitude 90 }
wait { duration 2 }

mark { object "Sol/Earth" size 20 color [1 0.5 0] symbol "triangle" }
select { object "Sol/Earth" }
follow {}
wait { duration 2 }
}
Selden

Topic author
dejudicibus
Posts: 10
Joined: 26.11.2005
With us: 19 years

Post #6by dejudicibus » 06.12.2005, 10:49

Thank you, Selden. I tried your script and it works for Sol, apart that I had to change

Code: Select all

orbitflags
to

Code: Select all

renderflags
. However, when I tried it with another star having planets, the view was no more from TOP, but slightly from side. I suspect that longitude and latitude refers strictly to our system, are they? How can I set the local longitude and latitude? For example, assume the other star is called Senna and first planet is Reta, here is my code:



Code: Select all

   select { object "Senna" }
   center { time 0 }
   goto { time 5 distance 20 }
   follow {}
   wait { duration 5 }
   goto { time 5 distance 200 longitude 0 latitude 90 }
   renderflags { set "orbits" }
   wait { duration 2 }
   select { object "Senna/Reta" }
   follow {}
   wait { duration 5 }


It works, but not from the TOP perspective :(
Dario de Judicibus - Rome, Italy (EU)

Site: http://www.dejudicibus.it

Blog: http://lindipendente.splinder.com

Topic author
dejudicibus
Posts: 10
Joined: 26.11.2005
With us: 19 years

Post #7by dejudicibus » 06.12.2005, 11:09

What I am looking for is a piece of code that works for ANY object. For example:

see galaxy A from top
see star B and planet C from top
see planet D and moons E and F from top

From top means orthogonal to orbit plane, whatever are the two or three (assuming they are on the same plane) object selected

I tried a lot of instructions and coordsys with NO result :(
Dario de Judicibus - Rome, Italy (EU)

Site: http://www.dejudicibus.it

Blog: http://lindipendente.splinder.com

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

Post #8by selden » 06.12.2005, 15:08

Sorry, I really can't help more than I have.
A fully generic subroutine would require CELX programming, which I haven't done. Maybe someone else can help.

Gotolonglat to position yourself above the body's pole is the simplest solution that I know.
Selden

cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 8 months
Location: Victoria, BC Canada

Post #9by cpotting » 06.12.2005, 19:27

dejudicibus wrote:What I am looking for is a piece of code that works for ANY object. For example:

see galaxy A from top
see star B and planet C from top
see planet D and moons E and F from top

From top means orthogonal to orbit plane, whatever are the two or three (assuming they are on the same plane) object selected

I tried a lot of instructions and coordsys with NO result :(
Selden wrote:Sorry, I really can't help more than I have.
A fully generic subroutine would require CELX programming, which I haven't done. Maybe someone else can help.

Gotolonglat to position yourself above the body's pole is the simplest solution that I know.
_________________
Selden


I am at work right now (shhh! :wink: My boss is away) I'll try to remember to write you up something once I get home tonight. Selden is right, it will take CELX to do what you want.

Correct me if the following assumptions are wrong:
    a) If only one object is selected then view it from along its axis of rotation (eg. see Earth from above looks down on the north pole).

    b) If a second object is chosen and it orbits the first then view them from along a line orthogonal to the orbital plane of the second object (e.g. see Earth and Moon shows the Moon's orbital plane at 90 degrees to the current view)

    c) If the second object does not orbit the first, then use view a) for the first object (e.g. view Earth and Mars looks down from above the north pole)

    d) If a third object is select then the view is from a line orthogonal to the plane described by the centres of the three objects.

    e) More than 3 objects will not be allowed
Clive Pottinger
Victoria, BC Canada

jdou
Posts: 137
Joined: 24.04.2004
With us: 20 years 7 months
Location: France

Post #10by jdou » 06.12.2005, 21:59

Just my 2 cents.
In the last code given by dejudicibus I read :

Code: Select all

goto { time 5 distance 200 longitude 0 latitude 90 }

in place of :

Code: Select all

gotolonglat { time 5 distance 200 longitude 0 latitude 90 }

Can we use "goto" and "gotolonglat" for the same action ?
P4c 3.0Ghz, 1 Gb, XP sp1, GeForce FX5700u 128 Mb, NV 93.71, Celestia 1.5.0pre2, BMNG 64k

Topic author
dejudicibus
Posts: 10
Joined: 26.11.2005
With us: 19 years

Post #11by dejudicibus » 06.12.2005, 22:55

cpotting wrote:...
Correct me if the following assumptions are wrong:
...


Well, not exactly, even if you are close. Hoever, if you have some time (little, do not worry) to share, please, write me to [ ddj (at) mclink (dot) it ] and I'll tell you what I am trying to do. I do not want to bother the other participants of this forum with a specific need that is not of general interest.
Dario de Judicibus - Rome, Italy (EU)

Site: http://www.dejudicibus.it

Blog: http://lindipendente.splinder.com

Topic author
dejudicibus
Posts: 10
Joined: 26.11.2005
With us: 19 years

Post #12by dejudicibus » 06.12.2005, 23:00

jdou wrote:Just my 2 cents.
In the last code given by dejudicibus I read :

Code: Select all

goto { time 5 distance 200 longitude 0 latitude 90 }

in place of :

Code: Select all

gotolonglat { time 5 distance 200 longitude 0 latitude 90 }

Can we use "goto" and "gotolonglat" for the same action ?


My fault. It must be gotolonglat .
Dario de Judicibus - Rome, Italy (EU)

Site: http://www.dejudicibus.it

Blog: http://lindipendente.splinder.com


Return to “Scripting”