Hi all:
I am working on an exciting add-on controlled by a script, and I have been searching for a way to move my view forward in a straight line, much as you might do in Celestia by pressing the [A] key and moving your view independently of any orbits or other objects.
I have not found any script commands that duplicate the [A] key. Maybe I'm just missing them.
Are there any? If so, how would they be used?
Thanks in advance.
Frank
Can scripting move your view forward in straight line?
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Can scripting move your view forward in straight line?
Hi Frank,fsgregs wrote:I have not found any script commands that duplicate the [A] key. Maybe I'm just missing them.
You can use the following celx code to set the speed of the observer:
Code: Select all
speed = 1e-4 -- in microlightyears/s
obs = celestia:getobserver()
obs:setspeed(speed)
@+
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
-
Topic authorfsgregs
- Posts: 1307
- Joined: 07.10.2002
- With us: 22 years 1 month
- Location: Manassas, VA
Re: Can scripting move your view forward in straight line?
Thanks, Vincent. I will use your 3 lines when needed in celx scripts to move the view in a particular direction.
Is there something similar for use in cel scripts? I see there is a command called "Move". I have not used it and while I read the brief comment about the command on the Scripts cel WIKI, I don't really understand what parameters it would use, or how to use them. It seems like it would allow a script writer to move their view in a particular direction.
If true, could you provide a short descriptive example of what a "Move" command line would look like?
Thank you
Frank
Is there something similar for use in cel scripts? I see there is a command called "Move". I have not used it and while I read the brief comment about the command on the Scripts cel WIKI, I don't really understand what parameters it would use, or how to use them. It seems like it would allow a script writer to move their view in a particular direction.
If true, could you provide a short descriptive example of what a "Move" command line would look like?
Thank you
Frank
- Adirondack
- Posts: 528
- Joined: 01.03.2004
- With us: 20 years 9 months
Re: Can scripting move your view forward in straight line?
Frank,
the move command should look like
Duration = sec.
Velocity = km/s
Adirondack
the move command should look like
Code: Select all
move { duration 10 velocity 10000 }
Duration = sec.
Velocity = km/s
Adirondack
We all live under the same sky, but we do not have the same horizon. (K. Adenauer)
The horizon of some people is a circle with the radius zero - and they call it their point of view. (A. Einstein)
The horizon of some people is a circle with the radius zero - and they call it their point of view. (A. Einstein)