Smoother Ride...

All about writing scripts for Celestia in Lua and the .cel system
Topic author
gjohanns
Posts: 1
Joined: 27.08.2007
With us: 17 years 3 months

Smoother Ride...

Post #1by gjohanns » 05.09.2007, 16:45

Hello to everyone. I am a new user to Celestia, and I love every minute that I get to work with it.

I have a problem with creating scripts that I hope someone can help me with.

I would like to create a script that takes you on a "fly-by" of some of the solar objects. It starts by looking into deep space over Neptune, then centers the camera directly on the planet. Then we spin around and fly past Uranus, Saturn, Jupiter, and Mars. The camera then circles the sun for a half rotation, and then zips to Earth.

So far I have the Neptune part done... *sigh*

My problem is how quickly Celestia processes my next scripted command. When moving from a gotoloc command to a changedistance command there is a slight pause. Then after completing the changedistance command there is another slight pause before executing the next goto command.

Can anyone let me know how to make this just a bit smoother? I would like it to feel like you are in a "space plane." (Star Wars physics, with space craft behaving more like atmospheric planes.)

I have looked at the AutoPilot program, but it does not seem to support viewing more then just a single planet.

Here is the code:

Code: Select all

# Select and go to Neptune with camera pointed at deep space...

    select { object "Sol/Neptune" }

    follow { }

    gotoloc { time 1
              position [ 0 0 -120000 ]
              xrot -35
              yrot 180
              zrot 60 }

    wait { duration 1 }

# Reposition camera to look at Neptune

    gotoloc { time 10
              position [ 0 0 -120000 ]
              xrot -1.5
              yrot 180
              zrot 60 }

    wait { duration 10 }

# Zoom out a bit to prepair for transit to Uranus

    changedistance { duration 0.75
                     rate 1.0 }

    wait { duration 0.5 }

# Select and position camera to prepair for trip to Uranus

    select { object "Sol/Uranus" }

    center { }

    goto { time 4 }

    wait { duration 4 }

miriam
Posts: 2
Joined: 10.10.2007
With us: 17 years 1 month

Post #2by miriam » 11.10.2007, 14:22

Hi, I'm a new user too. Found this wonderful program just a few days ago and haven't got any work done since. :)

Try changing the wait duration from 10 to 8 just before the line
# Zoom out a bit to prepare for transit to Uranus

I think the reason it removes the pause is because it begins the next leg of the journey just before it has finished the last. I'm just guessing here as to the why, but it works on my machine.
My time wasn't completely wasted last year.
I went on a 940 million kilometer journey.


Return to “Scripting”