Page 1 of 1

swap out a texture of a planet at a particular point in time

Posted: 17.04.2008, 16:17
by ncc1701d
Is it possible through scripting to swap out a texture of a planet at a particular point in time in time?
Has anyone done that? If possible can someone point me in right direction on getting started?
Thanks
steve

Re: swap out a texture of a planet at a particular point in time

Posted: 17.04.2008, 21:18
by selden
Steve,

Unfortunately, not yet.

There are two or three different ways to cause several different objects to be visible at different times. [edit]If the objects differ only in their surface textures, it'll appear that their textures are changing.[/edit]

1. specify Beginning and Ending times in the SSC definition
2. use a Lua script to modify the objects' Visible attributes (requires Celestia built from svn, will be in v1.6.0)
3. define ScriptedOrbit functions which cause the objects to be located at the expected positions when desired (requires Celestia v1.5.0 or later)

[edit]
Here's a script which causes the named object to become invisible in Celestia built from svn:

Code: Select all

 obj = celestia:find("Sol/named_object")
 obj:setvisible(false)

[/edit]

Re: swap out a texture of a planet at a particular point in time

Posted: 19.04.2008, 12:09
by selden
Steve,

There are a couple of other texture selection methods, although they don't have any time aspect to them.

If you are willing to swap the texture image manually, you can specify the different surface maps using AltSurface declarations. Then you can select among them using the right-mouse-button popup menu.

If you have only three different textures per object, you can select among them by placing them in the folders /textures/hires/, lores and medres. Then type r and R to switch among them.

In principle, one ought to be able to select among AltTextures using a script, but I can't find the appropriate CEL or CELX commands.

Re: swap out a texture of a planet at a particular point in time

Posted: 19.04.2008, 12:36
by Vincent
selden wrote:In principle, one ought to be able to select among AltTextures using a script, but I can't find the appropriate CEL or CELX commands.
http://en.wikibooks.org/wiki/Celestia/C ... setsurface

Actually, the setsurface celx method should be moved from observer to object.
This would allow user to define a specific AltTexture for each object.

Re: swap out a texture of a planet at a particular point in time

Posted: 19.04.2008, 13:12
by selden
Vincent,

My understanding is that it'd require more than just modifying the celx code. Currently, the same AltSurface name applies to all objects simultaneously. Personally, I think that's a good thing, since one can define a family of surface textures that will be seen on all objects by selecting just one AltSurface name.

Re: swap out a texture of a planet at a particular point in time

Posted: 19.04.2008, 13:26
by Vincent
selden wrote:My understanding is that it'd require more than just modifying the celx code.
Yes, I was aware of that when I wrote my suggestion.

selden wrote:Currently, the same AltSurface name applies to all objects simultaneously. Personally, I think that's a good thing, since one can define a family of surface textures that will be seen on all objects by selecting just one AltSurface name.
This is a good point, indeed, which is far more coherent from a scientifical point of view.
Moving the setsurface method to object would be quite useful from the addons creators point of view.
So I agree on favouring the scientifical use of the setsurface method.