Moderator: selden
Cham wrote:I'm not sure about your method. Another method could be to add an "alternate model" sub-menu, like we already have the alternate texture sub-menu (when we right-click on the planet). Selecting the model in that sub-menu could replace the default sphere with a model.
selden wrote:I'd certainly make use of an "alternate model" menu for my Hale Telescope Addon. While the new Visible option can be used for this capability, it requires more work by the author of the Addon and is more cumbersome for the user.
I personally don't see any problem with the idea of using the "alternate surface texture" menu to apply different textures to these alternate models. I am assuming that the implementation of the SSC texture directives can be extended to substitute the other types of textures (emissive, specular & normalmap) and not only a model's diffuse surface texture as now.
--Interior_of_Mars----------------------------------------------------
mars = celestia:find("Sol/Mars")
mars_radius = mars:radius()
function Interior_of_Mars()
if mars:radius() == mars_radius then
mars:setradius(1)
else
mars:setradius(mars_radius)
end
end
keyhandlers =
{
["C-i"] = Interior_of_Mars -- ctrl_i seem not interfere with other
}
-- be sure that you do not already have this, otherwise do not add
function handlekey(k)
handler = keyhandlers[k.char]
if (handler ~= nil) then
handler()
return true
else
return false
end
end
celestia:registereventhandler("key", handlekey)
--------------------------------------------------------selden wrote:I'd certainly make use of an "alternate model" menu for my Hale Telescope Addon. While the new Visible option can be used for this capability, it requires more work by the author of the Addon and is more cumbersome for the user.
I personally don't see any problem with the idea of using the "alternate surface texture" menu to apply different textures to these alternate models. I am assuming that the implementation of the SSC texture directives can be extended to substitute the other types of textures (emissive, specular & normalmap) and not only a model's diffuse surface texture as now.
-- Planetary_Interiors Celx Script------------------------------------------
-- Mercury --
mercury = celestia:find("Sol/Mercury")
mercury_radius = mercury:radius()
mercury_Int = celestia:find("Sol/Mercury's Interior")
mercury_Int_radius = mercury_Int:radius()
mercury_Int:setradius(1) -- this avoid the "griddish" flicks when go to
-- Earth --
earth = celestia:find("Sol/Earth")
earth_radius = earth:radius()
earth_Int = celestia:find("Sol/Earth's Interior")
earth_Int_radius = earth_Int:radius()
earth_Int:setradius(1) -- this avoid the "griddish" flicks when go to
-- Mars --
mars = celestia:find("Sol/Mars")
mars_radius = mars:radius()
mars_Int = celestia:find("Sol/Mars' Interior")
mars_Int_radius = mars_Int:radius()
mars_Int:setradius(1) -- this avoid the "griddish" flicks when go to
-- Io --
io = celestia:find("Sol/Jupiter/Io")
io_radius = io:radius()
io_Int = celestia:find("Sol/Jupiter/Io's Interior")
io_Int_radius = io_Int:radius()
io_Int:setradius(1) -- this avoid the "griddish" flicks when go to
function Planetary_Interiors()
if earth:radius() == earth_radius then
mercury:setradius(1)
mercury_Int:setradius(mercury_Int_radius)
earth:setradius(1)
earth_Int:setradius(earth_Int_radius)
mars:setradius(1)
mars_Int:setradius(mars_Int_radius)
io:setradius(1)
io_Int:setradius(io_Int_radius)
else
io_Int:setradius(1)
io:setradius(io_radius)
mars_Int:setradius(1)
mars:setradius(mars_radius)
earth_Int:setradius(1)
earth:setradius(earth_radius)
mercury_Int:setradius(1)
mercury:setradius(mercury_radius)
end
end
keyhandlers =
{
["C-i"] = Planetary_Interiors
}
function handlekey(k)
handler = keyhandlers[k.char]
if (handler ~= nil) then
handler()
return true
else
return false
end
end
celestia:registereventhandler("key", handlekey)
-- End of Planetary_Interiors Celx Script --------------------------------------- Planetary_Interiors Celx Script------------------------------------------
-- Mercury --
mercury = celestia:find("Sol/Mercury")
mercury_radius = mercury:radius()
mercury_Int = celestia:find("Sol/Mercury's Interior")
mercury_Int_radius = mercury_Int:radius()
mercury_Int:setradius(1) -- this avoid the "griddish" flicks when go to
-- Earth --
earth = celestia:find("Sol/Earth")
earth_radius = earth:radius()
earth_Int = celestia:find("Sol/Earth's Interior")
earth_Int_radius = earth_Int:radius()
earth_Int:setradius(1) -- this avoid the "griddish" flicks when go to
-- Mars --
mars = celestia:find("Sol/Mars")
mars_radius = mars:radius()
mars_Int = celestia:find("Sol/Mars' Interior")
mars_Int_radius = mars_Int:radius()
mars_Int:setradius(1) -- this avoid the "griddish" flicks when go to
-- Io --
io = celestia:find("Sol/Jupiter/Io")
io_radius = io:radius()
io_Int = celestia:find("Sol/Jupiter/Io's Interior")
io_Int_radius = io_Int:radius()
io_Int:setradius(1) -- this avoid the "griddish" flicks when go to
function Planetary_Interiors()
if earth:radius() == earth_radius then
mercury:setradius(1)
mercury_Int:setradius(mercury_Int_radius)
earth:setradius(1)
earth_Int:setradius(earth_Int_radius)
mars:setradius(1)
mars_Int:setradius(mars_Int_radius)
io:setradius(1)
io_Int:setradius(io_Int_radius)
else
io_Int:setradius(1)
io:setradius(io_radius)
mars_Int:setradius(1)
mars:setradius(mars_radius)
earth_Int:setradius(1)
earth:setradius(earth_radius)
mercury_Int:setradius(1)
mercury:setradius(mercury_radius)
end
end
keyhandlers =
{
["C-i"] = Planetary_Interiors
}
function handlekey(k)
handler = keyhandlers[k.char]
if (handler ~= nil) then
handler()
return true
else
-- this escape from interior mode ---
io_Int:setradius(1)
io:setradius(io_radius)
mars_Int:setradius(1)
mars:setradius(mars_radius)
earth_Int:setradius(1)
earth:setradius(earth_radius)
mercury_Int:setradius(1)
mercury:setradius(mercury_radius)
return false
end
end
celestia:registereventhandler("key", handlekey)
-- End of Planetary_Interiors Celx Script -------------------------------------Users browsing this forum: No registered users and 1 guest