Currently only Celestia default spheres eg. moons, planets etc can be colorized, and this can only be done at load time in an SSC: eg. Color [ 1 0 1 ]
This does not work on modelled meshes. ( .3ds, .cmod )
They can only have color applied within the modelling tool eg. Anim8tor.
So color of planet/moon spheres is statically determined at load time, and the color of other meshes can only be embedded in the mesh by the modeller.
The ability to modify the colour of a mesh (either .3ds, .cmod, or Celestia sphere) at runtime from perhaps a CelX script.
This would allow the colour of meshes (either spacecraft, components, surfacefeatures, planets, etc.. to be changed at will from a script. Specifically I'm keen to see this implemented for modelled meshes (.3ds, .cmod) because simple forms (cubes, etc) will be rendered faster than planetary spheres, but it would be good to implement this for planets, moons as well if the method can easily be made "class" agnostic.
I was thinking that something along the lines of a ".setcolor" method or similar in the object class -- could specify an RGB color for the Color property of an object mesh at runtime, but as I haven't seen the existing code this may or may not be the best way to do it.. I'll leave that to you! ;-)
Logged In: YES
user_id=1605452
Originator: NO
The following patch adds the object:surfacecolor and object:setsurfacecolor methods to celx:
http://vincent.gian.club.fr/celestia/surfacecolor.patch
object:surfacecolor() returns a triple which corresponds to the r, g, b components of the
object surface color.
Example:
-- Get object initial surface color
r0, g0, b0 = object:surfacecolor()
-- Set object surface color to green
earth:setsurfacecolor(0, 1, 0)
-- Give object back its initial surface color
object:setsurfacecolor(r0, g0, b0)
As pointed out by chuft-captain, this currently works with Celestia spheres, but not with cmod or 3ds meshes.
I noticed that this also works with .cms models, though. A different feature request -- assigned to Chris --
should be created for this issue.