Move along line of sight

All about writing scripts for Celestia in Lua and the .cel system
Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Move along line of sight

Post #1by ajtribick » 23.04.2004, 10:43

I'm trying to write a script that moves the camera along the line of sight, however the problem is that somewhere in the middle of this I need to be able to change the orientation of the camera, via a center { } command or equivalent.

I have a nasty suspicion this won't work in .cel scripts though.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #2by don » 23.04.2004, 20:10

Could you post a few lines of the code you are trying to use?
-Don G.
My Celestia Scripting Resources page

Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Post #3by ajtribick » 23.04.2004, 20:25

Code: Select all

{

select { object "Zeta2 Reticuli" }
goto {
   time 2
   distance 52.5
}
wait { duration 2.5 }
move {
   duration 10
   velocity 3e6
}
print {
   text "End"
   row -3
   duration 3
}
wait { duration 3 }

}


Using the syntax at http://www.donandcarla.com/Celestia/cel_scripting/guide/v1_0d_Cel_Script_Guide.htm#_Toc60995038, I expected this to move the camera towards Zeta Reticuli.

Although the move command isn't exactly what I want, what I really want to do is set the velocity (equivalent of pressing A or Z) and then carry on execution of the script, not set the camera to move for a certain duration then stop.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #4by don » 23.04.2004, 21:05

Hi chaos,

The example code you point to has been corrected but not yet posted. The velocity parameter is a vector, which means 3 values need to be specified -- one for each axis (X, Y, and Z). Your example would be...

Code: Select all

move { duration 10 velocity [0 0 3e6] }


... where the 3e6 value would be placed in one of the 3 places (currently in Z).

In reality, each of the 3 individual vector values would be a number (positive or negative) in order to move the camera along a given path. However, I do not know how to arrive at the necessary values, as vectors are something I do not fully understand.

Maybe someone else could help out here?
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.


Return to “Scripting”