Display of a political border

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.
Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 16 years 5 months
Location: Paris France

Display of a political border

Post #1by jogad » 15.12.2009, 08:53

Hello,

I have a virtual texture and I added a border to it with a simple transparent billboard like this:

Image

Now I want to have a script that lets me toggle the border on/off.
I took example on a script made by Cham but that doesn’t work for me. (Nothing happened) :evil:

Here is the script:

Code: Select all

-- Title: Vatican border on/ff

front = celestia:find("Sol/Earth/frontiere_vatican")
front:setvisible(not front:visible())

if front:visible() then
   celestia:print("Vatican border ON", 2)
else
   celestia:print("Vatican border OFF", 2)
end

And the ssc file:

Code: Select all

SurfaceObject "frontiere_vatican" "Sol/Earth"
{
   Class "surfacefeature"
   Mesh "frontiere.cmod"
   Emissive true
   Radius 0.567
   FixedPosition { Planetographic [ 12.4521 41.90423 0.01 ] }
   FixedAttitude { Heading 180 }
   #Orientation [0 1 0 0]
}

What is wrong? :?:

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

Re: Display of a political border

Post #2by Fenerit » 16.12.2009, 08:57

Try so:

Code: Select all

-- Title: Vatican border on/ff

front = celestia:find("Sol/Earth/frontiere_vatican")
front_select = celestia:select(front)
front:setvisible(not front:visible())

if front:visible() then
   celestia:print("Vatican border ON", 2)
else
   celestia:print("Vatican border OFF", 2)
end

and put Visible false in the .ssc

Code: Select all

SurfaceObject "frontiere_vatican" "Sol/Earth"
{
   Class "surfacefeature"
   Visible false
   Mesh "frontiere.cmod"
   Emissive true
   Radius 0.567
   FixedPosition { Planetographic [ 12.4521 41.90423 0.01 ] }
   FixedAttitude { Heading 180 }
   #Orientation [0 1 0 0]
}
Never at rest.
Massimo

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 16 years 5 months
Location: Paris France

Re: Display of a political border

Post #3by jogad » 16.12.2009, 10:28

Massimo,

Thank you very much.
But it is not better. :?
The only difference is that now I can't even see the border.

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

Re: Display of a political border

Post #4by Fenerit » 16.12.2009, 11:15

Try to make 2 scripts:
front_visible.celx

Code: Select all

-- Title: Vatican border on
front = celestia:find("Sol/Earth/frontiere_vatican")
front_select = celestia:select(front)
front:setvisible(true)
celestia:print("Vatican border ON", 2)
 


front_invisible.celx

Code: Select all

-- Title: Vatican border off

front = celestia:find("Sol/Earth/frontiere_vatican")
front_select = celestia:select(front)
front:setvisible(false)
celestia:print("Vatican border OFF", 2)


and remove Visible false from .ssc. Otherwise you need a function keyboard based or the LUATOOLS. (whether I'm not wrong...)
Never at rest.
Massimo

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 16 years 5 months
Location: Paris France

Re: Display of a political border

Post #5by jogad » 16.12.2009, 12:16

As I was trying your suggestions I found this:
Because I work on virtual textures, I run celestia with a url link that takes me above Rome.
The problem is that this link set the time to pause and the script does not start.

The problem is solved!
The script was not guilty but I was :oops:

The line "Visible false" is a good idea and I keep it :wink:

Thank you again.

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

Re: Display of a political border

Post #6by Fenerit » 16.12.2009, 15:20

De rien.
Never at rest.
Massimo


Return to “Help Central”