Problem Scripting Time Scale For Animation

Have a question about using Celestia? Check here first for FAQs and helpful advice.
Forum rules
Please help to make this forum more useful by checking the FAQs before posting! Keep it clean, keep it civil, keep it truthful, stay on topic, be responsible, share your knowledge.
Topic author
eris
Posts: 5
Joined: 12.08.2010
With us: 14 years 3 months

Problem Scripting Time Scale For Animation

Post #1by eris » 22.09.2013, 16:36

Hi,

First -- Celestia is a fantastic piece of work. Thank you, thank you.

I'm creating a Solar System animation using Celestia. The animation starts at the surface of the sun and then zooms out revealing the orbits of the inner planets. I have a celx script for this and I mostly have it working except for one little glitch. As I zoom out I increase the speed at which time elapses to match the scale that we're looking at.

Near the surface of the Sun I have it running about 10 times faster so I can see the the vortices and prominences moving (I'm using one of the really nice Solar textures made avail by the community).

As you zoom out to the innermost planets I kick it up to about 150x to show the orbits of the planets. (Looks pretty sweet as I sync'd it to a conjunction of Halley's comet and mars).

Between these two points is where I have the problem. Even though the sun looks good as it zooms out, the dramatically increased time scale makes the sun rotate so fast that the flares and other effects create a fuzzy hash which just looks nasty.

I've thought of several ways to fix this:

1. Switch solar models to one without flares before I speed up time dramatically. (Don't know if I can do this in the sim)
2. Set the rotation period of the sun to some very slow rate -- or zero. (Don't know how to do this in the sim)
3. Leave the sun enabled, but somehow remove it from the simulation. (can this be done?)
4. Run the animation twice. Once with the cool solar prominences and once with a simple solar model. Use a video editor to cut between sims right at the point where the sun goes too fast.

Any help would be greatly appreciated.

Thanks,

eris

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Problem Scripting Time Scale For Animation

Post #2by Fenerit » 22.09.2013, 20:12

Hi! A solution could be to define at the beginning of the script a table containing all 3D objects relevant to the "solar flares" SSC. For example:

Code: Select all

local sol_flares =
{
      "Sol/_sunflare1",
      "Sol/_sunflare2",
      "Sol/_sunflare3",
      "Sol/_sunflare4",
      "Sol/_sunflare5"
}


while within their SSC must be add to each one the propriety "Visible" set to "false", in order to start the script with the flares hidden:

Code: Select all

Visible false


and within the celx, still at the beginning, separately from the rest, add the following string and function:

Code: Select all

local obs = celestia:getobserver() -- do not add whether you already have it
function hide_sol_flares(obs)
for k, object in pair(sol_flares) do
obj_sol_flares = celestia:find(object)
obj_sol_flares:setvisible(not obj_sol_flares:visible())
end
end


Now, when the Sol is selected, would be executed the following string among the others:

Code: Select all

 hide_sol_flares(obs)


This will made flares visible. When the script instead moves toward planets, still somewhere within the code:

Code: Select all

 hide_sol_flares(obs)


and the flares will be hidden again.
Never at rest.
Massimo

Avatar
Marco Klunder
Posts: 181
Joined: 20.02.2008
Age: 62
With us: 16 years 9 months
Location: The Netherlands

Re: Problem Scripting Time Scale For Animation

Post #3by Marco Klunder » 23.09.2013, 09:52

Next to Fenerit's suggestion,

Depending on the Sol addon you have in use, there are Sol addons with solar flares and prominences implemented as "clouds".
Simply pressing the [i] key, or turning off cloud rendering in the script might also solve your issue.

Marco
Marco Klunder
email: marco.klunder@xs4all.nl
Windows10 PD 3.0 GHz, 2 GB of RAM, Nvidia GeForce 6700 XL
Celestia161 / SVN + Lua Edu Tools v1.2 Beta9, Celestia160-ED and Celestia1621

Topic author
eris
Posts: 5
Joined: 12.08.2010
With us: 14 years 3 months

Re: Problem Scripting Time Scale For Animation

Post #4by eris » 30.09.2013, 03:25

Massimo, Marco...

Thank you very much. Massimo -- I was working on a similar concept, except the 'visible' setting doesn't work on stars. If I can, however, refer to the prominence components as 3d objects which I can turn on and off then that should work.

In order to have the prominences erupt at the right time I had to change their orientation and location. This was very tricky since I had to make selective changes to see which parameters controlled the visual effects.

Marco: Yes they are modeled as clouds and I tried use the I key to supress them, but I believe there are other components that are still visible. I'll report back.

I think some combination of these will work. If nothing else I can fall back to a video editor.

Thanks again. Awesome program.

eris

Topic author
eris
Posts: 5
Joined: 12.08.2010
With us: 14 years 3 months

Re: Problem Scripting Time Scale For Animation

Post #5by eris » 30.09.2013, 04:38

Marco,

I'm using the one that models flares as clouds. Even though pressing 'I' makes clouds invisible, there is still some component that becomes visible near the flare bases when the size of the sun shrinks to slightly larger than a pinpoint. It's at this point that it becomes ugly.

Can I still use Massimo's idea to make them invisible?

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Problem Scripting Time Scale For Animation

Post #6by Fenerit » 30.09.2013, 13:54

Meanwhile waiting the Marco's replay... :D

...usually a cloud-addon does use one or more fake spheroids/3D models to which add the cloud directive. Probably are this fictitius objects which are then visibles when the Sun shrink down, being declared separately.
Never at rest.
Massimo

Topic author
eris
Posts: 5
Joined: 12.08.2010
With us: 14 years 3 months

Re: Problem Scripting Time Scale For Animation

Post #7by eris » 30.09.2013, 21:59

Just to bring the forum up to date...

The code suggested by Fenerit was exactly what I needed. Even setting the default visibility to 'false' was required so that it reset properly when you ran it a second time.

As soon as the flares are out of range I switch them off. The transition is very smooth.

A couple notes:

The new texture package for the Sun doesn't give the flares names in the SSC file, so you have to rename them from " " to "_flare1" .. "_flare5".

I recorded the entire animation in Linux using 'glc_capture' and 'glc_play'. The capture utility allows you to set the window to fullscreen and press Shift-F8 when you're ready to record. You can then convert the captured data to an avi (if that's what you want) or do like did and covert the individual frames to pngs to pull into Premiere or some other video editor lossless.

BTW: Fenerit: I kept calling you Mossimo or something because that's in your signature. Sorry.

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 8 months
Location: Thyrrenian sea

Re: Problem Scripting Time Scale For Animation

Post #8by Fenerit » 30.09.2013, 22:58

eris wrote:The code suggested by Fenerit was exactly what I needed. Even setting the default visibility to 'false' was required so that it reset properly when you ran it a second time.

Good!

eris wrote:BTW: Fenerit: I kept calling you Mossimo or something because that's in your signature. Sorry.

No sorry; Massimo (Maximus, Max) is my name.
Never at rest.
Massimo

Avatar
Marco Klunder
Posts: 181
Joined: 20.02.2008
Age: 62
With us: 16 years 9 months
Location: The Netherlands

Re: Problem Scripting Time Scale For Animation

Post #9by Marco Klunder » 01.10.2013, 19:39

Good to see you have a solution.

Marco
Marco Klunder
email: marco.klunder@xs4all.nl
Windows10 PD 3.0 GHz, 2 GB of RAM, Nvidia GeForce 6700 XL
Celestia161 / SVN + Lua Edu Tools v1.2 Beta9, Celestia160-ED and Celestia1621


Return to “Help Central”