How can I slow do the "Go to" speed?
-
Topic authorprogrammerintraining
- Posts: 1
- Joined: 30.03.2008
- With us: 16 years 7 months
How can I slow do the "Go to" speed?
Is there any way to slow down the travel speed? I travel from outside the Milky Way to the sun so fast I can hardly see it!
- Hungry4info
- Posts: 1133
- Joined: 11.09.2005
- With us: 19 years 2 months
- Location: Indiana, United States
Re: How can I slow do the "Go to" speed?
I think Celestia could certainly use improved velocity measurements and indicators. Setting the "go to" speed, for one, as well as setting a non-"Go to" speed. Perhaps a dialogue box which asks us for a velocity, lets us select units, and after pressing "Okay" or "enter" or whatever, the observer assumes that speed.
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: How can I slow do the "Go to" speed?
This can be done quite simply with a celx script:
Now, as an exercise, you can try making the duration vary according to the distance from the target...
Code: Select all
-- Title: Slower Goto command
-- Modify the following value to your specific needs:
duration = 20
function slowGoto()
sel = celestia:getselection()
obs = celestia:getobserver()
obs:follow(sel)
obs:goto(sel, duration)
end
keyhandlers =
{
g = slowGoto
}
function handlekey(k)
handler = keyhandlers[k.char]
if handler ~= nil then
handler()
return true
else
return false
end
end
celestia:registereventhandler("key", handlekey)
Now, as an exercise, you can try making the duration vary according to the distance from the target...
Last edited by Vincent on 07.04.2008, 11:26, edited 1 time in total.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Posts: 835
- Joined: 27.09.2004
- With us: 20 years 1 month
- Location: Massachusetts, USA
Re: How can I slow do the "Go to" speed?
In fact all of the celx commands goto, gotolonglat, gotolocation, gotodistance, gotosurface, center, and centerorbit have a duration component.
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M
Re: How can I slow do the "Go to" speed?
Vincent:
Do we have to enter a value for getselection? If so, what do we enter?
Frank
Do we have to enter a value for getselection? If so, what do we enter?
Frank
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: How can I slow do the "Go to" speed?
Frank,fsgregs wrote:Do we have to enter a value for getselection? If so, what do we enter?
getselection() automatically returns the current selection.
So, users don't have to enter any value. Did you meet any problem
with this script?
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Re: How can I slow do the "Go to" speed?
Vincent:
The script worked just fine. In fact, it works so well that I would love to see it active all of the time, whenever I launch Celestia 1.5.0.
To the best of my knowledge, Celestia can only run one celx script at a time. So, if I have the slowgo script active and I want to launch a new script, I guess slowgo.celx stops functioning as soon as the new celx script launches. Is that correct? If so, is there a way to incorporate it into the celestia.cfg file, or somehow keep it active as long as 1.5.0 is running, no matter what other scripts are launched?
Frank
The script worked just fine. In fact, it works so well that I would love to see it active all of the time, whenever I launch Celestia 1.5.0.
To the best of my knowledge, Celestia can only run one celx script at a time. So, if I have the slowgo script active and I want to launch a new script, I guess slowgo.celx stops functioning as soon as the new celx script launches. Is that correct? If so, is there a way to incorporate it into the celestia.cfg file, or somehow keep it active as long as 1.5.0 is running, no matter what other scripts are launched?
Frank
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: How can I slow do the "Go to" speed?
Frank,fsgregs wrote:The script worked just fine. In fact, it works so well that I would love to see it active all of the time, whenever I launch Celestia 1.5.0.
To do so, you just need to save the following script as start.celx, and set InitScript "start.celx" in celestia.cfg:
Code: Select all
-- Modify the following value to your specific needs:
duration = 20
function slowGoto()
sel = celestia:getselection()
obs = celestia:getobserver()
obs:goto(sel, duration)
end
keyhandlers =
{
g = slowGoto
}
function handlekey(k)
handler = keyhandlers[k.char]
if handler ~= nil then
handler()
return true
else
return false
end
end
celestia:registereventhandler("key", handlekey)
function CEL(source)
local script = celestia:createcelscript(source)
while script:tick() do
wait(0)
end
end
CEL([[
{
# ... Beginning of script
# PASTE YOUR WHOLE STANDARD START SCRIPT HERE
# End of standard script...
}
]])
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Re: How can I slow do the "Go to" speed?
Vincent:
ThAT WORKED FINE AGAIN. Thank you. Now, my start.celx script has a configurable value for how fast the go to command is. What a wonderful feature.
I suggest that it is so useful it should be put into celestia.cfg as a variable, or incorporated into Celestia's default start.celx.
Frank
ThAT WORKED FINE AGAIN. Thank you. Now, my start.celx script has a configurable value for how fast the go to command is. What a wonderful feature.
I suggest that it is so useful it should be put into celestia.cfg as a variable, or incorporated into Celestia's default start.celx.
Frank
Re: How can I slow do the "Go to" speed?
Really nice . I tried both possibilities; both work fine.
I think, I will let the start cel as default and select the slow goto by selecting the script.
Thanks a lot, Vincent !
I think, I will let the start cel as default and select the slow goto by selecting the script.
Thanks a lot, Vincent !
Max
Celestia 1.61 and ED-Version
Celestia 1.61 and ED-Version