Script equivalent for right-click-drag

All about writing scripts for Celestia in Lua and the .cel system
Topic author
jrichelle
Posts: 4
Joined: 30.12.2007
With us: 16 years 10 months
Location: Belgium

Script equivalent for right-click-drag

Post #1by jrichelle » 12.01.2008, 06:20

I'm new at writing .cel scripts, sorry if this is very basic.

I'm looking for the command (or commands combination) that permit to do the displacements as can be done with the right-click-drag of the mouse.

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Script equivalent for right-click-drag

Post #2by Vincent » 12.01.2008, 10:26

jrichelle wrote:I'm new at writing .cel scripts, sorry if this is very basic.

I'm looking for the command (or commands combination) that permit to do the displacements as can be done with the right-click-drag of the mouse.

You may want to have a look at Don Goyette's Cel scripting guide:
http://celestiamotherlode.net/catalog/d ... ation.html

Here's a summary of what it tells about the orbit command:

Code: Select all

orbit { duration [number], rate [number], axis [axis] }

duration :Number of seconds to orbit the object.
rate : Speed at which to orbit the object, in units of degrees per second. Positive and negative values are used to indicate the direction of orbit
axis: Define which axis to orbit around [X Y Z]. Set the X, Y, or Z value to 1 for yes, 0 for no. You may also specify multiple axes. For example, to specify X as the axis, use [1 0 0], for Y use [0 1 0], and for Z, use [0 0 1]. To specify both, the X and Y axes, use [1 1 0].

The following example orbits Saturn for 12 seconds:

Code: Select all

select { object "Sol/Saturn" }
center { }
goto   { time 3
         distance 8
         up [ 0 1 0 ]
         upframe "equatorial" }
wait   { duration 3 }
orbit  { axis [ 0 1 0 ]
         rate 30
         duration 12 }
@+
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 author
jrichelle
Posts: 4
Joined: 30.12.2007
With us: 16 years 10 months
Location: Belgium

Re: Script equivalent for right-click-drag

Post #3by jrichelle » 13.01.2008, 22:10

Vincent wrote:...You may want to have a look at Don Goyette's Cel scripting guide:
http://celestiamotherlode.net/catalog/d ... ation.html

Here's a summary of what it tells about the orbit command:

Code: Select all

orbit { duration [number], rate [number], axis [axis] }

...


Thanks a lot, I miss it.

Regards,
Jean


Return to “Scripting”